Skip to content

Commit

Permalink
fix #527 for esp8266
Browse files Browse the repository at this point in the history
  • Loading branch information
tablatronix committed Feb 19, 2018
1 parent 9f41564 commit 97398d7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions WiFiManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion WiFiManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ class WiFiManager
boolean _cpClientCheck = false; // keep cp alive if cp have station
boolean _webClientCheck = true; // keep cp alive if web have client
boolean _scanDispOptions = false; // show percentage in scans not icons
const char * _hostname = "";
const char * _hostname = "wmtest";

const char* _customHeadElement = ""; // store custom head element html from user

Expand Down

0 comments on commit 97398d7

Please sign in to comment.