Testing the program

We've just written our program, weatherweb, so it's time to compile and upload it to the ESP32 board; you can type this command:

$ make flash

Now we can test our program. To do this, open a serial software, such as CoolTerm, to connect to the ESP32 board. You should see that your ESP32 board gets an IP address from the Wi-Fi hotspot, as shown in the following figure:

Figure 6.3: The ESP32 program output on the serial Terminal

For instance, if the IP address for the ESP32 board is 192.168.1.16, you can open a browser and navigate to http://192.168.1.16/weather. You should get the temperature and humidity data from the ESP32 board; Figure 6.4 shows a sample output:

Figure 6.4: A browser feeding sensor data from ESP32

We've now set up a basic program that provides us with temperature and humidity data when queried. Next, we are going to make our program perform an auto-refresh with the weather application.

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

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