ayushsharma82 / ESPConnect

Simple & Easy WiFi Manager with Captive Portal for ESP8266 / ESP32
GNU General Public License v3.0
95 stars 32 forks source link

BUG :Fail to find any SSID if connection is already saved #16

Open milansim opened 1 year ago

milansim commented 1 year ago

This is quite problematic ! If device is configured for one network and then ported to new location where is different network credentials device is in endless loop searching for SSID's but dont find any

only solution that work in this case but is not a viable option for me if (ESPConnect.isConfigured()){ESPConnect.erase();}

Also I have a wifi check procedure in place as ESP32 wifi is buggy but for some reason when using your library ESP think it is still connected while it is actually not connected. I tried both if (ESPConnect.isConnected()){ if (WiFi.status() == WL_CONNECTED){ both return true while wifi disconnected !?!

milansim commented 1 year ago

f (WiFi.status() == WL_CONNECTED){ problem seems to be only when on my guest network, not related to your library

khseal commented 1 year ago

I confirm there is a bug. Fix please.

adojang commented 1 year ago

A workaround I used is to edit line 231 if(WiFi.status() != WL_CONNECTED){ in the ESPCOnnect.cpp, if(WiFi.status() != WL_CONNECTED){ ESPCONNECT_SERIAL("Connection to STA Falied [!]\n"); //This is a mod I added that will delete all saved networks and reboot the ESP32 if (ESPConnect.isConfigured()){ ESPCONNECT_SERIAL("Deleting All Saved Networks and Rebooting...\n"); ESPConnect.erase(); ESP.restart(); } }

This is a workaround with one major problem: if your Wifi is ever off when the ESP boots you'll have to reconfigure the device through the captive portal.