Explorar el Código

respond to reset command

Chris Mullins hace 8 años
padre
commit
28181ad5a4
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      lib/WebServer/MiLightHttpServer.cpp

+ 4 - 0
lib/WebServer/MiLightHttpServer.cpp

@@ -64,6 +64,10 @@ void MiLightHttpServer::handleSystemPost() {
   if (request.containsKey("command")) {
     if (request["command"] == "restart") {
       Serial.println("Restarting...");
+      server.send(200, "text/plain", "true");
+      
+      delay(100);
+      
       ESP.restart();
     }
   }