Edzelf / ESP32-Radio

Internet radio based on ESP32, VS1053 and a TFT screen.
GNU General Public License v3.0
964 stars 227 forks source link

SD card is read, file count correct but no way to play them #505

Open Fabri54 opened 2 years ago

Fabri54 commented 2 years ago

After a few days scratching my head I had t ask for help. I've successfully assembled the Internet radio, with a red TFT display (+SD card). Compilation is fine as well as download to the ESP32 and I can enjoy the music of internet radios. However what doesn't work is the SD card. The card is seen at start-up, the number of track is correct but there is no way to have them played from web interface. If I go to MP3 Player on the web page the re are no tracks to play. When I chose RANDOM the system crashes and reboots

Any help would be greatly appreciated. Thank you!

Here is the initial diagnostic at boot.

20:56:19.420 -> mode:DIO, clock div:1 20:56:19.457 -> load:0x3fff0018,len:4 20:56:19.457 -> load:0x3fff001c,len:1216 20:56:19.457 -> ho 0 tail 12 room 4 20:56:19.457 -> load:0x40078000,len:10944 20:56:19.457 -> load:0x40080400,len:6388 20:56:19.457 -> entry 0x400806b4 20:56:19.753 -> 20:56:19.753 -> D: Starting ESP32-radio running on CPU 1 at 240 MHz. Version Mon, 28 Jun 2021 12:40:00 GMT. Free memory 301700 20:56:19.787 -> D: Display type is BLUETFT 20:56:19.787 -> D: Partition nvs found, 20480 bytes 20:56:19.787 -> D: Read 43 keys from NVS 20:56:19.787 -> D: pin_ir set to 35 20:56:19.787 -> D: pin_enc_clk set to 25 20:56:19.787 -> D: pin_enc_dt set to 26 20:56:19.787 -> D: pin_enc_sw set to 27 20:56:19.787 -> D: pin_tft_cs set to 15 20:56:19.787 -> D: pin_tft_dc set to 2 20:56:19.787 -> D: pin_tft_scl set to -1 20:56:19.787 -> D: pin_tft_sda set to -1 20:56:19.787 -> D: pin_tft_bl set to -1 20:56:19.787 -> D: pin_tft_blx set to -1 20:56:19.787 -> D: Pin 15 is already reserved! 20:56:19.825 -> D: pin_sd_cs set to 15 20:56:19.825 -> D: pin_ch376_cs set to -1 20:56:19.825 -> D: pin_ch376_int set to -1 20:56:19.825 -> D: pin_vs_cs set to 5 20:56:19.825 -> D: pin_vs_dcs set to 16 20:56:19.825 -> D: pin_vs_dreq set to 4 20:56:19.825 -> D: pin_shutdown set to -1 20:56:19.825 -> D: pin_shutdownx set to -1 20:56:19.825 -> D: pin_spi_sck set to 18 20:56:19.825 -> D: pin_spi_miso set to 19 20:56:19.825 -> D: pin_spi_mosi set to 23 20:56:19.825 -> D: GPIO0 is HIGH 20:56:19.825 -> D: GPIO2 is HIGH 20:56:19.862 -> D: GPIO4 is HIGH 20:56:19.862 -> D: GPIO5 is HIGH 20:56:19.862 -> D: GPIO12 is HIGH 20:56:19.862 -> D: GPIO13 is HIGH 20:56:19.899 -> D: GPIO14 is HIGH 20:56:19.899 -> D: GPIO15 is HIGH 20:56:19.899 -> D: GPIO16 is HIGH 20:56:19.937 -> D: GPIO17 is HIGH 20:56:19.937 -> D: GPIO18 is HIGH 20:56:19.937 -> D: GPIO19 is HIGH 20:56:19.937 -> D: GPIO21 is HIGH 20:56:19.974 -> D: GPIO22 is HIGH 20:56:19.974 -> D: GPIO23 is HIGH 20:56:19.974 -> D: GPIO25 is LOW, probably no PULL-UP 20:56:19.974 -> D: GPIO26 is LOW, probably no PULL-UP 20:56:20.009 -> D: GPIO27 is HIGH 20:56:20.009 -> D: GPIO32 is HIGH 20:56:20.009 -> D: GPIO33 is HIGH 20:56:20.047 -> D: GPIO34 is LOW, probably no PULL-UP 20:56:20.047 -> D: GPIO35 is HIGH 20:56:20.047 -> D: GPIO39 is LOW, probably no PULL-UP 20:56:20.047 -> D: gpio_00 will execute uppreset = 1 20:56:20.047 -> D: gpio_12 will execute upvolume = 2 20:56:20.047 -> D: gpio_13 will execute downvolume = 2 20:56:20.047 -> D: Enable pin 35 for IR 20:56:20.084 -> D: Start display 20:56:21.337 -> D: Locate mp3 files on SD, may take a while... 20:56:21.337 -> D: SD directory is / 20:56:21.337 -> D: SD directory is /System Volume Information 20:56:21.560 -> D: 10 tracks on SD 20:56:21.560 -> D: Create list with acceptable WiFi networks 20:56:21.560 -> D: Added My-Network-1 to list of networks 20:56:21.560 -> D: Added My-Network-2 to list of networks 20:56:21.560 -> D: End adding networks 20:56:22.684 -> D: Scan Networks 20:56:24.592 -> D: Scan completed 20:56:24.592 -> D: Number of available networks: 13 20:56:24.592 -> D: 1 - Vodafone-xxxxxxx Signal: -44 dBm, Encryption WPA2_PSK, Acceptable 20:56:24.592 -> D: 2 - FASTWEB-xxxxxx Signal: -78 dBm, Encryption WPA_WPA2_PSK, 20:56:24.630 -> D: 3 - FASTWEB-xxxxxxx Signal: -86 dBm, Encryption WPA_WPA2_PSK, 20:56:24.630 -> D: 4 - Vodafone-xxxxx Signal: -87 dBm, Encryption WPA2_PSK, 20:56:24.630 -> D: 5 - DIRECT-71-HP ENVY 5540 series Signal: -87 dBm, Encryption WPA2_PSK, 20:56:24.630 -> D: 6 - WOW FI - FASTWEB Signal: -87 dBm, Encryption ????, 20:56:24.630 -> D: 7 - WOW FI - FASTWEB Signal: -91 dBm, Encryption ????, 20:56:24.630 -> D: 8 - XX-GGG-BBBB Signal: -91 dBm, Encryption WPA2_PSK, 20:56:24.665 -> D: 9 - Vodafone-xxxxxxx Signal: -91 dBm, Encryption WPA2_PSK, 20:56:24.665 -> D: 10 - Vodafone-xxxxxxx Signal: -91 dBm, Encryption OPEN, 20:56:24.665 -> D: 11 - NETGEAR_EXT Signal: -92 dBm, Encryption OPEN, 20:56:24.665 -> D: 12 - Mesh_B10 Signal: -93 dBm, Encryption WPA2_PSK, 20:56:24.665 -> D: 13 - Mesh_B10 Signal: -95 dBm, Encryption WPA2_PSK, 20:56:24.665 -> D: End of list 20:56:24.701 -> D: Command: clk_dst with parameter 1 20:56:24.701 -> D: Command: clk_offset with parameter 1 20:56:24.701 -> D: Command: clk_server with parameter pool.ntp.org 20:56:24.701 -> D: Command: gpio_00 with parameter uppreset = 1 20:56:24.701 -> D: Command: gpio_12 with parameter upvolume = 2 20:56:24.701 -> D: Command: gpio_13 with parameter downvolume = 2 20:56:24.701 -> D: Command: ir_692d with parameter upvolume = 2 20:56:24.701 -> D: Command: ir_a857 with parameter downvolume = 2 20:56:24.701 -> D: Command: mqttbroker with parameter none 20:56:24.739 -> D: Command: mqttpasswd with parameter *** 20:56:24.739 -> D: Command: mqttport with parameter 1883 20:56:24.739 -> D: Command: mqttprefix with parameter none 20:56:24.739 -> D: Command: mqttuser with parameter none 20:56:24.739 -> D: Command: pin_enc_clk with parameter 25 20:56:24.739 -> D: Command: pin_enc_dt with parameter 26 20:56:24.739 -> D: Command: pin_enc_sw with parameter 27 20:56:24.739 -> D: Command: pin_ir with parameter 35 20:56:24.739 -> D: Command: pin_sd_cs with parameter 15 20:56:24.739 -> D: Command: pin_tft_cs with parameter 15 20:56:24.777 -> D: Command: pin_tft_dc with parameter 2 20:56:24.777 -> D: Command: pin_vs_cs with parameter 5 20:56:24.777 -> D: Command: pin_vs_dcs with parameter 16 20:56:24.777 -> D: Command: pin_vs_dreq with parameter 4 20:56:24.777 -> D: Command: preset with parameter 6 20:56:24.777 -> D: Command: preset_00 with parameter 109.206.96.34:8100 20:56:24.777 -> D: Command: preset_01 with parameter airspectrum.cdnstream1.com:8114/1648_128 20:56:24.777 -> D: Command: preset_02 with parameter us2.internet-radio.com:8050 20:56:24.777 -> D: Command: preset_03 with parameter airspectrum.cdnstream1.com:8000/1261_192 20:56:24.814 -> D: Command: preset_04 with parameter airspectrum.cdnstream1.com:8008/1604_128 20:56:24.814 -> D: Command: preset_05 with parameter us1.internet-radio.com:8105 20:56:24.814 -> D: Command: preset_06 with parameter icecast.omroep.nl:80/radio1-bb-mp3 20:56:24.814 -> D: Command: preset_07 with parameter 205.164.62.15:10032 20:56:24.814 -> D: Command: preset_08 with parameter skonto.ls.lv:8002/mp3 20:56:24.814 -> D: Command: preset_09 with parameter 94.23.66.155:8106 20:56:24.858 -> D: Command: preset_10 with parameter ihr/IHR_IEDM 20:56:24.858 -> D: Command: preset_11 with parameter ihr/IHR_TRAN 20:56:24.858 -> D: Command: toneha with parameter 0 20:56:24.858 -> D: Command: tonehf with parameter 0 20:56:24.858 -> D: Command: tonela with parameter 0 20:56:24.858 -> D: Command: tonelf with parameter 0 20:56:24.858 -> D: Command: volume with parameter 50 20:56:24.954 -> D: Slow SPI, Testing VS1053 read/write registers... 20:56:25.214 -> D: Fast SPI, Testing VS1053 read/write registers again... 20:56:26.385 -> D: endFillByte is 0 20:56:26.490 -> D: Connect to WiFi 20:56:41.127 -> D: Connected to Vodafone-34350430-2p4 20:56:41.127 -> D: IP = 192.168.1.49 20:56:44.124 -> D: Start server for commands 20:56:44.124 -> D: Network found. Starting mqtt and OTA 20:56:44.124 -> D: MDNS responder started 20:56:45.149 -> D: Rotary encoder is enabled 20:56:45.149 -> D: Sync TOD 20:56:45.299 -> D: Sync TOD, new value is 20:56:45 20:56:45.299 -> D: STOP requested 20:56:45.299 -> D: New preset/file requested (6/0) from icecast.omroep.nl:80/radio1-bb-mp3 20:56:45.299 -> D: New station request 20:56:45.299 -> D: Connect to new host icecast.omroep.nl:80/radio1-bb-mp3 20:56:45.336 -> D: Connect to icecast.omroep.nl on port 80, extension /radio1-bb-mp3 20:56:45.336 -> D: Song stopped correctly after 0 msec 20:56:46.174 -> D: Connected to server 20:56:47.157 -> D: Switch to HEADER 20:56:47.157 -> D: Headerline: Content-Type: audio/mpeg 20:56:47.194 -> D: audio/mpeg seen. 20:56:47.194 -> D: Headerline: icy-br:192 20:56:47.194 -> D: Headerline: ice-audio-info: samplerate=48000;channels=2;bitrate=192 20:56:47.194 -> D: Headerline: icy-br:192 20:56:47.194 -> D: Headerline: icy-genre:Talk 20:56:47.194 -> D: Headerline: icy-metadata:1 20:56:47.194 -> D: Headerline: icy-name:NPO Radio1 20:56:47.194 -> D: Headerline: icy-pub:0 20:56:47.194 -> D: Headerline: icy-url:http://www.radio1.nl 20:56:47.194 -> D: Headerline: Server: Icecast 2.4.0-kh15 20:56:47.194 -> D: Headerline: Cache-Control: no-cache, no-store 20:56:47.231 -> D: Headerline: Expires: Mon, 26 Jul 1997 05:00:00 GMT 20:56:47.231 -> D: Headerline: Connection: Close 20:56:47.231 -> D: Headerline: Access-Control-Allow-Origin: * 20:56:47.231 -> D: Headerline: Access-Control-Allow-Headers: Origin, Accept, X-Requested-With, Content-Type, Icy-MetaData 20:56:47.231 -> D: l-Allow-Headers: Origin, Accept, X-Requested-With, Content-Type, Icy-MetaData seen. 20:56:47.231 -> D: Headerline: Access-Control-Allow-Methods: GET, OPTIONS, SOURCE, PUT, HEAD, STATS 20:56:47.264 -> D: Headerline: icy-metaint:16000 20:56:47.264 -> D: Switch to DATA, bitrate is 192, metaint is 16000 20:56:47.264 -> D: Duration mp3loop 80 20:56:47.264 -> D: Metadata block 64 bytes 20:56:47.301 -> D: Streamtitle found, 52 bytes 20:56:47.301 -> D: StreamTitle='NPO Radio 1 - NOS Langs de Lijn - NOS'; 20:56:53.075 -> D: Command client available 20:56:53.075 -> D: handlehttp started 20:56:53.075 -> D: Get command is: status 20:56:53.075 -> D: Send reply for status 20:56:53.075 -> D: Command: status with parameter 0 20:56:54.202 -> D: Command client available 20:56:54.202 -> D: handlehttp started 20:56:54.202 -> D: Filename is: index.html 20:56:54.202 -> D: Start file reply for index.html 20:56:54.239 -> D: FileRequest received index.html 20:56:54.239 -> D: Length of page is 8474 20:56:54.239 -> D: Response send

Edzelf commented 2 years ago

You may try version 2.

Fabri54 commented 2 years ago

I believe I'm using it. The files I downloaded in .zip format are dated February 2022 even if main.cpp quotes "Mon, 28 Jun 2021 12:40:00 GMT"

Edzelf commented 2 years ago

V2 is at https://github.com/Edzelf/ESP32Radio-V2.

Fabri54 commented 2 years ago

Thank you ,but the V2 seems not to support the SD nor the USB. It's not a critical feature but, as I'm planning to assemble a final version in a wooden enclosure I was planning to have a slot for SD. or an USB plug. Well, in any case it's a great project. Thank you again

Edzelf commented 2 years ago

The choice is yours, but the V2 version does support SD, although the number of tracks is limited.

Fabri54 commented 2 years ago

Ah... I read the introductory page and stopped there after reading "SD cards and USB not supported yet". I think I'll give a try after having polished the V1 implementation for "production"....(my wife like this Internet Radio) The amount of coding and its elegance are impressive even for a beginner like me.

synack-dev commented 1 year ago

Looks like you can play the song by prepending localhost/ to the filename.mp3 I'll take a look why the drop down is empty and why the "random" button misses the /