Skip to content

Commit

Permalink
tentative fix for #720
Browse files Browse the repository at this point in the history
  • Loading branch information
tablatronix committed Sep 3, 2018
1 parent 8b579bb commit c1f018c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion WiFiManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,15 @@ boolean WiFiManager::autoConnect(char const *apName, char const *apPassword) {

// if already connected, or try stored connect
// @note @todo ESP32 has no autoconnect, so connectwifi will always be called unless user called begin etc before
if (WiFi.status() == WL_CONNECTED || connectWifi("", "") == WL_CONNECTED) {
// @todo check if correct ssid == saved ssid when already connected
bool connected = false;
if (WiFi.status() == WL_CONNECTED){
connected = true;
DEBUG_WM(F("AutoConnect: ESP Already Connected"));
setSTAConfig();
}

if(connected || connectWifi("", "") == WL_CONNECTED){
//connected
DEBUG_WM(F("AutoConnect: SUCCESS"));
DEBUG_WM(F("STA IP Address:"),WiFi.localIP());
Expand Down

0 comments on commit c1f018c

Please sign in to comment.