-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to serve big files from an SD Card? #939
Comments
See #770 |
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions. |
Did you managed to find a solution to serve big files from SD card without having the ESP32 crashing/restarting due to watchdog being triggered ? Thanks |
No, unfortunately not. Restructured my programm to not use this library since it crashed my programm when losing signal during transmission. I now use the standard WebServer.h, which works very well with FreeRTOS and is very stable. |
Wow ok, so if WiFi signal is lost during transmission, all the code goes to crash too ? ... What a pain :( |
It was in my case, best you try it yourself. Maybe it was a weird synergy between my RTOS Tasks. I use the wifi core for a few other tasks too. |
This works for me. The failure in the OP code is not sending a value for maxLen to read from the file. I use 2K and haven't tried anything bigger. size_t load_data(File f, uint8_t* buffer, size_t maxLen, size_t index) { In the webserver code: server.on("/readFile", HTTP_GET, [](AsyncWebServerRequest* request) { |
I'm currently trying to download ~20Mb Files from an ESP32 with an SD Card. I tried the following approach with the
ChunkedResponse
example:When using
f.read()
inload_data
it works but only extremly slow, i suspect, it transmits one char at a time?However, when I use
f.read(buffer, maxLen)
and start the download the WDT gets triggered.with
request->send(SD, requested_file, "text/csv");
the header (Filesize) gets transmitted correctly, but the WDT also triggers.What is the most elegant way to serve a bigger file from SD?
EDIT: Now using the workaround of a second Server instance (WebServer) on a diff. port. ESP32 handles just fine.
The text was updated successfully, but these errors were encountered: