Skip to content

Commit

Permalink
fix for auto connect racing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
tzapu committed Mar 5, 2016
1 parent 0962d71 commit b994877
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion WiFiManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit b994877

Please # to comment.