maakbaas / esp8266-iot-framework

Framework for IoT projects implementing HTTPS requests, a React web interface, WiFi manager, live dashboard, configuration manager, file manager and OTA updates.
GNU General Public License v3.0
417 stars 113 forks source link

Device goes straight to Captive Portal even when wifi is defined if AP is not available #122

Closed joshbmarshall closed 2 years ago

joshbmarshall commented 3 years ago

Hi I have a situation where a wireless cellular adapter is powered by the same (battery) power as the ESP8266 (a Lolin D1 Pro).

The wifi adapter takes 20-30 seconds to start up and advertise its WiFi.

I have the default 60000 ms timeout set in the wifimanager setup call, but the device goes to captive portal only a second or so after starting up.

If the wifi adapter is turned on and settles before I turn on the ESP device, it connects every time.

Since the ESP in captive portal mode never retries the stored wifi details, I have to restart it to get it to connect again.

maakbaas commented 2 years ago

Should be fixed in the commit above which will be part of the upcoming release!

the default waitForConnectResult only checks for WL_DISCONNECTED, but I have modified it to also check for WL_NO_SSID_AVAIL