logo elektroda
logo elektroda
X
logo elektroda

Internet radio and audio file player on ESP32-S3

MAJSTER XXL 106230 1246
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #91 21049417
    hevet
    Level 16  
    Clear flash before uploading the code, it will no longer connect. You have wifi and password saved somewhere in flash, from the previous version with multi.
  • ADVERTISEMENT
  • #92 21049425
    MAJSTER XXL
    Level 29  
    @hevet somehow after adding WiFiManager and removing WiFiMutli the size was bigger and I had to change the partition.
  • #93 21049434
    hevet
    Level 16  
    I also changed it to a bigger one.
    And I have a question, do you also have a problem with encoders? When you turn clockwise, sometimes it`s fine, sometimes instead of increasing, e.g. the volume, it decreases, then increases again, generally they go crazy, when I turn left, there is no effect.
  • #94 21049454
    MAJSTER XXL
    Level 29  
    Ok, I didn`t think you had to clear the flash, I thought it happened automatically every time the program loaded, hah. It works really simple, I selected the network from my phone and it connected immediately. The author of this library came up with it brilliantly, thank you for pointing out this WiFiManager.

    Arduino IDE interface with code and serial monitor.

    Added after 2 [minutes]:

    @hevet unfortunately sometimes I have a problem with encoders, I will remove the wifi selection support from the program, which I started doing, maybe it will improve, because I noticed that after adding it something got worse and I can`t deal with it.
  • #95 21049469
    hevet
    Level 16  
    I just removed the WiFi stuff and unfortunately this is the result. Maybe I haven`t deleted something yet. I hope you will succeed 😉. Have you managed to remember the station?
  • ADVERTISEMENT
  • #96 21052507
    miroskop
    Level 23  
    HELP!!! I broke the radio. I tried to upload the latest soft, the one with WiFiManager and it failed because it didn't fit. I don't know how to change the partition as you write about above so I decided to go back to my previous working version. Unfortunately the radio stops at a flashing "Internet radio" and that's it, subsequent uploads with flash deletion, network changes, prayers and curses don't help. The serial port monitor periodically throws up something like this:

    "ESP-ROM:esp32s3-20210327
    Build:Mar 27 2021
    rst:0x8 (TG1WDT_SYS_RST),boot:0x38 (SPI_FAST_FLASH_BOOT)
    Saved PC:0x4037816d
    SPIWP:0xee
    mode:D IO, clock div:1
    load:0x3fce3808,len:0x44c
    load:0x403c9700,len:0xbe4
    load:0x403cc700,len:0x2a68
    entry 0x403c98d4
    ESP-ROM:esp32s3-20210327
    Build:Mar 27 2021
    rst:0x8 (TG1WDT_SYS_RST),boot:0x38 (SPI_FAST_FLASH_BOOT)"
  • #97 21052515
    hevet
    Level 16  
    Set the parameters this way and win the latest soft.
    Screenshot of configuration menu for the ESP32S3 Dev Module in a development environment.
  • #98 21052546
    miroskop
    Level 23  
    Thank you for your prompt response! I did as you wrote, the soft loaded without errors but it didn't change anything. It continues as if it resets on "Internet radio", more or less every two seconds.
    I have unplugged the peripherals but with no effect.
  • #99 21052553
    hevet
    Level 16  
    And have you erased the flash? Download flash download tools and do a flash erase.
  • #100 21052564
    miroskop
    Level 23  
    No, I thought the Arduino deletes the flash as you set "Enabled" in "Tools". I downloaded this program and will try to use it
  • #101 21052758
    MAJSTER XXL
    Level 29  
    miroskop wrote:
    I thought the Arduino deletes the flash as you set "Enabled" in "Tools".


    I think you did a good job of deleting the whole flash, I also did that and it worked from the Arduino IDE menu.

    @hevet try to embrace saving the last station using the library

    I don't succeed. I think you could give a read "get" at the end of the setup of these bank_nr and station_nr variables, and a write at the end of the changeStation() function.

    This is the description:
    https://randomnerdtutorials.com/esp32-save-data-permanently-preferences/

    Added after 6 [hours] 45 [minutes]:

    I was able to do the writing and reading of the values of the station and bank number variables to the SD card, if the program does not detect the card then the default values fly. @hevet you can check this at your place.
  • ADVERTISEMENT
  • #102 21053253
    hevet
    Level 16  
    That's great, I tried writing to memory, but it only wrote the first time and then only read the newly written ones, strange.
    I can check, but I don't have the SD card connected yet, I have the reader just need to make up the cables.
  • ADVERTISEMENT
  • #103 21053320
    miroskop
    Level 23  
    After a long battle, I finally managed to get this radio working again. What was the cause? I don't know. It finally started up on a sketch from a fortnight ago and I prefer not to touch it for now. I am temporarily fed up with programming.
  • #104 21053468
    hevet
    Level 16  
    Unfortunately it doesn't work for me. On startup, bank 1 and station 0 are enabled. An empty station_nr file is created on the card, and bank_nr is not created at all.

    Added after 15 [minutes]:

    Music from the card plays correctly, so the card is connected correctly.
  • #105 21055453
    hevet
    Level 16  
    I wrapped it up, it now works, it went on another card, but something else was wrong, but it's not sure what anymore. If anyone would like, here is a link to my fork of the radio. Added:
    - possibility to update via browser,
    - tone settings,
    - settings are saved in one file,
    - additionally the volume value is saved in a file on the card.
    A small note, the encoder has changed pin1 to 46.
    https://github.com/hevet/ESP32_radio_player2
  • #106 21059273
    Slawek K.
    Level 35  
    Inspired by your cool project I decided to build a similar chip, however the sound source is to be BT and not net. I purchased ESP-S3 and unfortunately zonked, because ble in this chip does not support A2DP :( the usual ESP32 remains, but in this case I have 99.5% of flash occupied and I still need LCD support and amplifier control
  • #108 21059280
    Slawek K.
    Level 35  
    Well that's what I'm writing about, the ESP32-S3 does not support A2DP over BLE and it's not possible to compile this under S3.

    Pozdr
  • #109 21060238
    MAJSTER XXL
    Level 29  
    @Slawek K. I also mentioned this lack of A2DP for just this module earlier in this topic, admittedly if you set the right partition and flash size for the sketch in the Arduino IDE you would fit in with the program. It's a shame, because I also miss this solution for bluetooth audio.
  • #113 21116996
    Nargo
    Level 22  
    UWAGA: biblioteka Audio działa na architekturze(/architekturach) sam i może nie być kompatybilna z obecną płytką która działa na architekturze(/architekturach) esp32.
    In file included from d:\Moje dokumenty\Arduino\libraries\Audio\src/Audio.h:16,
                     from C:\Users\Bart\AppData\Local\Temp\.arduinoIDE-unsaved2024512-47656-1m7ihnq.85ot\sketch_jun12a\sketch_jun12a.ino:3:
    d:\Moje dokumenty\Arduino\libraries\Audio\src/DAC.h:21:15: error: expected ')' before '*' token
      DACClass(Dacc *_dac, uint32_t _dacId, IRQn_Type _isrId) :
              ~    ^~
                   )
    d:\Moje dokumenty\Arduino\libraries\Audio\src/DAC.h:35:2: error: 'Dacc' does not name a type
      Dacc *dac;
      ^~~~
    d:\Moje dokumenty\Arduino\libraries\Audio\src/DAC.h:37:2: error: 'IRQn_Type' does not name a type
      IRQn_Type isrId;
      ^~~~~~~~~
    d:\Moje dokumenty\Arduino\libraries\Audio\src/DAC.h: In member function 'void DACClass::enableInterrupts()':
    d:\Moje dokumenty\Arduino\libraries\Audio\src/DAC.h:31:44: error: 'isrId' was not declared in this scope
      void enableInterrupts()  { NVIC_EnableIRQ(isrId); };
                                                ^~~~~
    d:\Moje dokumenty\Arduino\libraries\Audio\src/DAC.h:31:29: error: 'NVIC_EnableIRQ' was not declared in this scope
      void enableInterrupts()  { NVIC_EnableIRQ(isrId); };
                                 ^~~~~~~~~~~~~~
    d:\Moje dokumenty\Arduino\libraries\Audio\src/DAC.h: In member function 'void DACClass::disableInterrupts()':
    d:\Moje dokumenty\Arduino\libraries\Audio\src/DAC.h:32:45: error: 'isrId' was not declared in this scope
      void disableInterrupts() { NVIC_DisableIRQ(isrId); };
                                                 ^~~~~
    d:\Moje dokumenty\Arduino\libraries\Audio\src/DAC.h:32:29: error: 'NVIC_DisableIRQ' was not declared in this scope
      void disableInterrupts() { NVIC_DisableIRQ(isrId); };
                                 ^~~~~~~~~~~~~~~
    C:\Users\Bart\AppData\Local\Temp\.arduinoIDE-unsaved2024512-47656-1m7ihnq.85ot\sketch_jun12a\sketch_jun12a.ino: At global scope:
    C:\Users\Bart\AppData\Local\Temp\.arduinoIDE-unsaved2024512-47656-1m7ihnq.85ot\sketch_jun12a\sketch_jun12a.ino:115:1: error: 'Audio' does not name a type
     Audio audio;                              // Obiekt do obsługi funkcji związanych z dźwiękiem i audio
     ^~~~~
    C:\Users\Bart\AppData\Local\Temp\.arduinoIDE-unsaved2024512-47656-1m7ihnq.85ot\sketch_jun12a\sketch_jun12a.ino: In function 'void changeStation()':
    C:\Users\Bart\AppData\Local\Temp\.arduinoIDE-unsaved2024512-47656-1m7ihnq.85ot\sketch_jun12a\sketch_jun12a.ino:279:3: error: 'audio' was not declared in this scope
       audio.connecttohost(station);
       ^~~~~
    C:\Users\Bart\AppData\Local\Temp\.arduinoIDE-unsaved2024512-47656-1m7ihnq.85ot\sketch_jun12a\sketch_jun12a.ino:279:3: note: suggested alternative: 'Audio'
       audio.connecttohost(station);
       ^~~~~
       Audio
    C:\Users\Bart\AppData\Local\Temp\.arduinoIDE-unsaved2024512-47656-1m7ihnq.85ot\sketch_jun12a\sketch_jun12a.ino: In function 'void playFromSelectedFolder()':
    C:\Users\Bart\AppData\Local\Temp\.arduinoIDE-unsaved2024512-47656-1m7ihnq.85ot\sketch_jun12a\sketch_jun12a.ino:990:5: error: 'audio' was not declared in this scope
         audio.connecttoFS(SD, fullPath.c_str());
         ^~~~~
    C:\Users\Bart\AppData\Local\Temp\.arduinoIDE-unsaved2024512-47656-1m7ihnq.85ot\sketch_jun12a\sketch_jun12a.ino:990:5: note: suggested alternative: 'Audio'
         audio.connecttoFS(SD, fullPath.c_str());
         ^~~~~
         Audio
    C:\Users\Bart\AppData\Local\Temp\.arduinoIDE-unsaved2024512-47656-1m7ihnq.85ot\sketch_jun12a\sketch_jun12a.ino: In function 'void updateTimer()':
    C:\Users\Bart\AppData\Local\Temp\.arduinoIDE-unsaved2024512-47656-1m7ihnq.85ot\sketch_jun12a\sketch_jun12a.ino:1327:9: error: 'audio' was not declared in this scope
         if (audio.isRunning() == true)
             ^~~~~
    C:\Users\Bart\AppData\Local\Temp\.arduinoIDE-unsaved2024512-47656-1m7ihnq.85ot\sketch_jun12a\sketch_jun12a.ino:1327:9: note: suggested alternative: 'Audio'
         if (audio.isRunning() == true)
             ^~~~~
             Audio
    C:\Users\Bart\AppData\Local\Temp\.arduinoIDE-unsaved2024512-47656-1m7ihnq.85ot\sketch_jun12a\sketch_jun12a.ino: In function 'void setup()':
    C:\Users\Bart\AppData\Local\Temp\.arduinoIDE-unsaved2024512-47656-1m7ihnq.85ot\sketch_jun12a\sketch_jun12a.ino:1530:3: error: 'audio' was not declared in this scope
       audio.setPinout(I2S_BCLK, I2S_LRC, I2S_DOUT); // Konfiguruj pinout dla interfejsu I2S audio
       ^~~~~
    C:\Users\Bart\AppData\Local\Temp\.arduinoIDE-unsaved2024512-47656-1m7ihnq.85ot\sketch_jun12a\sketch_jun12a.ino:1530:3: note: suggested alternative: 'Audio'
       audio.setPinout(I2S_BCLK, I2S_LRC, I2S_DOUT); // Konfiguruj pinout dla interfejsu I2S audio
       ^~~~~
       Audio
    C:\Users\Bart\AppData\Local\Temp\.arduinoIDE-unsaved2024512-47656-1m7ihnq.85ot\sketch_jun12a\sketch_jun12a.ino: In function 'void loop()':
    C:\Users\Bart\AppData\Local\Temp\.arduinoIDE-unsaved2024512-47656-1m7ihnq.85ot\sketch_jun12a\sketch_jun12a.ino:1598:3: error: 'audio' was not declared in this scope
       audio.loop();
       ^~~~~
    C:\Users\Bart\AppData\Local\Temp\.arduinoIDE-unsaved2024512-47656-1m7ihnq.85ot\sketch_jun12a\sketch_jun12a.ino:1598:3: note: suggested alternative: 'Audio'
       audio.loop();
       ^~~~~
       Audio
    
    Compilation error: 'Audio' does not name a type
    .

    I've been sitting since Sunday and can't work out why?
  • #114 21117001
    hevet
    Level 16  
    TCP/IP wrote:
    Try this.
    Remove the Audio and SPI libraries included by the thread author. I don't know why he included them.
    Install this "ESP32-audioI2S" is here https://github.com/schreibfaul1/ESP32-audioI2S
    If you don't have it installed then add Adafruit_GFX_Library and Adafruit_BusIO.
    It should compile. I have not tested if this project works.
    .
  • #115 21128171
    paulosxc
    Level 12  
    Hello.
    I've screwed up this project (revelation it is) only I have a problem the sound is not coming out on the headphones and there is such an error in the port monitor (233) I2S: i2s_calculate_common_clock(1180): sample rate is too large
    E (233) I2S: i2s_calculate_clock(1229): Common clock calculate failed
    E (235) I2S: i2s_set_pin(295): ws_io_num invalid any hints?
  • #117 21130105
    paulosxc
    Level 12  
    Didn't help. I've had enough yesterday. i'll keep trying unless there is a ready to use chip lashing. Another project on esp32 dev 1 plays without a problem this one on s3 i cant run

    I uploaded the code from hevet and it plays but on a 16gb card on 4 it did not want to, I cannot master the encoder yet i.e. most of the time it goes back to the top of the menu maybe I will swap places a fab thank you to the authors.
  • #118 21130992
    MAJSTER XXL
    Level 29  
    @paulosxc have you made the connections on the DAC module as in this screengrab?

    DAC module connection diagram with board images. .
  • #119 21131081
    paulosxc
    Level 12  
    Encoders connected to 3.3v and there is an improvement. Sometimes the radio does not start, the internet radio message flashes, do you also have this? Does it play files from the sd card or if so, how should they be catalogued?
  • #120 21131088
    MAJSTER XXL
    Level 29  
    @paulosxc The radio should run even on just the ESP32 with the DAC, you can unplug the rest for a trial, it should go to play the default station once the network is configured. Let us know what's up with the lack of audio.

    As for the audio file directories, I don't have the support done with loading subdirectories, I'll come back to it at some point and get that done, unless someone has and shares the code.

