earlephilhower / ESP8266Audio

Arduino library to play MOD, WAV, FLAC, MIDI, RTTTL, MP3, and AAC files on I2S DACs or with a software emulated delta-sigma DAC on the ESP8266 and ESP32
GNU General Public License v3.0
2.07k stars 439 forks source link

ESP32 Webradio #165

Open danbicks opened 5 years ago

danbicks commented 5 years ago

Hi,

I have tried the example Webradio example on the ESP32, all compiles and builds when the unit restarts I access the url through chrome browser, serial monitor shows sending HTML so request has been made but shows not responding web page?

Has anyone had a similar issue?

Cheers

Dans

2ni commented 5 years ago

Yup, have similar issue. Webserver returns ERR_EMPTY_RESPONSE. Seems that HandleIndex is not working properly? When calling /index.html, my console output is (I did output the url to debug):

Running for 6 seconds ...Free mem=176208
[E][WiFiClient.cpp:436] flush(): 11
url: index.html
Sending INDEX...Free mem=175504
Sent INDEX...Free mem=175432
Running for 12 seconds ...Free mem=174876

The response I get from the server:

http: error: ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) while doing GET request to URL: http://192.168.1.6/index.html

PS: Adding content-length as suggested didn't help either.

danbicks commented 5 years ago

Hi 2ni,

Same for me, I can't believe 29 days later no one has replied to my first post!

Seems like this development may be dead...

Let me know if you have some success, that would be cool.

Cheers

Dans

waipeinan commented 5 years ago

I seem to have this issue too..... are we really the only ones?

PLdeSousa commented 5 years ago

I have the same problem.

DerMega commented 5 years ago

Same here. Ist there a solution meanwhile?

jgrulich commented 5 years ago

I've the same issue till now. The only core where works the web is ver. 0.0.1 dated to 2018-07-04. But you need to use the old version on the ESP8266Audio as well, otherwise it results in a lot of compilation errors. I've tested all ESP32 stable cores with the latest ESP8266Audio. The 1.0.0 has compilation error, the rest compiles, but only 1.0.1 and 1.0.2 are working with audio. The 1.0.2 has best memory handling now. There may be up to 110kB of buffer. As the html requests are handled correctly, the config may be done with sending of direct html commands. But I've not bring this web.h server to send any response. As it works with the ESP82 core, there need to be something with the wrong lib interpretation.

Cocksparrow commented 4 years ago

Thanks jgrulich! Same here. I've rolled back to 1.0.2 and the audio works. 1.0.0 doesn't compile and 1.0.1 compiles but then doesn't stream audio. I thought I had lost my mind but you reminded me I updated the boards about the same time as everything stopped working. Any advice anyone has on an alternative example with a working web interface would be gratefully received.

Derek-K commented 3 years ago

Update here... Just tried 1.7.0.

TL;DR Web interface still doesn't work with ESP32, but it is OK on ESP8266

So far I have spent over an hour trying to debug the code under ESP32 without luck, But the same code (web.cpp) works just fine on ESP8266.

In particular, I suspect it has something to do with the WebPrintf inWebHeaders(). I even added client->flush(); at the end, still, nothing was sent. Also interestingly WebError() is almost the same and works under ESP32.


Update: The problem seems to be fixed by removing client.flush() in web.cpp

ITguy-Lukas commented 2 years ago

Recently I ran over this problem - and pinpointed it to the WebReadRequest call before the if/then/else statement for client request. As stated elsewhere client.flush() is to be used to erase all pending data in the reception buffer. So I replaced call to client->flush() by while (client->available()) { client->read(); }

szybkijanek commented 1 year ago

Just comment line 181 in web.cpp //client->flush(); This works for me.

pentode1 commented 9 months ago

Edit: no idea why the code blocks aren't formatting properly and I'm too tired to figure that out right now.

After commenting out that line, the web server works but anytime I enter a stream link, the device loops, apparently for different reasons depending on the stream type. Here's what I get:

Changing URL to: http://stream.radioparadise.com/mellow-128, vol=100 Before stop...Free mem=111256 After stop...Free mem=111460 Saved settings created icystream created buffer created decoder Decoder start... +0 0x3ffcabc0 Done start new URL MP3:ERROR_BUFLEN 0

or

Changing URL to: http://stream.srg-ssr.ch/rsj/mp3_128.m3u, vol=100 Before stop...Free mem=111868 After stop...Free mem=111868 Saved settings created icystream created buffer created decoder Decoder start... MP3 source file not open Can't connect to URLDone start new URL Changing URL to: http://stream.srg-ssr.ch/rsj/mp3_128.m3u, vol=100 Before stop...Free mem=111868 After stop...Free mem=111868 Saved settings created icystream created buffer created decoder Decoder start... MP3 source file not open

Anyone know what's going on here? As others have noted this code works just fine on the 8266, so is this a library problem or am I doing something else wrong? Since others seem to have made this work, I'm thinking maybe something changed in the last year?