Wi-Fi, or a wireless network, is a communication model that makes it possible to interact with another system. With these, we can perform common network tasks over network protocols such as TCP/IP, UDP/IP, HTTP, or SMTP/POP3. Since the ESP32 chip has built-in Wi-Fi and a Bluetooth module, we connect our ESP32 board to an existing network.
To work with Wi-Fi on ESP32, we need the esp_wifi.h header file to be included in our project:
#include "esp_wifi.h"
Wi-Fi programming in ESP32 uses an event-based model. We call the Wi-Fi API from the board driver in order to access the Wi-Fi module on the ESP32 board. The ESP32 Wi-Fi API supports Wi-Fi security such as WPA, WPA2, and WEP. A list of Wi-Fi API functions can be found at https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/network/esp_wifi.html.
In this chapter, we will...