Developing the ESP32 program

We start by creating an ESP32 project called smartmobile and name the main program file smartmobile.c. Our program will build a simple web server to serve the HTTP requests that are described in Figure 9.1.

Let's start working on our smartmobile.c file:

  1. Declare all the required header files in our program. In the following code, we include the files needed to create this project:
#include <esp_wifi.h>#include <esp_event_loop.h>#include <esp_log.h>#include <esp_system.h>#include <nvs_flash.h>#include <sys/param.h>#include "tcpip_adapter.h"#include "lwip/err.h"#include "lwip/sockets.h"#include "lwip/sys.h"#include "lwip/netdb.h"#include "lwip/dns.h"#include "freertos/event_groups.h"#include <esp_http_server.h> ...

Get Internet of Things Projects with ESP32 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.