Using Wi-Fi
Nodes in a Wi-Fi network form a star topology, which means a central hub exists and other nodes connect to the central hub to communicate within the Wi-Fi network or with the outside world if the central hub is connected to a router or is itself a router. Therefore, we see two different modes of operation in a Wi-Fi network:
- Station (STA) mode
- Access point (AP) mode
We can configure ESP32 in both modes. In STA mode, ESP32 can connect to an access point and join a Wi-Fi network as a node. When it is in AP mode, other Wi-Fi-capable devices, such as mobile phones, can connect to the Wi-Fi network that ESP32 starts as the access point. The following figure shows both cases with two different Wi-Fi networks:
Let's start with an example of STA mode.
STA mode
In this example, we will configure ESP32 in STA mode to connect to a local Wi-Fi network and send a GET
request...