-
Notifications
You must be signed in to change notification settings - Fork 354
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
Streaming using code built with PlatformIO fails rapidly with: Stream crash - ESP_ERR_HTTPD_RESP_SEND #218
Comments
Thankyou for the report; Each frame of the stream is returned in response to a request sent by the browser (that's how MJPEG streams work) It could be a esp bug that causes an invalid frame/chunk to be sent, but nothing showed up specifically on google; and I do not see this happening on my home cameras so I suspect it is something in the network causing regular packet loss. I'll keep an eye out for it though, again, thanks for the report. |
And... I'm seeing this now. Interesting. Think it is still something network, rather than code related. |
Question: Are you using PlatformIO? I can reproduce this when I commandline build using platformio; but when I build the same code using the ArduinoIDE the problem disappears. |
Same issue here when using PlatformIO. The stream frezzes (fails) after a few seconds. I tried with Arduino IDE but I couldn't make the stream run with Arduino IDE at all because of |
@Bulduper : With the IDE; double check the partition scheme you selected has SPIFFS and/or lower the x-clock rate. Also make sure you are using the HEAD revision RC1, not one of the older betas (which are more susceptible to this). This is discussed further in the discussion threads. |
I have spent some time testing this: I see no obvious fix and I am not willing to spend more time on it; platformio is a nice-to-have, and not the focus of this work Working; Arduino IDE with ESP core 2.0.2:
Failing: Platformio (current config)
I note that the Platformio build with (nominally) the same SDK is 16k or so bigger in size. so the two builds are not equivalent despite the SDK giving the same version. I tried a number of ways of configuring the https://github.com/search?q=ESP_ERR_HTTPD_RESP_SEND&type=issues shows that this is a pretty unique error. As noted above; I will not close this; but I do not have any more time to work on it. |
Hi! Sorry for not answering before. I can confirm I was using PlatformIO to build and flash the code on ESP32-CAM and it wouldn't work. @Bulduper, I had the same issue too. You could simply disable custom config options by uncommenting @easytarget thank you for taking the time to investigate, as for now using ArduinoIDE is not an issue for me, so I guess we will just wait for PIO to fix their issues |
Thank you @TheWolf95 ! Indeed your solution for IDE worked. |
Hello! I have a working version built with platformio (v4.0 release).
This program is up and running for several hours now and no problems. |
Thank you @mitsubishievo99 - I can confirm that making those changes worked for me, and that building with PlatformIO now results in a working program. |
Thank you @mitsubishievo99 - I can ALSO confirm that making those changes worked for me, and that building with PlatformIO now results in a working program. |
@mitsubishievo99 @TheHoodedFoot @marspd What you are doing is relying on the fact that the PlatformIO |
The latest git version of framework-arduinoespressif32 (appears to be a RC of 2.0.3) has mysteriously fixed this issue for me.
|
Curious; thankyou for the update @llamaonaskateboard , I will re-test when I can, it would be nice if this has been a transient issue. |
Ok, so with the latest Arduino core (2.0.3) specified the problem is resolved.
Thank you again to all the folks who contributed and assisted with this. |
This will fix the described error above. issue: "easytarget#218"
Hello!
I'm having issues having a reliable stream, since in short times (random, but between 2 to 30 seconds) the stream crashes, ending itself due to
ESP_ERR_HTTPD_RESP_SEND
. Which, looking to the ESP-IDF wiki, is due to sending an invalid chunk packet, confirmed by Chrome JS console returningERR_INVALID_CHUNK_ENCODING 200 (OK)
.I've been searching around for a solution, but I couldn't make it far. I also tried forcing ESP ignore the invalid packet error changing
res
intoESP_OK
, but I guess once it happens Chrome just closes that stream connection, returning the error from the first if too.I do not know if this is of any help, but it happens always on the third if in the stream handler method.
Thank you for your amazing work so far and in advance for your assistance!
The text was updated successfully, but these errors were encountered: