logo elektroda
logo elektroda
X

Internet radio and audio file player on ESP32-S3

MAJSTER XXL 140373 1440
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
📢 Listen (AI):
  • #1411 21725940
    Jarosław 1808
    Level 11  
    Hello.
    I have a question on a slightly different subject, in which line should I change to make the LED shine in a colour other than white I am interested in the colour ice blue.
  • ADVERTISEMENT
  • #1412 21725952
    hevet
    Level 17  
    In none. You would have to add a few lines of code to control it. The fact that it lights up is a side effect of the SD card using the pin to control it.
  • #1413 21726111
    Jarosław 1808
    Level 11  
    Thanks for the answer.

    And I have one more question about the Sarunia software, can I fire it up without plugging in the sd card as in the previous case of the Evo3.18 software by colleague Dzikakun.
  • ADVERTISEMENT
  • #1414 21726219
    robgold
    Level 21  
    >>21726111 Hi, it seems to me that there has never been such an option in the Majster's software and also in my case it is such a rather "prosthesis" allowing to run the radio in the mode with ESP board and DAC PCM converter alone. At one time it was a simple run and check EEPROM simulated in ESP flash memory (the memory bank number and the number of the last played station is stored there). The bank (stations) in this mode are always downloaded from GitHub.
  • ADVERTISEMENT
  • #1416 21726280
    MAJSTER XXL
    Level 29  
    @Jarosław 1808 everything is possible, the only question is whether you can manage it, because you can disable the SD card init in the setup, comment on the functions of writing and reading from the SD card and then in the setup to set by hand the number of the station and the number of the bank to start and this should start the connection to this one station, but does it make sense with such a low cost of the reader and the card itself?
  • #1417 21728226
    Jarosław 1808
    Level 11  
    Hello.
    I'm trying to compile soft 3.18. 21 for the umpteenth day in a row and it keeps giving me errors.
    My question is if someone could give me the version of the libraries on which to compile this project.
  • #1418 21728664
    robgold
    Level 21  
    >>21728226 On my Github Link Link[/url] you have on the first page written "Software Dependencies" and there are all the libraries listed there.
    In addition, in the file "changes.txt" (in the sources) where I try to describe verbally what changes are implemented in the next versions you will also find a list of the needed libraries.

    In short, you need the following libraries for the radio in the Evo version (any version up to and including 3.18.21):

    ESP32 3.0.7
    AsyncTCP 3.3.6
    ESP Asunc WebServer 3.7.2
    ESP-audioI2S-master 3.0.13 + recompiled wip, netif
    U8g2 2.36.5
    WiFiManager 2.0.17
    ezButton 1.0.4

    On the same libraries, the Majster version for the OLED display should also allow itself to be compiled, as Evo3.xx.xx is hardware-compatible with its
    radio version v2.
  • #1419 21728715
    Jarosław 1808
    Level 11  
    Thanks a lot.
    I'm just trying to compile this under the Majster version on the oledo, but it's going uphill all the time, the previous version compiled without a problem.
    But I was craving a new one.
  • #1420 21728718
    robgold
    Level 21  
    >>21728715 If previous versions of "Evo" compiled correctly then there are no changes in 3.18.21 where you would need to use other libraries.
    Turn on your compile display options and throw in what you are stuck on.


    Arduino settings window with verbose output enabled for compile and upload
  • #1421 21729008
    irysbox
    Level 12  
    Most often there are duplication errors, then it writes you the path that was used and not used and warns you that it is duplicated. I personally knock one out of the directories manually and it corrects itself :)
  • #1422 21731322
    irysbox
    Level 12  
    well i managed to fire up evo 3, impressions right away:
    1. i am annoyed by this chattering every hour :) can this be easily switched off ? :)
    2. i am missing sleep and alarm
    3. what does the colour of the LED depend on because I left it on once it shines white but sometimes it changes to green :) I think to use it to change the colour of the case as if I made it out of white felt :)
  • #1423 21731324
    DJCheester
    Level 26  
    Ad.1 in the configuration via the radio on/off page
    Ad.2 there are no such options
    Ad.3 the colour of the diode depends on the driving of the RGB pins in our project the sd card is hanging on it and it is better to disable this diode by removing the O Ohm resistor

    Greetings....
  • ADVERTISEMENT
  • #1424 21731346
    irysbox
    Level 12  
    Re 3 is there any conflict ? can it glow ?
  • #1425 21731351
    DJCheester
    Level 26  
    More likely maybe (it annoyed me so I disabled the hardware) you just have the states there on the output pins to the SD card and setting the desired colour is impossible but as a rule with me it was always white.

    Greetings...
  • #1426 21731363
    hevet
    Level 17  
    I once temporarily made myself control this LED. I mean, when there was no wifi it was red, when connected it was green, when changing stations it was orange etc, but then I blew it off. I don't use the SD card. You would have to change the pin of the SD card and then play around.
  • #1427 21732252
    robgold
    Level 21  
    Welcome,

    i have uploaded on GitHub Dzikakuna version Evo 3.19.11
    Link Evo3.19.11

    What's new ?
    - as of this version we are working on a new audio library (3.4.3) with a new way of streaming audio information
    - ESP32 core version 3.2.0 (new libraries need to be uploaded for FLAC files)
    - improved and optimised the way audio information is passed to the display handling function (scroller and displayRadio)
    - preparation of code to extend the number of banks
    - tidied up the print functions on the "debug" terminal, to enable full "debugging" the following definitions have to be changed from 0 to 1

    
    // DEBUG PRINTS - ON/OFF
    #define f_debug_web_on 0         // Flaga włączenia wydruku debug_web
    #define f_debug_on 0             // Flaga włączenia wydruku debug 
    


    The new audio library 3.4.3 with all fixes is with me on GitHub. The one from the official release will not work with FLAC files.
    The version for Platformio differs with the debug info disabled (the version you need is on GitHub)

    New Evo updates will already be based on these and newer versions of the audio library.
  • #1428 21732297
    MAJSTER XXL
    Level 29  
    However, in my v3 version with the colour screen, a function has been added to enable random playback of files from a given folder. Each file is played once from the entire contents of the audio files in that folder until the files run out. The function uses a static usedIndices vector which stores the file numbers already drawn. When all the files in the directory have already been used, it clears the list and starts the draw again. This ensures that no songs are repeated until they have all been played. I just need to think about putting a symbol next to the file player timer to indicate that the shuffle mode is active.
    I used an extra button on the remote control, which even had the name RANDOM, you have to assign a new extra button and give its code in line:
    Code: C / C++
    Log in, to see the code


    In general, I have moved the entire file player and its support to FilePlayer.cpp and FilePlayer.h :

    https://github.com/sarunia/ESP32_internet_radio_v3/tree/main/ESP32_radio_v3_ILI9488_canvas


    Color screen of ESP32 showing active MP3 random playback mode

    Color screen on ESP32 showing audio file data and playback mode

    Some time ago I assigned myself this remote control from the photo below, which I had left over from some microwave from my wife's beauty salon. It is even created with these buttons to operate from our project:


    LTC AUDIO CDM100 remote with RANDOM button for shuffle playback function

    edit. I've added a red "RND" to the right of the clock of the audio file being played when random is enabled:


    Color ESP32 screen showing audio file details and active random playback mode
  • #1429 21733291
    robgold
    Level 21  
    The time change has come, the autumn season has arrived.... so it's time for a winter update of the Banks.
    To start with, I've uploaded a new Bank 16 with some new FLAC stations. I will successively replace all the banks.

    Just out of curiosity, if anyone is looking for a good quality FLAC station to test (of course not on our radio here, you can realistically play FLAC 1500-1600kbps and only 16bit) then I recommend stations Mother Earth Klassik , FLAC, Lossless, 192kHz, 2CH,24bit,~4536kbps URL: Link
  • #1430 21734635
    hevet
    Level 17  
    @robgold there are problems with reading bitrate on stations that have variable bitrate. For them you have to read the "estimated bitrate" and this is missing in the code.
  • #1431 21734720
    robgold
    Level 21  
    >>21734635 It should work because the evt_audio function also calls the standard bitrate when it calculates the estimated (i.e. after about 5-10sec).

    info: ....... evt_bitrate: 1120930
    info: ....... estimated bitrate (b/s): 1120930
  • #1432 21734723
    hevet
    Level 17  
    In the terminal it is visible, on the display no longer. At least on the FLAC stations.
  • #1433 21734738
    robgold
    Level 21  
    With me it correctly enters the value on the display after a while. There is a smootjazz.com.pl station which has an incorrect bitrate in the metadata so the library no longer counts it. I will take a closer look. On which station does it not write it on the display?

    OK I have. In version 3.19.11 there is still this error.
    In the code in case Audio::evt_bitrate: uncomment //f_audioInfoRefreshDisplayRadio = true;
    Correct should be: f_audioInfoRefreshDisplayRadio = true;

    Changing the bitrate must call the dipslayRadio function to refresh the screen at the bottom.
  • #1434 21734743
    hevet
    Level 17  
    E.g. BDPST Rock Radio.
    I put in something like this:


    case Audio::evt_info:
    {
    String msg = String(m.msg); // convert to String
    msg.trim(); // remove spaces and ▼B String

    // --- BitRate ---
    int bitrateIndex = msg.indexOf("estimated bitrate (b/s):");
    int prefixLength = 23; // length "estimated bitrate (b/s):"

    if (bitrateIndex == -1) {
    // fallback to regular bitrate
    bitrateIndex = msg.indexOf("Bitrate (b/s):");
    prefixLength = 14; // length "Bitrate (b/s):"
    }

    if (bitrateIndex != -1) {
    int endIndex = msg.indexOf('}, bitrateIndex);
    if (endIndex == -1) endIndex = msg.length();

    String bitrateString = msg.substring(bitrateIndex + prefixLength, endIndex);
    bitrateString.trim();

    int bitrateInt = bitrateString.toInt();
    bitrateInt = bitrateInt / 1000; // convert to Kbps
    bitrateString = String(bitrateInt);

    f_audioInfoRefreshDisplayRadio = true;
    wsAudioRefresh = true; // WebSocket refresh

    //Serial.printf("bitrate: %s Kbps", bitrateString.c_str());
    }

    now shows ok, priority is estimated, then normal bitrate.
  • #1435 21734747
    robgold
    Level 21  
    As the audio function calls info estimated bitrate it automatically inserts the read value into evt_bitrate. The problem was that this was not refreshed on screen in 3.19.11
  • #1436 21734751
    hevet
    Level 17  
    With this erroneous bitrate, it's the station's fault, they broadcast the header I think from MP3, once in the library I think it counted samplerate*bit*channels then and it came out 1411 or 1536kbps by default. Maybe a condition like this could be added?
  • #1437 21734756
    robgold
    Level 21  
    >>21734751 I've written to smoothjazz.com.co.uk to correct this. True, it looks like someone copied the icast server settings from the mp3 tab not realising that this bitrate then displays incorrectly.
  • #1438 21734757
    hevet
    Level 17  
    robgold wrote:
    When the audio function calls info estimated bitrate it automatically inserts the read value into evt_bitrate. The problem was that this was not refreshed on screen in 3.19.11


    Where to add them?
  • #1439 21734764
    robgold
    Level 21  
    In the code in case Audio::evt_bitrate: uncomment //f_audioInfoRefreshDisplayRadio = true;
    Correct should be: f_audioInfoRefreshDisplayRadio = true;

    Changing the bitrate must call the dipslayRadio function to refresh the screen at the bottom.
  • #1440 21735469
    Jarosław 1808
    Level 11  
    Hello.
    I've been trying to compile ver 3.19.11 for a few days now, but for chrissake I can't add the reworked audio library. On a normal library the file compiles without any problem, but on the library reworked by the author unfortunately it is throwing me errors could someone tell me if I should add this library the normal way by adding to the project or is there some other miraculous way.
    I'll just add that I add the unzipped library to the Arduino library documents folder.
    The moment I want to ZIP add to the project unfortunately it shows me an error.
📢 Listen (AI):

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