WiFi.begin() interrupts existing ESP-Accesspoint
Posted: Mon Mar 21, 2022 11:54 am
Hello all,
I would like to integrate a login procedure into my ESP32 Arduino Sketch as follows:
1. the ESP starts in WIFI_AP_STA mode.
2. the user connects to the accesspoint.
3. the user calls http://192.168.4.1 and gets to the login page.
4. the user enters his WLAN access data into a form and presses a "Connect now" button
5. the ESP connects with WiFi.begin(ssid, password) to the router of the user.
The dynamically generated IP address (WiFi.localIP()) is displayed to the user on the login page.
Problem: After step 5, the connection to the access point (192.168.4.1) breaks down. Apparently WiFi.begin() also terminates the accesspoint.
Of course I can restart the accesspoint in the sketch directly after the WiFi.begin() (with WiFi.softAP(APssid, APpassword); But the short interruption is already enough with make Smartpjhone that they connect again to another favored WLAN network and already one has the user "lost".
So I can't tell the user the IP address as planned in step 6.
How do you do this? Is there a better solution?
How can I execute a WiFi.begin() WITHOUT terminating or restarting the accesspoint of the ESP32?
Thanks for your tips and a good start into the week
I would like to integrate a login procedure into my ESP32 Arduino Sketch as follows:
1. the ESP starts in WIFI_AP_STA mode.
2. the user connects to the accesspoint.
3. the user calls http://192.168.4.1 and gets to the login page.
4. the user enters his WLAN access data into a form and presses a "Connect now" button
5. the ESP connects with WiFi.begin(ssid, password) to the router of the user.
The dynamically generated IP address (WiFi.localIP()) is displayed to the user on the login page.
Problem: After step 5, the connection to the access point (192.168.4.1) breaks down. Apparently WiFi.begin() also terminates the accesspoint.
Of course I can restart the accesspoint in the sketch directly after the WiFi.begin() (with WiFi.softAP(APssid, APpassword); But the short interruption is already enough with make Smartpjhone that they connect again to another favored WLAN network and already one has the user "lost".
So I can't tell the user the IP address as planned in step 6.
How do you do this? Is there a better solution?
How can I execute a WiFi.begin() WITHOUT terminating or restarting the accesspoint of the ESP32?
Thanks for your tips and a good start into the week