-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Serve LittleFS files with ethernet W5500 and esp8266webserver (ERR_CONTENT_LENGTH_MISMATCH) #8855
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
Comments
Ok, I found the solution: on ESP8266WebServer.h => contentLength = file.sendAll(_currentClient,5000); one may consider this to be fixed for next releases ? |
Do you mean that 5000ms timeout in the server code fixed the problem?
Since neverExpires is implicitly added without argument, we end up with whatever set to the object on which we use sendAll() Arduino/cores/esp8266/Stream.h Lines 177 to 178 in d7cd4be
Arduino/cores/esp8266/StreamSend.cpp Lines 235 to 237 in d7cd4be
Arduino/cores/esp8266/Stream.h Line 69 in d7cd4be
Arduino/cores/esp8266/Stream.h Line 52 in d7cd4be
|
yes, I've put the delay in the sendall method called in the server |
Considering the "streamSend" API, timeout is currently the input stream's timeout. |
Great if you provide a fix, I'd be happy to retest my code with it and validate the use case |
If you are using the git version of this core, can you try with #8874 ? (or the unofficial "nightly" alpha release) |
I just had a look but I am using platformIO, not the Arduino IDE, do oyu know by chance the lines I should add in my platformio.ini file to add the platform in a new environement ? |
@infrafast Have you had success trying with #8874 ? |
|
perfect thanks for the link, I tried to setup my staging environment accordingly but I still don't know how I can point it to the right git address. I am not enought familiar with Git I am afraid I can't test |
since I don't know how to connect my platformIO to the git repo with this fix, could you rather send me the 4 files that you changd and I will update my local folder with them ? => [email protected] thx! |
Replace package URI platform_packages =
platformio/framework-arduinoespressif8266 @ git+https://github.com/d-a-v/Arduino.git#StreamSendToStream Or, use the existing Arduino repository that you have already cloned by following PIO documentation (path to the package may vary, see > pwd
/home/runner/.platformio/packages/framework-arduinoespressif8266@src-31d658a59f41540201fc3726a1394910
> git fetch https://github.com/d-a-v/Arduino.git StreamSendToStream
remote: Enumerating objects: 18, done.
remote: Counting objects: 100% (18/18), done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 18 (delta 7), reused 16 (delta 7), pack-reused 0
Unpacking objects: 100% (18/18), 20.04 KiB | 301.00 KiB/s, done.
From https://github.com/d-a-v/Arduino
* branch StreamSendToStream -> FETCH_HEAD
> git switch --detach --recurse-submodules --discard-changes FETCH_HEAD
HEAD is now at c8c30c7e move template function into header file
# ... test stuff ...
# ... back to master ...
> git switch --recurse-submodules --discard-changes master |
Basic Infos
Platform
Settings in IDE
Problem Description
Detailed problem description goes here.
I have a device that works both with WiFi and Ethernet using W5500 library and esp8266webserver.
Serving page works ok with WiFI but when using W5500 I have the similar problem as the one described in #2121
This happens randomly n some page, one time it can load, the other it will not and another page will fail.
I follow all threads about this issue both in github and other places and I made test with and without gziping the document, with and without merging my javascript files, with small (2/3k) and bigger file (30k).
I monitored the freeheap before and after pages are served and always have a reasonnable amount of memory available
The problem happens both when using "server.serveStatic" and "server.on"
I presume that the fix that was apply for the WiFi core has not been done for the W5500 part.
Hence I suspect the streamFile method template to be the cause.
I provide some extract of the code which are representative of the function calls (not the full one has it is too big).
MCVE Sketch
Debug Messages
The text was updated successfully, but these errors were encountered: