Chapter 17. The Internet of Things
17.0 Introduction
The Internet of Things (IoT) is the rapidly growing network of devices (things) connected to the internet. That doesnât just mean more and more computers using browsers, but actual appliances and wearable and portable technology. This includes all sorts of home automation, from smart appliances and lighting to security systems and even internet-operated pet feeders, as well as lots of less practical but fun projects.
In this chapter, you learn how your Raspberry Pi can participate in the IoT in various ways.
17.1 Controlling GPIO Outputs Using a Web Interface
Problem
You want to control general-purpose input/output (GPIO) outputs using a web interface to your Raspberry Pi.
Solution
Use the bottle
Python web server library (Recipe 7.17) to create an HTML web interface to control the GPIO port.
To make this recipe, you will need the following:
-
Breadboard and jumper wires (see âPrototyping Equipment and Kitsâ)
-
Three 1kΩ resistors (see âResistors and Capacitorsâ)
-
Three LEDs (see âOptoElectronicsâ)
-
Tactile push switch (see âMiscellaneousâ)
Figure 17-1 shows the breadboard layout for this.
An alternative to using a breadboard is to attach a Raspberry Squid and Squid Button (see Recipes 10.10 and 10.11). You can plug these ...
Get Raspberry Pi Cookbook, 4th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.