Controlling your home from a dashboard

In the first project of this chapter, we are going to learn how to control all the modules we assembled before from a cloud dashboard, using the aREST framework we already used in this book.

First, let's configure all the modules. We are going to start with the LED dimmer module, which is the easiest to configure. Here is the complete code for this module:

// Import required libraries #include "ESP8266WiFi.h" #include <PubSubClient.h> #include <aREST.h> // Clients WiFiClient espClient; PubSubClient client(espClient); // Unique ID to identify the device for cloud.arest.io char* device_id = "6g37g4"; // Create aREST instance aREST rest = aREST(client); // WiFi parameters const char* ssid = "wifi-name"; const ...

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.