Monitoring the temperature and humidity
In this second project of the chapter, we are going to do something different. We will monitor the temperature and humidity of the plant from the cloud dashboard that we already used earlier in the chapter. We are first going to configure the board, and then set up the cloud dashboard.
As we already saw how to use the aREST cloud platform earlier in the book, I will only highlight the most important parts of the code.
The first step is to include all the required libraries, including the aREST library:
#include <ESP8266WiFi.h> #include <PubSubClient.h> #include <aREST.h> #include <SHT1x.h>
Then, we give an ID to our device:
char* device_id = "gveie2y5";
As usual, you also need to put your Wi-Fi name and password here:
const char* ssid = "your-wifi"; const char* password = "your-password";
In the loop()
function of the sketch, we make the measurements from the sensor, and handle the connection with the...