Edzelf / ESP32-Radio

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

VS1053 does not work - no sound #242

Closed jroggenbuck closed 5 years ago

jroggenbuck commented 5 years ago

My ESP32 (MCU 30 pin) will not connect with VS1053 with SD Card. Both hardware parts did work in other projects. see config page, debug page and wiring attached.


config

clk_dst = 1 clk_offset = 1 clk_server = pool.ntp.org # gpio_00 = uppreset = 1 gpio_12 = upvolume = 2 gpio_13 = downvolume = 2 # ir_40BF = upvolume = 2 ir_C03F = downvolume = 2 # mqttbroker = none mqttpasswd = mqttport = 1883 mqttprefix = none mqttuser = none # pin_enc_clk = 25 # GPIO Pin number for rotary encoder CLK pin_enc_dt = 26 # GPIO Pin number for rotary encoder DT pin_enc_sw = 27 # GPIO Pin number for rotary encoder SW pin_ir = 35 # GPIO Pin number for IR receiver VS1838B pin_sd_cs = 15 # GPIO Pin number for SD card CS pin_spi_miso = 19 # GPIO Pin number for SPI Miso pin_spi_mosi = 23 # GPIO Pin number for SPI Mosi pin_spi_sck = 18 # GPIO Pin number for SPI Clock pin_tft_scl = 22 # GPIO Pin number for TFT CS pin_tft_sda = 21 # GPIO Pin number for TFT DC pin_vs_cs = 5 # GPIO Pin number for VS1053 CS pin_vs_dcs = 16 # GPIO Pin number for VS1053 DCS pin_vs_dreq = 4 # GPIO Pin number for VS1053 DREQ # preset = 6 preset_00 = mp3channels.webradio.antenne.de/antenne # 0 - Bayern Antenne preset_01 = airspectrum.cdnstream1.com:8114/1648_128 # 1 - Easy Hits Florida 128k preset_02 = us2.internet-radio.com:8050 # 2 - CLASSIC ROCK MIA WWW.SHERADIO.COM preset_03 = airspectrum.cdnstream1.com:8000/1261_192 # 3 - Magic Oldies Florida preset_04 = airspectrum.cdnstream1.com:8008/1604_128 # 4 - Magic 60s Florida 60s Classic Rock preset_05 = us1.internet-radio.com:8105 # 5 - Classic Rock Florida - SHE Radio preset_06 = icecast.omroep.nl:80/radio1-bb-mp3 # 6 - Radio 1, NL preset_07 = 205.164.62.15:10032 # 7 - 1.FM - GAIA, 64k preset_08 = skonto.ls.lv:8002/mp3 # 8 - Skonto 128k preset_09 = 94.23.66.155:8106 # 9 - ILR CHILL and GROOVE preset_10 = ihr/IHR_IEDM # 10 - iHeartRadio IHR_IEDM preset_11 = ihr/IHR_TRAN # 11 - iHeartRadio IHR_TRAN # toneha = 0 tonehf = 0 tonela = 0 tonelf = 0 # volume = 84 # wifi_00 = WLAN-/ wifi_01 = SSID2/


Debug

11:26:11.101 -> ets Jun 8 2016 00:22:57 11:26:11.101 -> 11:26:11.101 -> rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) 11:26:11.101 -> configsip: 0, SPIWP:0xee 11:26:11.101 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 11:26:11.101 -> mode:DIO, clock div:1 11:26:11.101 -> load:0x3fff0018,len:4 11:26:11.101 -> load:0x3fff001c,len:1100 11:26:11.101 -> load:0x40078000,len:10088 11:26:11.101 -> load:0x40080400,len:6380 11:26:11.101 -> entry 0x400806a4 11:26:11.429 -> 11:26:11.429 -> D: Starting ESP32-radio running on CPU 1 at 240 MHz. Version Tue, 05 Jan 2019 19:48:00 GMT. Free memory 283772 11:26:11.476 -> D: Display type is OLED 11:26:11.476 -> D: Partition nvs found, 20480 bytes 11:26:11.476 -> D: Read 46 keys from NVS 11:26:11.476 -> D: pin_ir set to 35 11:26:11.476 -> D: pin_enc_clk set to 25 11:26:11.476 -> D: pin_enc_dt set to 26 11:26:11.476 -> D: pin_enc_sw set to 27 11:26:11.476 -> D: pin_tft_cs set to -1 11:26:11.476 -> D: pin_tft_dc set to -1 11:26:11.476 -> D: pin_tft_scl set to 22 11:26:11.476 -> D: pin_tft_sda set to 21 11:26:11.476 -> D: pin_tft_bl set to -1 11:26:11.476 -> D: pin_tft_blx set to -1 11:26:11.476 -> D: pin_sd_cs set to 15 11:26:11.476 -> D: pin_vs_cs set to 5 11:26:11.476 -> D: pin_vs_dcs set to 16 11:26:11.476 -> D: pin_vs_dreq set to 4 11:26:11.476 -> D: pin_shutdown set to -1 11:26:11.476 -> D: pin_shutdownx set to -1 11:26:11.476 -> D: pin_spi_sck set to 18 11:26:11.476 -> D: pin_spi_miso set to 19 11:26:11.523 -> D: pin_spi_mosi set to 23 11:26:11.523 -> D: GPIO0 is HIGH 11:26:11.523 -> D: GPIO2 is LOW, probably no PULL-UP 11:26:11.523 -> D: GPIO4 is HIGH 11:26:11.523 -> D: GPIO5 is HIGH 11:26:11.523 -> D: GPIO12 is HIGH 11:26:11.569 -> D: GPIO13 is HIGH 11:26:11.569 -> D: GPIO14 is HIGH 11:26:11.569 -> D: GPIO15 is HIGH 11:26:11.569 -> D: GPIO16 is HIGH 11:26:11.569 -> D: GPIO17 is HIGH 11:26:11.616 -> D: GPIO18 is HIGH 11:26:11.616 -> D: GPIO19 is HIGH 11:26:11.616 -> D: GPIO21 is HIGH 11:26:11.616 -> D: GPIO22 is HIGH 11:26:11.663 -> D: GPIO23 is HIGH 11:26:11.663 -> D: GPIO25 is HIGH 11:26:11.663 -> D: GPIO26 is HIGH 11:26:11.663 -> D: GPIO27 is HIGH 11:26:11.663 -> D: GPIO32 is HIGH 11:26:11.710 -> D: GPIO33 is HIGH 11:26:11.710 -> D: GPIO34 is LOW, probably no PULL-UP 11:26:11.710 -> D: GPIO35 is HIGH 11:26:11.710 -> D: GPIO39 is LOW, probably no PULL-UP 11:26:11.710 -> D: gpio_00 will execute uppreset = 1 11:26:11.710 -> D: gpio_12 will execute upvolume = 2 11:26:11.710 -> D: gpio_13 will execute downvolume = 2 11:26:11.757 -> D: Enable pin 35 for IR 11:26:11.757 -> D: Start display 11:26:11.757 -> D: Init SSD1306, I2C pins 21,22 11:26:12.038 -> D: SD Card Mount Failed! 11:26:12.038 -> D: Create list with acceptable WiFi networks 11:26:12.038 -> D: Added WLAN-** to list of networks 11:26:12.038 -> D: Added SSID2 to list of networks 11:26:12.038 -> D: End adding networks 11:26:12.226 -> D: Scan Networks 11:26:15.038 -> D: Scan completed 11:26:15.038 -> D: Number of available networks: 13 11:26:15.038 -> D: 1 - WLAN-*** Signal: -69 dBm, Encryption WPA2_PSK, Acceptable

delete

11:26:15.085 -> D: 13 - KabelBox-F780 Signal: -94 dBm, Encryption WPA2_PSK, 11:26:15.085 -> D: End of list 11:26:15.085 -> D: Command: clk_dst with parameter 1 11:26:15.132 -> D: Command: clk_offset with parameter 1 11:26:15.132 -> D: Command: clk_server with parameter pool.ntp.org 11:26:15.132 -> D: Command: gpio_00 with parameter uppreset = 1 11:26:15.132 -> D: Command: gpio_12 with parameter upvolume = 2 11:26:15.132 -> D: Command: gpio_13 with parameter downvolume = 2 11:26:15.132 -> D: Command: ir_40bf with parameter upvolume = 2 11:26:15.132 -> D: Command: ir_c03f with parameter downvolume = 2 11:26:15.132 -> D: Command: mqttbroker with parameter none 11:26:15.132 -> D: Command: mqttpasswd with parameter *** 11:26:15.132 -> D: Command: mqttport with parameter 1883 11:26:15.132 -> D: Command: mqttprefix with parameter none 11:26:15.179 -> D: Command: mqttuser with parameter none 11:26:15.179 -> D: Command: pin_enc_clk with parameter 25 11:26:15.179 -> D: Command: pin_enc_dt with parameter 26 11:26:15.179 -> D: Command: pin_enc_sw with parameter 27 11:26:15.179 -> D: Command: pin_ir with parameter 35 11:26:15.179 -> D: Command: pin_sd_cs with parameter 15 11:26:15.179 -> D: Command: pin_spi_miso with parameter 19 11:26:15.179 -> D: Command: pin_spi_mosi with parameter 23 11:26:15.179 -> D: Command: pin_spi_sck with parameter 18 11:26:15.179 -> D: Command: pin_tft_scl with parameter 22 11:26:15.179 -> D: Command: pin_tft_sda with parameter 21 11:26:15.179 -> D: Command: pin_vs_cs with parameter 5 11:26:15.179 -> D: Command: pin_vs_dcs with parameter 16 11:26:15.226 -> D: Command: pin_vs_dreq with parameter 4 11:26:15.226 -> D: Command: preset with parameter 6 11:26:15.226 -> D: Command: preset_00 with parameter mp3channels.webradio.antenne.de/antenne 11:26:15.226 -> D: Command: preset_01 with parameter airspectrum.cdnstream1.com:8114/1648_128 11:26:15.226 -> D: Command: preset_02 with parameter us2.internet-radio.com:8050 11:26:15.226 -> D: Command: preset_03 with parameter airspectrum.cdnstream1.com:8000/1261_192 11:26:15.226 -> D: Command: preset_04 with parameter airspectrum.cdnstream1.com:8008/1604_128 11:26:15.226 -> D: Command: preset_05 with parameter us1.internet-radio.com:8105 11:26:15.226 -> D: Command: preset_06 with parameter icecast.omroep.nl:80/radio1-bb-mp3 11:26:15.272 -> D: Command: preset_07 with parameter 205.164.62.15:10032 11:26:15.272 -> D: Command: preset_08 with parameter skonto.ls.lv:8002/mp3 11:26:15.272 -> D: Command: preset_09 with parameter 94.23.66.155:8106 11:26:15.272 -> D: Command: preset_10 with parameter ihr/IHR_IEDM 11:26:15.272 -> D: Command: preset_11 with parameter ihr/IHR_TRAN 11:26:15.272 -> D: Command: toneha with parameter 0 11:26:15.272 -> D: Command: tonehf with parameter 0 11:26:15.272 -> D: Command: tonela with parameter 0 11:26:15.272 -> D: Command: tonelf with parameter 0 11:26:15.272 -> D: Command: volume with parameter 84 11:26:15.413 -> D: Slow SPI, Testing VS1053 read/write registers... 11:26:15.413 -> D: VS1053 SPI error. SB:0000 R1:FFFF R2:FFFF

delete

