Chapter 4. Control Devices from Anywhere
In the previous chapter, we saw how to make measurements with the ESP8266 chip, and send this data to the web. We saw how to log this data on the cloud, and display it inside a dashboard that can be accessed from anywhere.
In this chapter, we are going to see the reverse situation: how can we control devices from anywhere in the world? We will see that it requires using a different protocol than the classical HTTP, called MQTT.
MQTT can be difficult to use; this is why we will use a library that I created, called aREST, which will simplify the whole process. aREST only uses some of the powerful features of MQTT, but it will be more than enough here to control devices from anywhere.
We will see two examples in this chapter: how to dim an LED and how to control a lamp, both from anywhere in the world. We will see how to do that using a dashboard in the cloud.
At the end of this project, you will be able to control a lamp connected to your ESP8266...