mirror of
https://github.com/alexhopeoconnor/WiFiManager.git
synced 2026-10-16 07:51:36 +10:00
fix esp32 erase flash
This commit is contained in:
+2
-2
@@ -1561,8 +1561,8 @@ bool WiFiManager::WiFi_eraseConfig(void) {
|
||||
// }
|
||||
// }
|
||||
// return true;
|
||||
#else
|
||||
// @todo
|
||||
#elif defined(ESP32)
|
||||
return WiFi.disconnect(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,24 @@ void setup() {
|
||||
Serial.println(modes[WiFi.getMode()]);
|
||||
WiFi.printDiag(Serial);
|
||||
|
||||
//Local intialization. Once its business is done, there is no need to keep it around
|
||||
WiFiManager wifiManager;
|
||||
//reset settings - for testing
|
||||
//wifiManager.resetSettings();
|
||||
|
||||
//sets timeout until configuration portal gets turned off
|
||||
//useful to make it all retry or go to sleep
|
||||
//in seconds
|
||||
wifiManager.setConfigPortalTimeout(180);
|
||||
|
||||
//fetches ssid and pass and tries to connect
|
||||
//if it does not connect it starts an access point with the specified name
|
||||
//here "AutoConnectAP"
|
||||
//and goes into a blocking loop awaiting configuration
|
||||
if(!wifiManager.autoConnect("AutoConnectAP")) {
|
||||
Serial.println("failed to connect and hit timeout");
|
||||
}
|
||||
|
||||
pinMode(TRIGGER_PIN, INPUT);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user