logo elektroda
logo elektroda
X
logo elektroda

Internet radio and audio file player on ESP32-S3

MAJSTER XXL 103251 1245
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #61 21035314
    MAJSTER XXL
    Level 29  
    @hevet I can`t help, on foreign forums they write that it may be a faulty ESP32 module, try some other examples with Arduino IDE on it, if it wants to work stably at all. These two large inscriptions appear on the display, as I understand it? Do you have the Arduino IDE in the latest version?
  • ADVERTISEMENT
  • #62 21035323
    hevet
    Level 16  
    Yes, these two inscriptions. Arduino IDE 2.3.2. I have 2 such modules and it is the same. Interestingly, e.g. this internet radio with a touch display works on these modules https://github.com/schreibfaul1/ESP32-MiniWebRadio, so it would be strange if two of them were damaged in the same way.
  • ADVERTISEMENT
  • #63 21036027
    MAJSTER XXL
    Level 29  
    @hevet see again, in the first phase of the connection to the server I added a GET request code to the serial terminal, for me the code is normally 200 and everything works.

    Screenshot of Arduino IDE with an ESP32 project, showing code related to HTTP connection and retrieving radio stations.
  • #64 21036134
    hevet
    Level 16  
    Unfortunately.

    Connected to the WiFi network
    HTTP response code: -1
    Error downloading stations. HTTP Code: -1
    Guru Meditation Error: Core 1 panic`ed (Double exception).
  • ADVERTISEMENT
  • #65 21036238
    MAJSTER XXL
    Level 29  
    @hevet you can also try to hard-code only one station:

    replace lines from 1470 in the setup with:

    //fetchStationsFromServer();
    //changeStation();
    display.clearDisplay();
    audio.connecttohost("https://waw.ic.smcdn.pl/3990-1.mp3");

    If you manage to turn it on, the Vox FM radio should play, let me know.
  • #66 21036257
    hevet
    Level 16  
    Connected to the WiFi network
    info Connect to new host: "https://waw.ic.smcdn.pl/3990-1.mp3"
    info PSRAM found, inputBufferSize: 638965 bytes
    info buffers freed, free Heap: 243528 bytes
    info SSL has been established in 748 ms, free Heap: 203064 bytes
    info redirect to new host "https://ic2.smcdn.pl/3990-1.mp3"
    info Connect to new host: "https://ic2.smcdn.pl/3990-1.mp3"
    info buffers freed, free Heap: 242648 bytes
    info SSL has been established in 627 ms, free Heap: 202808 bytes
    bitrate 128000
    info MP3Decoder has been initialized, free Heap: 202996 bytes , free stack 2496 DWORDs
    lasthost https://ic2.smcdn.pl/3990-1.mp3
    info stream ready
    info syncword found at pos 0
    info MP3 decode error -2 : MAINDATA_UNDERFLOW
    info syncword found at pos 383
    info syncword found at pos 0
    info MP3 decode error -2 : MAINDATA_UNDERFLOW
    info syncword found at pos 383
    info syncword found at pos 0
    info Channels: 2
    info SampleRate: 48000
    info BitsPerSample: 16
    info BitRate: 128000
    info StreamTitle=`Radio VOX FM - In the rhythm of hits`
    streamtitle Radio VOX FM - In the rhythm of hits
    info StreamTitle=`DAVID GUETTA & BEBE REXHA - I`m Good (Blue) 128`
    streamtitle DAVID GUETTA & BEBE REXHA - I`m Good (Blue) 128
    Volume value: 11

    Added after 26 [minutes]:

    It turns out that the game is playing, and the information is also on the display.

    Added after 3 [hours] 51 [minutes]:

    The best thing is that I went back to the code with channel lists and suddenly it now works and downloads entire lists, although I changed it to start from a different list. Is it possible to adjust the bass or treble tones on this radio? Or are you planning to add it?
  • ADVERTISEMENT
  • #67 21036884
    MAJSTER XXL
    Level 29  
    @hevet I can`t explain this phenomenon of downloading your default "favorites" bank. As for the tone equalizer - I don`t have it planned, but I`m considering the option of recording an audio file "on demand" from a radio station to an SD card on the fly, we`ll see if the resources and capabilities of this ESP32 will be enough.
  • #68 21036940
    hevet
    Level 16  
    It`s actually a phenomenon, it`s working without a problem for now, I don`t know because I tried to get it to download a maximum of 20 stations from the list and start starting, then I went back to 100 and it didn`t want to start every time, then I changed it to another list, in the meantime I changed one more parameter Flash Mode on DIO 80MHz, because that`s what it detected in some ESP test sketch.

    Added after 56 [seconds]:

    Overall, thanks for your willingness to solve the problem and, overall, solve the problem.
  • #69 21037884
    hevet
    Level 16  
    How to add more than one wifi network?
  • #70 21038090
    MAJSTER XXL
    Level 29  
    @hevet and this is an idea to add another item to the menu to search for networks and enter the password into the selected one.
  • #71 21038440
    speedy9
    Helpful for users
    MAJSTER XXL wrote:
    @hevet I can`t explain this phenomenon of downloading your default "favorites" bank

    I had similar problems with restarting ESP in another radio that I did. The problem was a function from the Audio.h library. After initializing the function, the problem stopped.
    void audio_info(const char *info){
    Serial.println(info);
    }
    ESP restarted when trying to connect to a stream if this function was not initialized. Such a bug.
  • #72 21040087
    hevet
    Level 16  
    Is or will there be an option to save the starting station?
  • #73 21044972
    miroskop
    Level 23  
    My radio is already working in the kitchen :)
    On the front panel, I placed three potentiometers on the left side of the display and two encoders on the right. The potentiometers are "Balance" (the upper one) and "Bass" and "Treble" (the two lower ones). I had to add timbre because I have ceiling speakers and without equalization they sound quite flat. Moreover, some stations boost bass and treble and others do not, so you have to interfere with the sound yourself. The correction is made on the KA2107 circuit because it takes care of everything that is needed ("Volume", "Bass", "Treble" and "Balance") and single potentiometers are enough, there is no need for stereo ones. Since "Volume" is on the encoder, so as not to duplicate them, I did not connect another potentiometer to the front panel. I only soldered the mounting potentiometer to determine the appropriate signal level. The power amplifier is a ready-made product from China: CS8673
    Once again, I would like to thank the creator for his work and sharing it on the forum!!!
    The photo shows a radio in a kitchen cabinet.

    Radio with a display and knobs in a kitchen cabinet
  • #74 21044976
    hevet
    Level 16  
    I added line 4 of code to the sound timbre, because the library has it built-in. True, you have to enter the settings in the code and upload them, but once you find your settings, you don`t change them.
  • #75 21044981
    miroskop
    Level 23  
    Cool! However, for the reasons stated above, I prefer to have the traditional tone control.
  • #76 21044990
    hevet
    Level 16  
    For now, what I miss most about it is remembering the last station I listened to, I`ve been struggling with it for a while, but to no avail. I`ll probably design my own board.
  • #77 21045043
    MAJSTER XXL
    Level 29  
    @hevet for now I`m trying to add support for searching for a WiFi network and saving its password, I`m currently listing the found networks with the signal strength on the OLED with the option of scrolling the selection, but I`m a bit stuck on making the support for selecting characters at the cursor position, I need to find the reason for the encoder not working properly in this case function and then save the password in eeprom or maybe on the SD card. I will definitely save the last listened station to the eeprom memory and read it at startup. I have already made a lot of corrections, but as usual, there is still something waiting to be refined. Generally, the radio and player work, now I`m testing whether it jumps to a station, bank or file folder other than the one selected manually during playback.

    Added after 6 [minutes]:

    @miroskop you made a beautiful cutout for the display and the SD card, did you press the display in or did you glue it somehow? Unfortunately, I couldn`t cut it so nicely, so I used screws. Ultimately, you can make a version with or without 4 buttons, because you can handle a lot of both encoders, and the buttons provide a direct jump function.
  • #78 21045057
    miroskop
    Level 23  
    I milled all the holes in the front plate on my own CNC milling machine. And the PCB too.
  • #79 21045331
    hevet
    Level 16  
    @MAJSTER XXL haven`t you thought about a different wifi concept? It`s about the WifiManager library from tzapu.
    When the radio does not connect to the WiFi network, the network is started, e.g. WIFI_RADIO, and you connect to it, e.g. by phone, enter 192.168.4.1 and scan the networks, select the available one, enter the password, restart and it works. I checked this solution and I can tell you that everything works fine. And adding this really takes just a few lines of code.
  • #80 21045463
    TechEkspert
    Editor
    Nice color of the display, blue but not aggressive. CNC does the job. More descriptions of the knobs would be useful.
  • #81 21045478
    Andrzej Ch.
    Level 33  
    There are radio stations that broadcast a stream in a format other than mp3, e.g. AAC or FLAC. Can the author`s device decode such a stream better?
    Is it only mp3?
    Is it possible to change the bitrate display from e.g. 128000b/s to 128kb/s.
    or 160000b/s to 160kb/s
    This will increase the readability of the content on the display and provide a more aesthetic presentation of data
  • #82 21045486
    hevet
    Level 16  
    AAC AND FLAC work. In terms of bitrate, I`m definitely in favor of it. It`s a good idea to do the same with the sampling rate.
  • #83 21045677
    ArturAVS
    Moderator
    Have you considered TFT instead of OLED? More information could be included and the colors would add some charm.
  • #84 21045709
    szeryf3
    Level 29  
    @miroscope looks very nice. As factory. Respect.
  • #85 21048173
    hevet
    Level 16  
    I saw that there was an update for remembering the last station listened to, but unfortunately something doesn`t work for me. After startup, station -1, bank -1 starts, when I switch to the correct station and bank, the monitor shows that it has written to eeprom and reads what was written, but after restart it is again station -1, bank no. -1.
  • #86 21048177
    MAJSTER XXL
    Level 29  
    @hevet no, it doesn`t work yet, I`m trying to figure it out and it doesn`t work, I`m asking in other groups, I`m comparing it with examples from the Internet and it seems to be working fine, I`ve tried the write method and it`s the same.
  • #87 21048178
    hevet
    Level 16  
    Ok, because in the previous version it was commented out, but now it`s not and I thought it already worked. 🙂
  • #88 21048436
    krzbor
    Level 27  
    hevet wrote:
    @MAJSTER XXL haven`t you thought about a different wifi concept? It`s about the WifiManager library from tzapu.

    I recommend this library. I have been using it for many years and it works reliably. I published some projects on elektroda. You can see - there is a tzap library everywhere.
  • #89 21048513
    hevet
    Level 16  
    This works very well for me. I removed things from the wifi configuration and a few hundred lines of code less,
  • #90 21049403
    MAJSTER XXL
    Level 29  
    I added the WiFiManager library, removed WiFiMulti, basically added a few lines of code to the setup and now I can`t understand one thing - how is it possible that ESP32 connects via WiFi without providing the network name or password? During compilation, I changed the partition size to Huge APP because it did not fit the default partition.

    Screenshot of code in Arduino IDE for ESP32 with WiFiManager.

Topic summary

The discussion revolves around building an internet radio and audio file player using the ESP32-S3 microcontroller. The project includes features such as an OLED display, Wi-Fi connectivity, and audio playback capabilities. Users share their experiences with hardware setup, including issues with pin configurations, library compatibility, and troubleshooting compilation errors in the Arduino IDE. Suggestions for libraries, such as ESP32-audioI2S and WiFiManager, are provided to enhance functionality. Participants also discuss the importance of proper wiring, capacitor usage for encoders, and the potential for adding features like DLNA support and a web management interface for radio station management. Several users report on their progress, share code snippets, and offer solutions to common problems encountered during development.
Summary generated by the language model.
ADVERTISEMENT