This example shows how to use Wi-Fi SoftAP and Station at the same time.
Use menuconfig to set Example configuration SSID and password for each of STA and AP.
Open the project configuration menu (idf.py menuconfig
).
In the Example Configuration
menu:
- Set the Wi-Fi configuration.
- Set
WiFi AP SSID
. - Set
WiFi AP Password
. - Set
WiFi STA SSID
. - Set
WiFi STA Password
.
- Set
Optional: If you need, change the other options according to your requirements.
Build the project and flash it to the board, then run the monitor tool to view the serial output:
Run idf.py -p PORT flash monitor
to build, flash and monitor the project.
(To exit the serial monitor, type Ctrl-]
.)
See the Getting Started Guide for all the steps to configure and use the ESP-IDF to build projects.
- ESP-IDF Getting Started Guide on ESP32
- ESP-IDF Getting Started Guide on ESP32-S2
- ESP-IDF Getting Started Guide on ESP32-C3
Note that the output, in particular the order of the output, may vary depending on the environment.
Console output shows connection to AP and connection from client to ESP32 SoftAP.
I (1543) wifi-softap+sta: Station connected with IP: 192.168.1.168, GW: 192.168.1.1, Mask: 255.255.255.0.
I (15363) wifi-softap+sta: SoftAP client connected with IP: 192.168.4.2.
For any technical queries, please open an issue on GitHub.