Book Image

Internet of Things Projects with ESP32

By : Agus Kurniawan
Book Image

Internet of Things Projects with ESP32

By: Agus Kurniawan

Overview of this book

ESP32 is a low-cost MCU with integrated Wi-Fi and BLE. Various modules and development boards-based on ESP32 are available for building IoT applications easily. Wi-Fi and BLE are a common network stack in the Internet of Things application. These network modules can leverage your business and projects needs for cost-effective benefits. This book will serve as a fundamental guide for developing an ESP32 program. We will start with GPIO programming involving some sensor devices. Then we will study ESP32 development by building a number of IoT projects, such as weather stations, sensor loggers, smart homes, Wi-Fi cams and Wi-Fi wardriving. Lastly, we will enable ESP32 boards to execute interactions with mobile applications and cloud servers such as AWS. By the end of this book, you will be up and running with various IoT project-based ESP32 chip.
Table of Contents (12 chapters)

The auto-refresh weather application

We will now set up a weatherweb project. Here, we will receive information about temperature and humidity via a browser. If you want to get the latest information from the ESP32 board, you will have to open a new request to the ESP32 board manually. Let's now automate this activity, as follows:

  1. To perform an auto-refresh on HTML, use http-equiv="refresh" on the <meta> tag. We can modify our weatherweb project by declaring the WEATHER_TXT_REF variable:
static const char *WEATHER_TXT_REF =
"<meta http-equiv=\"refresh\" content=\"5\" >"
"<p>Temperature: %d </p>"
"<p>Humidity: %d %%</p>"