No custom option when using websocket ?
Description :
If I use websocket, /setup page options are not displayed ?
Context :
v1.0.4
ESP32-WROOM
Step to reproduce :
- Use "withWebSocket.ino" example without modification :
- Websocket "/" (root) page : works well displaying time every second.
- "/setup" page :
- did not display "My Options" tab in menu ???
- did not dispaly "ESP Mode", nor "IP address", nor "Firmware"
- "Loading" footer never ends...
Created config.json :
{
"param-box1": "My Options",
"LED Pin": 2,
"Option 1": "Test option String",
"Option 2": 1234567890
}
- Just comment "/" root page handler, and rebuild
// Add custom page handlers
// server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){
// request->send(200, "text/html", homepage);
// });
- Then "/" doesn't work (normal ;-) )
- "/setup" page works : "my option" tab is back...
Hi @GregAscolab.
Thanks for pointing out this insidious bug to me.
The problem is due to a double // in one of the response to a request made by the /setup page which is interpreted as the request inserted in the sketch / thus causing the page to malfunction.
I just committed the change (I also removed my test WiFi credentials that I use with on of my smartphones from the example :scream:)
hmmm same problem for me no display custom addoptions button on setup page when server on activated
arduino libraries say version 1.0.4 wich is the same as here i think
workaround for me now
if i look in the source a page index htm not html wil be served if present if on http://ipadres with or without / http://mdsnsadres.local wit or without /
/home/dld/Arduino/libraries/AsyncEspFsWebserver/src/AsyncFsWebServer.cpp line 61 62 onNotFound( std::bind(&AsyncFsWebServer::notFound, this, _1)); serveStatic("/", *m_filesystem, "/").setDefaultFile("index.htm");