OTA+Webserver issues in AP_STA Mode with STA disconnected
Posted: Wed Feb 17, 2021 2:59 pm
Hi,
I'm booting the ESP in AP_STA mode and usually it connects to my Wifi. I'm using ArduinoOTA and the Webserver to serve a User-Interface or, if required, a captive portal to set new Wifi credentials.
Server and OTA work fine when the ESP is connected to my Wifi, either via its STA IP or directly connected to its AP.
However, when the ESP is not connected (e.g. the wifi credentials changed ir the SSID is unavailable) the AP still works, but the Webserver is unreliable and OTA breaks during the upload.
I guess this is because the ESP is hopping channels to search for the SSID it is configured to connect to, losing the connection to the associated client.
So: What is the best way solve this issue? Can I temporary disable channel-hopping / auto-reconnect while a client is connected to the ESPs AP? Or should I change the mode from AP_STA to AP as soon a client connects?
I don't have clients connected to the AP on a regular basis in my use-case. It is just used for OTA or to set new wifi credentials in case they changed.
I haven't found anything about this in the docs or OTA examples.
Any recommendations?
I'm booting the ESP in AP_STA mode and usually it connects to my Wifi. I'm using ArduinoOTA and the Webserver to serve a User-Interface or, if required, a captive portal to set new Wifi credentials.
Server and OTA work fine when the ESP is connected to my Wifi, either via its STA IP or directly connected to its AP.
However, when the ESP is not connected (e.g. the wifi credentials changed ir the SSID is unavailable) the AP still works, but the Webserver is unreliable and OTA breaks during the upload.
I guess this is because the ESP is hopping channels to search for the SSID it is configured to connect to, losing the connection to the associated client.
So: What is the best way solve this issue? Can I temporary disable channel-hopping / auto-reconnect while a client is connected to the ESPs AP? Or should I change the mode from AP_STA to AP as soon a client connects?
I don't have clients connected to the AP on a regular basis in my use-case. It is just used for OTA or to set new wifi credentials in case they changed.
I haven't found anything about this in the docs or OTA examples.
Any recommendations?