diff --git a/WiFiManager.cpp b/WiFiManager.cpp index 930baf2..f923d47 100644 --- a/WiFiManager.cpp +++ b/WiFiManager.cpp @@ -216,7 +216,7 @@ WiFiManager::~WiFiManager() { void WiFiManager::_begin(){ if(_hasBegun) return; _hasBegun = true; - _usermode = WiFi.getMode(); + // _usermode = WiFi.getMode(); #ifndef ESP32 WiFi.persistent(false); // disable persistent so scannetworks and mode switching do not cause overwrites @@ -262,7 +262,7 @@ boolean WiFiManager::autoConnect(char const *apName, char const *apPassword) { if(esp32persistent) WiFi.persistent(false); // disable persistent for esp32 after esp_wifi_start or else saves wont work #endif - _usermode = WIFI_STA; + _usermode = WIFI_STA; // When using autoconnect , assume the user wants sta mode on permanently. // no getter for autoreconnectpolicy before this // https://github.com/esp8266/Arduino/pull/4359 diff --git a/WiFiManager.h b/WiFiManager.h index 0a73eda..7ad1628 100644 --- a/WiFiManager.h +++ b/WiFiManager.h @@ -335,7 +335,7 @@ class WiFiManager unsigned long _saveTimeout = 0; // ms stop trying to connect to ap on saves, in case bugs in esp waitforconnectresult unsigned long _configPortalStart = 0; // ms config portal start time (updated for timeouts) unsigned long _webPortalAccessed = 0; // ms last web access time - WiFiMode_t _usermode = WIFI_OFF; + WiFiMode_t _usermode = WIFI_STA; // Default user mode String _wifissidprefix = FPSTR(S_ssidpre); // auto apname prefix prefix+chipid uint8_t _lastconxresult = WL_IDLE_STATUS; int _numNetworks = 0;