Procházet zdrojové kódy

corrected the "clear_wifi_config" functions with WiFiManagers "resetSettings()". This should solve #120

Marcel Jira před 8 roky
rodič
revize
b046fcf947
1 změnil soubory, kde provedl 3 přidání a 1 odebrání
  1. 3 1
      lib/WebServer/MiLightHttpServer.cpp

+ 3 - 1
lib/WebServer/MiLightHttpServer.cpp

@@ -7,6 +7,7 @@
 #include <string.h>
 #include <TokenIterator.h>
 #include <index.html.gz.h>
+#include <WiFiManager.h>
 
 void MiLightHttpServer::begin() {
   applySettings(settings);
@@ -111,7 +112,8 @@ void MiLightHttpServer::handleSystemPost() {
         server.send_P(200, TEXT_PLAIN, PSTR("true"));
 
         delay(100);
-        ESP.eraseConfig();
+        WiFiManager wifiManager;
+        wifiManager.resetSettings();
         delay(100);
         ESP.restart();