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 ...

Get Internet of Things with ESP8266 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.