Skip to content

Instantly share code, notes, and snippets.

@CelliesProjects
Created January 15, 2021 13:30
Show Gist options
  • Save CelliesProjects/df38ec4af50426166591be5682296c69 to your computer and use it in GitHub Desktop.
Save CelliesProjects/df38ec4af50426166591be5682296c69 to your computer and use it in GitHub Desktop.
poc code to show how to reboot your esp over http with me-no-dev ASyncWebserver.
server.on("/hw-reset", HTTP_GET, [](AsyncWebServerRequest *request){
request->onDisconnect([](){
#ifdef ESP32
ESP.restart();
#elif defined(ESP8266)
ESP.reset();
#endif
});
request->send(200, "text/plain","Restarting ...");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment