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

Weird behaviour - hangs after GPIO status #500

Closed Unochepassa closed 2 years ago

Unochepassa commented 2 years ago

First of all, thank you very much for your time and support and congratulations for your magnificent software. Now that I'm done with the box, I'm having issues with the system. I have had to reinstall it three times because of misterious problems. While working, it suddenly reboots and keeps rebooting or stops at some point of the code (last time it was right after wifi connection). I suspect a hardware issue, but I would like to give it another try before tossing the esp32 into the bin. This time, while I was listening to some music, it rebooted and hung just after checking the status of the GPIO. This is what I can see in the terminal (pio):

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3fff0018,len:4 load:0x3fff001c,len:1044 load:0x40078000,len:10124 load:0x40080400,len:5828 entry 0x400806a8 D: Starting ESP32-radio running on CPU 1 at 240 MHz. Version Thu, 31 Mar 2022 12:40:00 GMT. Free memory 309424 D: Display type is BLUETFT D: Partition nvs found, 20480 bytes D: Read 32 keys from NVS D: pin_ir set to 35 D: pin_enc_clk set to 25 D: pin_enc_dt set to 26 D: pin_enc_sw set to 27 D: pin_tft_cs set to 15 D: pin_tft_dc set to 2 D: pin_tft_scl set to -1 D: pin_tft_sda set to -1 D: pin_tft_bl set to -1 D: pin_tft_blx set to -1 D: pin_sd_cs set to 21 D: pin_ch376_cs set to -1 D: pin_ch376_int set to -1 D: pin_vs_cs set to 5 D: pin_vs_dcs set to 32 D: pin_vs_dreq set to 4 D: pin_shutdown set to -1 D: pin_shutdownx set to -1 D: pin_spi_sck set to 18 D: pin_spi_miso set to 19 D: pin_spi_mosi set to 23 D: GPIO0 is HIGH D: GPIO2 is LOW, probably no PULL-UP D: GPIO4 is LOW, probably no PULL-UP D: GPIO5 is HIGH D: GPIO12 is HIGH D: GPIO13 is HIGH D: GPIO14 is HIGH D: GPIO15 is HIGH D: GPIO16 is HIGH D: GPIO17 is HIGH D: GPIO18 is HIGH D: GPIO19 is HIGH D: GPIO21 is HIGH D: GPIO22 is HIGH D: GPIO23 is HIGH D: GPIO25 is HIGH D: GPIO26 is HIGH D: GPIO27 is HIGH D: GPIO32 is HIGH D: GPIO33 is HIGH D: GPIO34 is LOW, probably no PULL-UP D: GPIO35 is LOW, probably no PULL-UP D: GPIO39 is LOW, probably no PULL-UP

To be candid, I made some changes to the code to modify the behaviour of the knob and to make the web interface more mobile friendly. Any ideas? Thank you.

Unochepassa commented 2 years ago

UPDATE:

As I am not proficient yet with PlatformIO, I tried the old-school approach of adding dbgprint ("") here and there and commenting out parts of code. Apparently, commenting [vs1053player->streamMode ( true )] out in the part of code below allows the boot to complete. Still, no screen nor audio is available, even if the web interface works properly. I checked the wiring, and everything seems in place (plus, it was working perfectly before the anomaly). As you can imagine, re-uploading the code did nothing, this time.

readprogbuttons() ; // Program the free input pins SPI.begin ( ini_block.spi_sck_pin,
ini_block.spi_miso_pin, ini_block.spi_mosi_pin ) ; // Init VSPI bus with default or modified pins vs1053player = new VS1053 ( ini_block.vs_cs_pin,
ini_block.vs_dcs_pin, ini_block.vs_dreq_pin, ini_block.vs_shutdown_pin, ini_block.vs_shutdownx_pin ) ; // Make instance of player vs1053player->streamMode ( true ) ; // Set streammode (experimental)

Unochepassa commented 2 years ago

Ok, apparently it was just a cold joint on the EN pin. Very difficult to spot, even if the behaviour could have provided some hint. I still have some stability issues, but I probably just need a better power supply.