fix esp32 erase flash

This commit is contained in:
Shawn A
2018-01-24 21:24:21 -06:00
parent 1f691ae35c
commit a52740ecff
2 changed files with 20 additions and 2 deletions
+2 -2
View File
@@ -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);
}