11:26:15.601 -> D: VS1053 SPI error. SB:1644 R1:FFFF R2:FFFF 11:26:15.601 -> D: Connect to WiFi 11:26:20.007 -> D: Connected to WLAN-** 11:26:20.007 -> D: IP = 192.168.X.X 11:26:23.007 -> D: Start server for commands 11:26:23.007 -> D: Network found. Starting mqtt and OTA 11:26:23.007 -> D: MDNS responder started 11:26:23.991 -> D: Rotary encoder is enabled 11:26:23.991 -> D: Sync TOD 11:26:24.319 -> D: Sync TOD, new value is 11:26:24 11:26:24.319 -> D: STOP requested 11:26:24.319 -> D: New preset/file requested (6/0) from icecast.omroep.nl:80/radio1-bb-mp3 11:26:24.319 -> D: Connect to new host icecast.omroep.nl:80/radio1-bb-mp3 11:26:24.319 -> D: Connect to icecast.omroep.nl on port 80, extension /radio1-bb-mp3 11:26:24.413 -> D: Connected to server 11:26:24.413 -> D: nvs_get_str failed 1102 for key basicauth, keylen is 9, len is 150! 11:26:24.413 -> D: Contents: 11:26:24.413 -> D: Duration mp3loop 1 11:26:24.413 -> D: SPI semaphore not taken within 120 ticks by CPU 1, id hspec 11:26:24.460 -> D: SPI semaphore not taken within 130 ticks by CPU 0, id hspec 11:26:24.460 -> D: SPI semaphore not taken within 140 ticks by CPU 0, id hspec 11:26:24.460 -> D: SPI semaphore not taken within 150 ticks by CPU 0, id hspec 11:26:24.460 -> D: SPI semaphore not taken within 160 ticks by CPU 1, id hspec 11:26:24.460 -> D: Switch to HEADER 11:26:24.460 -> D: Headerline: Content-Type: audio/mpeg 11:26:24.507 -> D: audio/mpeg seen. 11:26:24.507 -> D: Headerline: icy-br:192 11:26:24.507 -> D: Headerline: ice-audio-info: samplerate=48000;channels=2;bitrate=192D: SPI semaphore not taken within 170 ticks by CPU 0, id hspec 11:26:24.507 -> 11:26:24.507 -> D: Headerline: icy-br:192 11:26:24.507 -> D: Headerline: icy-genre:Talk 11:26:24.507 -> D: Headerline: icy-metadata:1 11:26:24.507 -> D: Headerline: icy-name:NPOwithin D: SPI semaphore not taken within 180 ticks by CPU 1, id hspec 11:26:24.507 -> 11:26:24.507 -> D: Headerline: icy-pub:0 11:26:24.507 -> D: Headerline: icy-url:http://www.radio1.nl 11:26:24.507 -> D: Headerline: Server: Icecast 2.4.0-khicD: SPI semaphore not taken within 190 ticks by CPU 0, id hspec 11:26:24.553 -> D: Headerline: Cache-Control: no-cache, no-store 11:26:24.553 -> 11:26:24.553 -> D: Headerline: Access-Control-Allow-Origin: * 11:26:24.553 -> D: Headerline: Access-Control-Allow-Headers: Origin, Accept, X-Requested-With, Content-TypeD: SPI semaphore not taken within 200 ticks by CPU 0, id hspec 11:26:24.553 -> D: l-Allow-Headers: Origin, Accept, X-Requested-With, Content-Type seen. 11:26:24.553 -> 11:26:24.553 -> D: Headerline: Access-Control-Allow-Methods: GET, OPTIONS, HEAD 11:26:24.553 -> D: Headerline: Connection: Close 11:26:24.553 -> D: Headerline: Expires:ken within 210 ticks by CPU 0,D: SPI semaphore not taken within 210 ticks by CPU 0, id hspec 11:26:24.600 -> 11:26:24.600 -> D: Headerline: icy-metaint:16000 11:26:24.600 -> D: Switch to DATA, bitrate is 192, metaint is 16000 11:26:24.600 -> D: Duration mp3loop 103 11:26:24.600 -> D: SPI semaphore not taken within 220 ticks by CPU 0, id hspec 11:26:24.600 -> D: SPI semaphore not taken within 230 ticks by CPU 0, id hspec

delete

11:26:25.210 -> D: SPI semaphore not taken within 860 ticks by CPU 0, id hspec 11:26:25.257 -> D: Duration mp3loop 600 11:26:25.257 -> D: SPI semaphore not taken within 870 ticks by CPU 0, id hspec

delete

11:26:26.569 -> D: SPI semaphore not taken within 2180 ticks by CPU 0, id hspec 11:26:26.569 -> D: SPI semaphore not taken within 2190 ticks by CPU 0, id hspec 11:26:26.569 -> D: SPI semaphore not taken within 2200 ticks by CPU 0, id hspec 11:26:26.569 -> D: SPI semaphore not taken within 2210 ticks by CPU 0, id hspec 11:26:26.569 -> D: SPI semaphore not taken within 2220 ticks by CPU 0, id hspec 11:26:26.616 -> D: SPI semaphore not taken within 2230 ticks by CPU 0, id hspec 11:26:26.616 -> D: SPI semaphore not taken within 2240 ticks by CPU 0, id hspec 11:26:26.616 -> D: SPI semaphore not taken within 2250 ticks by CPU 1, id hspec 11:26:26.616 -> D: Song stopped incorrectly! 11:26:26.616 -> D: REG Contents 11:26:26.616 -> D: --- ----- 11:26:26.616 -> D: SPI semaphore not taken within 2260 ticks by CPU 1, id hspec 11:26:26.616 -> D: 0 - FFFF 11:26:26.663 -> D: SPI semaphore not taken within 2270 ticks by CPU 0, id hspec 11:26:26.663 -> D: 1 - FFFF 11:26:26.663 -> D: 2 - FFFF 11:26:26.663 -> D: SPI semaphore not taken within 2280 ticks by CPU 1, id hspec 11:26:26.663 -> D: 3 - FFFF 11:26:26.663 -> D: 4 - FFFF 11:26:26.663 -> D: SPI semaphore not taken within 2290 ticks by CPU 0, id hspec 11:26:26.663 -> D: 5 - FFFF 11:26:26.663 -> D: 6 - FFFF 11:26:26.663 -> D: SPI semaphore not taken within 2300 ticks by CPU 0, id hspec 11:26:26.663 -> D: 7 - FFFF 11:26:26.663 -> D: 8 - FFFF 11:26:26.663 -> D: SPI semaphore not taken within 2310 ticks by CPU 0, id hspec 11:26:26.663 -> D: 9 - FFFF 11:26:26.710 -> D: A - FFFF 11:26:26.710 -> D: SPI semaphore not taken within 2320 ticks by CPU 0, id hspec 11:26:26.710 -> D: B - FFFF 11:26:26.710 -> D: C - FFFF 11:26:26.710 -> D: SPI semaphore not taken within 2330 ticks by CPU 0, id hspec 11:26:26.710 -> D: D - FFFF 11:26:26.710 -> D: E - FFFF 11:26:26.710 -> D: SPI semaphore not taken within 2340 ticks by CPU 0, id hspec 11:26:26.710 -> D: F - FFFF 11:26:27.225 -> D: Metadata block 64 bytes 11:26:27.225 -> D: Streamtitle found, 52 bytes 11:26:27.225 -> D: StreamTitle='NPO Radio 1 - Spraakmakers - KRO-NCRV';

