mirror of
https://github.com/alexhopeoconnor/WiFiManager.git
synced 2026-10-14 23:21:31 +10:00
fix #527 for esp8266
This commit is contained in:
+7
-6
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user