ESP-IDF : ESP32 as SoftAP
|We have connected to existing network using ESP32, we have sent messages to a TCP server running on different machine in our network. Now it is time for making ESP32 to create it’s own network. ESP32 has something called SoftAP mode, in which it can create WiFi network and can accept upto 4 clients. In this post we will learn how to put ESP32 in SoftAP mode and list the devices connected to our network (SoftAP mode also allows connected clients to communicate with each other)
This blog assumes that you already have ESP – IDF , to setup ESI – IDF check out this post. Most of the code for this blog has been adapted from here
Steps involved in making ESP32 as soft ap:
- set static IP for AP
- start DHCP server
- Configure WiFi as AP
- start WiFi
Using tcpip_adapter_set_ip_info we can configure our AP (config includes details such as netmask,gateway address etc.,). tcpip_adapter_dhcps_start will start the DHCP server
cant get the ip from router.