Page 1 of 1

What I m doing wrong with Webserver lib

Posted: Mon May 19, 2025 4:32 pm
by Nathan_44
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

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();
  });
It work, it restart but don't display the message, so from a forum I have found the solution, I need to use

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);
  });
But I use the same tricks for the OTA, I don't have the freeze, but I still haven't the message

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);
  }, [&]()
What I m missing ?

Re: What I m doing wrong with Webserver lib

Posted: Sat Jul 05, 2025 10:49 am
by Nathan_44
I m perhaps at wrong place ? ^^
But I don't see where to ask for help for a specific lib ?

Re: What I m doing wrong with Webserver lib

Posted: Mon Jul 07, 2025 2:05 am
by Sprite
I don't think anyone here is familiar with the lib... unless can debug the issue yourself, your best bet may be to file an issue on the libraries Github.