-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Is there a bug in HTTPClient.cpp disconnect()? #3715
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
Although I am not sure, I think it is because ::disconnect() waits until the read buffer is empty, but the radio channel keeps on streaming new data into it. Just a wild guess, but maybe you could delete file in stead of file->close(), and of course new it afterwards |
I think I already went that way. I have several iterations on my desktop and (will have to check) I had the same problem with delete\new. |
I'm having almost the exactly same bug with HTTPClient. Only mine occurs with a known-length file download: it connects and starts downloading instantly, no issues. If I abort the download, it quits instantly. However, when I try to download the file a second time, HTTPClient locks up on "GET" for 10-15 seconds (100% of the time). But after it times out and fails (I can provide error codes if they are of interest), I can "GET" again, and it goes right through with no hesitation. Like this:
|
Possibly related: #3722 |
I am now pretty sure the bug is in the ESP8266audio library. |
Hardware:
Board: M5Stack Grey
Core Installation version: 1.0.4 & 1.03
IDE name: Arduino IDE
Flash Frequency: 80Mhz
PSRAM enabled: no
Upload Speed: 115200
Computer OS: Ubuntu
Description:
I am trying to make a barebone webradio with a M5stack board. I am using code from https://github.com/earlephilhower/ESP8266Audio as a starting point.
My repo can be found at https://github.com/CelliesProjects/ESP32_radio
I can start playing a MP3 just fine. The problem is that on changing stations the boards pauses up to 10-15 seconds (but not always).
The pause seems to be caused by HTTPClient disconnect().
Posted below is a debug log showing the output.
I run into this with every existing ESP32 web radio repo I try to use a a base.
So in short: Booting and starting a stream is instantaneous, but changing the stream makes the board stall for up to 15 seconds.
The stall happens at
in the logs.
Anybody willing to try the sketch and confirm this?
Sketch:
Debug Messages:
The text was updated successfully, but these errors were encountered: