We'll test our program using the following steps:
- As explained in the Writing a program for ESP32 section, compile and upload the weatherweb project into the ESP32 board, and then test our /temp request using a browser.
- After doing this, navigate to http://<ip address of ESP32>/temp:
- You can run the App.js program using the following node command:
$ node App.js
This program will run in the background within the OS. You can stop this program by pressing the Ctrl + C keys.
You can see our Node.js program is running, as shown in Figure 6.8:
- Now open a browser and navigate to the IP address of the Node.js application. You should see the data visualization of the temperature data, as shown in Figure 6.9:
The browser receives temperature sensor information from the weatherfeeder server. Figure 6.9 shows a graphical web interface where the x axis represents the data counter, and the y axis represents the temperature value. According to the figure, the temperature value equals 22 °C.
You also can see the program output from the Node.js application, weatherfeeder, as shown in Figure 6.10:
You should now be able to see temperature data from the ESP32 board using a Terminal application, such as CoolTerm.
You can improve this project by adding additional sensor devices and new visualization models on HTML5 at https://www.flotcharts.org/. You can try programming samples from the Flot project.