Coding a program to send the sensed temperature to the internet
Now, we need to develop the software for connecting the temperature sensor to the internet using the ESP8266 Wi-Fi module. Let's begin:
- Open the Arduino menu and select Preferences.
- Add https://arduino.esp8266.com/stable/package_esp8266com_index.json to the Additional Boards Manager URLs field. You will need to separate the text with a comma from the link of the STM32 module that we installed in the first chapters.
- Install the esp8266 platform. Go to the Tools menu and select Board followed by Boards Manager (see Figure 9.16):
- Including the libraries will be the first step in the code:
#include <DallasTemperature.h> #include <ESP8266WiFi.h> #include <ESP8266WebServer.h>
setup()
will contain all the programming logic. We need to start the serial data transmission and assign the speed of the transfer (this time we will use 115...