fix #527 for esp8266

This commit is contained in:
Shawn A
2018-02-18 20:23:04 -06:00
parent 9f4156437b
commit 97398d7ce2
2 changed files with 8 additions and 7 deletions
+7 -6
View File
@@ -172,13 +172,14 @@ boolean WiFiManager::autoConnect(char const *apName, char const *apPassword) {
WiFi.hostname(_hostname);
#elif defined(ESP32)
WiFi.setHostname(_hostname);
if(WiFi.status() == WL_CONNECTED){
DEBUG_WM("reconnecting to set new hostname");
// WiFi.reconnect(); // does not reset dhcp
WiFi_Disconnect();
delay(500); // need a delay for disconnect to change status()
}
#endif
if(WiFi.status() == WL_CONNECTED){
DEBUG_WM("reconnecting to set new hostname");
// WiFi.reconnect(); // does not reset dhcp
WiFi_Disconnect();
delay(500); // need a delay for disconnect to change status()
}
}
// if already connected, or try stored connect