I have static, binary log files which I download via WiFi. Works well most of the time, but then there are perpetual crashes. It seems the success depends on the size of the files. Up to 64k mostly ok, 64k ... 128k ok for half the trials, beyond that size almost never ok.
I am using the LittleFS file system. The files are build up of 32 bytes binary records, and may eventually grow >2MB. I use this command for downloading as static file:
// file system definition: fs::LITTLEFSFS * myFS = &LITTLEFS;
server.serveStatic("/log.cam", *myFS, "/log.cam");
I also tried this. Works just as well, but no improvement:
server.on("/log.cam", HTTP_GET, [] (AsyncWebServerRequest *request) {request->send(*myFS, "/log.cam", application/octet-stream");});
The download is triggered from a website, either as a straight link to download the binary file, or as Javascript code inside a function:
Link: "<a href='/log.cam' >CAM</a>"
...
JS: const fetchdata = await fetch('/log.cam', {cache: "no-store"});
Your ReadMe seems to suggest that chunked responses are NOT needed for static files? So, I did not use that here. Am I forgetting any settings, or do I also need to use chunked response when the static file is beyond a certain size? Which size?