schreibfaul1 / ESP32-MiniWebRadio

Internetradio with ESP32, I2S DAC and SPI TFT Display with Touchpad
https://www.youtube.com/watch?v=6QbPee2583o
329 stars 81 forks source link

Connection troubles #324

Open ovidiu169 opened 10 months ago

ovidiu169 commented 10 months ago

Hello everybody !!!

I opened this issue because of the difficulties I was confronted trying to connect this radio to the network/router. Errors as “ASSOC_LEAVE” or TIME OUT_ERROR are very frequent. With no logic reasons for this behavior. Unexpected behavior. After I documented myself on this, I found that a solution could be not resetting the router (this doesn’t change nothing) but to modify the TSH values. I do not recommend this solution (you can do it if you are a pro)… Desperate of this I tried to connect to a tablet with his WiFi hotspot activated ( open connection, no WPA/WPS protocol, 2.4 GHz and no password). Success !!! But after two or three resets , the SD card refused to mount !!! I reconfigured SD connection using an SD adapter this time (with a pull-up resistor on D0. It worked… After that I modified the “common.h” file in order to use a VS1053 as decoder. Surprise !!! … The code is not compiling (errors in I2S branch). So, the last version of the code works only with external decoders like PCM 5102, or MAX 9357A ?!?…(1) There are a lot of defects which appear by a minute to other with no explanation !!! By the way, I did not succeeded to change SPIRAM configuration on my ESP32-S3 board from Quad to Octal. I did not find any tutorial on this.

schreibfaul1 commented 10 months ago

Thanks for your contribution, in fact, the behaviour depends on the HW used. In your ESP32, the GPIOs for the SD_MMC are predefined, with the ESP32-S3 they can be freely selected. For D0, a pull-up is switched internally. Maybe that's not enough for every SD card. Running WiFi unencrypted is not a good idea. Please try the WiFi examples from Espressif, it must also work with WPA. So far, I have kept the two libraries vs1053ext and audioI2S up-to-date. The vs1053ext I have archived due to the age of the VS1053B. And it's not a problem today to use an external DAC, such as MAX98357A PCM5102A CS4344... to procure. Or an ESP32 board with integrated DAC such as AC101, ES8388, WM8978... Unfortunately, the PSRAMS >=4 MB of the ESP32-S3 are not recognised as octal. This has to be done manually in menuconfig.

ovidiu169 commented 10 months ago

Good Morning, Wolle !

Yes indeed, this behavior depends very much of the HW used. I’m totally agree. In my case, I changed 4 different ESP32 boards. The existence of PSRAM seems to be mandatory. But the network connection is troubled when you have many devices running on the same router but with different passwords. The time-out connection errors are unavoidable… In your code, I changed the SSL timings up to 2000 or even 3000, but no success. This error “4way_shaking hands” was considered in the beginning a BUG, but meanwhile the experts found avoided this, using a set of commands in the router SW. Of course, I wasn’t able to do so. Regarding the external DACs you have to know that in my country, these are very hard to be found. In example, for PCM5102A, I found a very strange version, which is working properly only with Raspberry Pi, and MAX9357A doesn’t exists for sale. I ordered a pair of these from Germany (Eckstein GmBh)😁. Another option is to order these from China 🇨🇳, but it takes months to arrive…. I wonder if you could help with the connection's diagram for these chips ?….

ovidiu169 commented 10 months ago

Hello everybody ! Just a small note for all those who want to build this magnificent Web Radio. Choose a board which has PSRAM !!! Don’t use an ordinary ESP 32 board. You will avoid the tremendous hassle to make it work. If you will succeed , you will not have icons on the screen, you’ll not have clock or menu. You will not be able to control the machine (only with an IR received or on line - if you will succeed to open the AP). Use an ESP32-S3 board with a PSRAM bigger than 4M. Convert SPIRAM from Quad to Octal in order to avoid “continuous reboot “ behavior. Try different SD cards until you will find one able to work properly (otherwise you’ll receive messages as “SD card failed to mount). In my case I found a 16gb card able to work at 400000000 speed. I tried also with a 4gb card but it not worked. Final word, about External DAC you will use. I tried PCM5102A and UDA1334A. Take care about connections. In case of PCM5102a you will have DIN to IO25, BCK to IO27, LRC(WS) to 26. If you want to reduce noise connect SCK to Gnd. In case of UDA1334a , connections are -DIN to 25(9), BCLK to 27(3)and WS to 26(1). The pins on the brackets are for ESP32-S3.

Wish you Goodluck and a Happy New Year !!!

schreibfaul1 commented 10 months ago

Thank you for your review. This will help other users.

ovidiu169 commented 10 months ago

You are welcome, Wolle !!!

All the best from Romania !