Wire

ESP32 Signal Display Oled VS1053 Note SDCard Note GPIO32 Pin 7 DCS GPIO5 Pin 6 CS GPIO4 Pin 2 DREQ GPIO22 SCL I2C Clock GPIO21 SDA I2C Data
GPIO16 RDX2
TX Nexion GPIO17 TXD2 RX Nexion GPIO18 SCK Pin 13 SCK GPIO19 MISO Pin 12 MISO GPIO23 MOSI Pin 11 MOSI GPI15 CS Pin 9 CS CS für SD Card GPIO3 RXD0 Res Seriel Inp GPIO1 TXD0 Res Seriel Outp GPIO35 IR Infrared Receiver VS1838B GPIO25 CLK Rotary Encoder CLK GPIO26 DT Rotary Encoder DT GPIO27 SW __ Rotary Encoder SW


GND x x x
VCC 5 V x x x
VCC 3 V
EN XRST Pin 8

boerti71 commented 5 years ago

I have the same problem, but the radio is working when I remove the SD card and rebbot the ESP

jroggenbuck commented 5 years ago

Thank you, but that did not help....

Edzelf commented 5 years ago

Will the SD card mount without the VS1053?

jroggenbuck commented 5 years ago

The SD Card is part of the VS1053

Edzelf commented 5 years ago

But uses different pins.

Edzelf commented 5 years ago

I have a version without sd. I use a separate sd card interface.

jroggenbuck commented 5 years ago

I tried two different shields. One is from Geeetech with onboard SD, the other is from LC Tech without SD. No change. Do I understand you right, that you have a software sketch without SD support? How can I test that?

Edzelf commented 5 years ago

No, there is just one version. I meant that I have the VS1053 without SD slot. In you case it looks like the SPI bus is corrupted by the SD card. There is probably something wrong with the GPIO 15.

jroggenbuck commented 5 years ago

Change config from pin 15 to pin 2 see attached picture pin 2 during startup, looks strange...

pin_2_cs

sarahjaneuk commented 5 years ago

Not sure if it is of any help and I was getting the exact same range of VS1053 errors at start up (SB 0000 to 1644 returning the same values) and by a process of elimination (changing each part one by one, including the wires) discovered it was a faulty ESP32 board though just swapped it out rather than spent time finding out what the specific issue was. Hope this helps.

jroggenbuck commented 5 years ago

I changed shield vs1053 and MCU twice, checked cables, check config. I load the MCU with different internet radio software. https://www.instructables.com/id/Internet-Radio-Using-an-ESP32/ But this software is not userfriendly, so I like to run the software that ED created,,,

sarahjaneuk commented 5 years ago

One thing I did do, separate from this project, is to download the VS1053 library (https://github.com/baldram/ESP_VS1053_Library). This contains an example of a web radio that I was able to get working. It is very basic though it is an easy way to check the ESP32 and VS1053 boards.

jroggenbuck commented 5 years ago

Thank you, but I think I will give up the project Internet Radio ....