What I m doing wrong with Webserver lib
Posted: Mon May 19, 2025 4:32 pm
Hello, I m trying to use this library https://github.com/pangodream/ESP2SOTA/ ... P2SOTA.cpp
The code is light but It don't work on my side. The device freeze after the OTA update, I need to powercycle it to have it working again.
I have tried to add a reset page
It work, it restart but don't display the message, so from a forum I have found the solution, I need to use
But I use the same tricks for the OTA, I don't have the freeze, but I still haven't the message
What I m missing ?
The code is light but It don't work on my side. The device freeze after the OTA update, I need to powercycle it to have it working again.
I have tried to add a reset page
Code: Select all
//Display reset page
server.on("/reset", HTTP_GET, [&]() {
server.sendHeader(F("Connection"), F("close"));
server.send(200, F("text/plain"), F("Reset device!"));
ESP.restart();
});
Code: Select all
//Display reset page
server.on("/reset", HTTP_GET, [&]() {
server.sendHeader(F("Connection"), F("close"));
server.send(200, F("text/plain"), F("Reset device!"));
server.stop();
delay(2000);
ESP.restart();
delay(2000);
});
Code: Select all
/*handling uploading firmware file */
server.on("/update", HTTP_POST, [&]() {
server.sendHeader(F("Connection"), F("close"));
server.send(200, "text/plain", (Update.hasError()) ? "FAIL" : "OK");
server.stop();
delay(2000);
ESP.restart();
delay(2000);
}, [&]()