Topic summary

The discussion centers on the development of an internet radio and audio file player based on the ESP32-S3-WROOM-1 module, featuring a custom-designed prototype PCB with OLED display and user controls including rotary encoders and buttons. Key challenges addressed include pin spacing discrepancies in the ESP32-S3 module footprint, integration of Wi-Fi connectivity with dynamic station list updates, and handling of Polish character encoding on the OLED display. The project uses Arduino IDE (version 2.3.2) with ESP-IDF support and requires enabling PSRAM. Audio playback supports MP3, AAC, and FLAC streams, with the ESP32-audioI2S library recommended over the incompatible Audio library. Users reported issues with SPI MISO pin assignment causing bootloader conflicts, resolved by reassigning MISO to pin 35. The project incorporates WiFiManager for network configuration, EEPROM and SD card storage for saving last played station and settings, and includes plans for tone control via an external KA2107 equalizer and a CS8673 amplifier module. Problems with encoder input stability and memory limitations for Bluetooth A2DP on ESP32-S3 were noted. The community suggested alternatives like KaRadio and ESP32-MiniWebRadio projects. Debugging tips include serial terminal logs for HTTP errors and flash memory erasure to resolve boot loops. The project is open-source on GitHub, encouraging forks and modifications. Additional features under development include browser-based updates, directory navigation, and potential audio recording to SD card.
Summary generated by the language model.
ADVERTISEMENT