Testing the program

We'll test our program using the following steps:

  1. 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.
  2. After doing this, navigate to http://<ip address of ESP32>/temp:

Figure 6.7: Accessing temperature data from a browser
  1. 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:

Figure 6.8: Running the web server in Node.js
  1. 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:

Figure 6.9: The program output of temperature data in a browser

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:

Figure 6.10: The server program output in the Terminal

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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset