diff --git a/WiFiManager.cpp b/WiFiManager.cpp index 8014f665..56590a32 100644 --- a/WiFiManager.cpp +++ b/WiFiManager.cpp @@ -220,7 +220,11 @@ int WiFiManager::connectWifi(String ssid, String pass) { WiFi.config(_sta_static_ip, _sta_static_gw, _sta_static_sn); DEBUG_WM(WiFi.localIP()); } - + //fix for auto connect racing issue + if (WiFi.status() == WL_CONNECTED) { + DEBUG_WM("Already connected. Bailing out."); + return WL_CONNECTED; + } //check if we have ssid and pass and force those, if not, try with last saved values if (ssid != "") { WiFi.begin(ssid.c_str(), pass.c_str());