Using a webpage to display error messages

I have built a headless unit using an ESP8266 to host a little webpage to control connected devices using the ESPAAsync Web Server, which works great and I have activated OTA updates which means I don't need to pull things apart to upload a new image. So I was wondering, how hard would it be to have a simple read-only webpage, hosted on the same webserver 192.168.1.1/error, which displayed debug info from printf type statements?

This thing runs at home and is out of range of anyone not inside my house so I am not tooworried about people trying to abuse it, but it would make debugging without dismantling possible.

Any ideas on how it could be done? I was thinking about some kind of buffer which then gets pulled into the webpage but my expertise isn't good enough to know if that is viable?

may be you could print to a SPIFF / LittleFS file and when someone asks for 192.168.1.1/error, serve that file's content

GitHub - me-no-dev/ESPAsyncWebServer: Async Web Server for ESP8266 and ESP32 would make developing the server side pretty straightforward

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.