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)

Building your own web server inside ESP32

In this section, we will learn about a more advanced topic to build our own web server. A web server uses HTTP to serve all requests from clients. In this section, we will serve simple HTTP requests. We will use an existing sample program from the ESP32 web server project and implement the following three HTTP request scenarios:

  • The HTTP GET request with the address /hello
  • The HTTP POST request with the address /echo
  • The HTTP PUT request with the address /ctrl

We will implement these requests in our web server.

Building HTTP requests

We will start our project by creating the ESP32 project, called webserver, with webserver.c as the main program. You can initialize the Wi-Fi service...