logo elektroda
logo elektroda
X
logo elektroda

Internet radio and audio file player on ESP32-S3

MAJSTER XXL 101958 1236
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #211 21328338
    MAJSTER XXL
    Level 29  
    @tytka Thanks for the feedback, I just sat down today during the day to streamline a few issues and gently redesign the PCB under the v2 version for a different display, such a 3.12" 256x64px OLED, so there will be fun with that.
    I don't know when or why or what happened, but when switching stations sometimes some bits of previous screen content wouldn't erase. I've added in 2 conditions when it should expose data to the screen while it already has something to play, so that's a quick example:
    if ((currentOption == INTERNET_RADIO) && ((mp3 == true) || (flac == true) || (aac == true)))
    and actually calmed down considerably on the screen with these residues.
    As for your settings for bank and station lists from within github - for me this is ideal, this is what you do from within the browser and you can always edit it from where you want and it works out of the box because switching banks on the radio already pulls in those changes.

    The file player is a bit limp and I've left it alone for now - a lot of work needs to be done here and you probably have to do everything differently and from scratch.
    The "List of banks" menu is also a shortcut to jump immediately to a specific number, i.e. with the right encoder you select an item from the "List of banks" menu and then use the left encoder to scroll through the number of banks and confirm with this left encoder button - needs some fine-tuning.
  • ADVERTISEMENT
  • #212 21328772
    tytka
    Level 22  
    MAJSTER XXL wrote:
    What about your settings for bank and station lists from within github - for me the ideal thing, that's what you do from the browser
    .
    Still, for me personally, it's heavily tedious and inconvenient. Because why create lists on github. In my opinion, it is definitely more convenient to modify station lists directly on the radio's page, as is the case in this project: Link The radio generates its own page, you connect to it and there you make the changes you are interested in, and you also have the possibility to control the device.
    But you know, everyone has a different perspective on an aspect and likes not necessarily what others like.

    MAJSTER XXL wrote:
    The file player is a bit limp and I left it alone for now - a lot of work needs to be done here and probably everything needs to be done differently and from scratch.

    Well, with these words you have disappointed me. At this point, for me, all the brilliance has definitely dimmed. As I mentioned, for me the most important asset of your project is that there is a file player in addition to the radio. And here is your assessment.
  • #213 21328988
    gangliu2018
    Level 7  
    >>21328338
    Thank you very much for your great update. Unfortunately, my ST7565 SPI 12864 LCD is not working yet.
    I think it's great to put the radio station list on github. This is the first solution I've seen in this way!

    In addition, it feels like there are a little more buttons.
    My ideal goal is an encoder.

    1. Automatically play the radio station when the power is turned on, and rotate left and right to adjust the volume.
    2. Press the encoder briefly, the radio station list will appear, rotate to change the radio station, press or a few seconds without operation, and directly switch to the selected radio station.
    3. Press and hold for two seconds to switch to play the SD card or radio.

    How can I adapt it to other displays, such as my SPI 12864 display with ST7565 chip?

    Hinzugefügt nach 2 [Minuten]:

    >>21328988

    In addition, it would be more practical if the initial volume of each radio station could be adjusted.
    The volume of many radio stations is different, and it is a bit cumbersome to adjust the volume to the appropriate level after each channel change.

    Hinzugefügt nach 5 [Minuten]:


    The last point is buffer cache. Compared with radio stations with slow network, cache playback will provide a better experience.

    MAJSTER XXL Thank you again for bringing us such a powerful radio.
  • #214 21329513
    MAJSTER XXL
    Level 29  
    I'm just thinking to refine the V2 version of the project with operation from 2 encoders only, switching functions will be by holding the encoder button short or long. And above all I want to try on a bigger OLED 256x64 pix via SPI communication. In December I will try to work on the file player, time permitting.

    The advantage of downloading the contents of each bank with a list of links to the streams from github is undoubtedly that it saves ESP32 memory, because only one bank is stored at a time, switching banks and collecting a new list of stations takes very quickly.
  • ADVERTISEMENT
  • #215 21330734
    bolszoy
    Level 9  
    Hi. Will there be a choice with or without buttons in the v2 version ( would be great). And if there will be plates to buy I am the first. ; ) Greetings.
  • #216 21331457
    MAJSTER XXL
    Level 29  
    I connected the new 256x64 pix OLED via SPI, it works fine, you will be able to fit twice as much information on it compared to the previous one, so the v2 version of the radio will already be done on this display eventually. It works based on the U8g2lib library.

    New OLED display connected to a circuit on a desk. .
  • #217 21331788
    simw
    Level 27  
    MAJSTER XXL wrote:
    I plugged in the new 256x64 OLED
    .
    Cool. I just happen to have one, a 5 inch :) .
  • #218 21332023
    gangliu2018
    Level 7  
    Looking forward to the new version. I'm curious about the big screen product.

    Hinzugefügt nach 25 [Minuten]:

    >>21331457
    Can you add Ring buffer onV2 version to reduce the jamming of the radio?
  • ADVERTISEMENT
  • #219 21332111
    Andrzej Ch.
    Level 33  
    @MAJSTER XXL
    Could you provide a more precise model of this display?
    I am mainly concerned with the controller chip used in it.
    How many inches is your display?
    Thanks
  • #220 21332497
    gangliu2018
    Level 7  
    >>21332111
    ESP32S3 N16R8 with 8M PSRAM 16M Flash
    The new screen is SPI interface 256*64 Oled resolution
  • #221 21332656
    simw
    Level 27  
    Andrzej Ch. wrote:
    Could you please provide a more accurate model of this display?
    .
    This is probably the SSD1322 controller. On ali when you type in "oled 256 64" you can find it.
    It's interesting insofar as it provides greyscale, although I don't know if the arduino supports such a feature. Apart from that it came out in 2.8, 3.1 and 5.1 inch versions.
  • #223 21333109
    simw
    Level 27  
    MAJSTER XXL wrote:
    I haven't seen a 5" version, and I would love to buy one.
    .
    There used to be such panels and even some spectrum analysers, I think.
    Screenshot of an AliExpress webpage showing the offer for a 5.5-inch XABL OLED display module. .

    I think I found
    https://pl.aliexpress.com/item/1005006048857552.html
    They have cheapened quite a lot :) .
    Screenshot of a product: ShengYang 5.5-inch OLED display. .

    There are also 3.8 inches with higher resolution
    3.83-inch OLED display from AliExpress priced at 149.99 PLN.
  • #224 21334913
    MAJSTER XXL
    Level 29  
    @simw cool but bloody expensive those 5 inches, maybe one day.

    For the time being I'm slowly embracing the new display on the new library and as usual it's going clumsily, but I can already see something. So far without buttons, encoders and the DAC itself. I've got the first line display done with the station name, the bank number and station number is immediately in the name downloaded from github from the new bank- for the v2 version of the radio where more characters per line will be available. I managed to do a split of the long names on 3 lines of the screen with full words retained. Unfortunately the chosen font does not keep the same number of characters per line depending on the size of the letters or special characters- I have to choose a font with a fixed width for all characters.

    In the penultimate line I will add the current date and time at the end and in the last line the weather data based on openweathermap - we will see what comes out of it.

    Prototype electronic display on a wooden shelf, showing radio station information. .
    Small LED display showing the radio station name along with song and technical information. .
  • #225 21334958
    tytka
    Level 22  
    MAJSTER XXL wrote:
    cool, but damn expensive these 5 inches, maybe someday.

    Expensive because it's OLED.

    The cheaper ones are TFT. Maybe you should have been interested in one, for example:
    A screenshot of an AliExpress product page featuring a 4.0-inch TFT LCD color touchscreen priced at 66.19 PLN. .
    It would have been cheaper, and besides, "stereo and in colour". (There are libraries for Arduino for this).
  • #226 21335256
    Andrzej Ch.
    Level 33  
    >>21334958 .

    It's just that you have to play around with the graphics additionally to exploit the potential of the display, if one has the flair for it. On an OLED you run plain text and it works. In addition, you have to allocate additional memory area for graphics, which may be at the expense of functionality and future feature development.
  • #227 21335277
    ArturAVS
    Moderator
    Andrzej Ch. wrote:
    Additionally, an additional memory area must be allocated for the graphics
    .
    The vast majority of modern TFT display contolers have a corresponding RAM buffer in addition to VRAM. It is sufficient to have the icons/graphics defined and there is no need to store the entire screen content in MCU memory.
  • #228 21335481
    Damian_Max
    Level 19  
    @MAJSTER XXL Congratulations on the project, I've been watching it for a while and have it on my list to build xD.
    Personally I'm planning a slight tuning as I listen to one radio and would only be interested in the volume, no display at all. Station configuration would be nice to do via www. The build itself I would prefer on GH Actions.
    Heh, I'm not persuading you to do something like this, as I'd like to lick esp myself and if I succeed I'll share the fork, hopefully I'll find the time next year to do it xD.

    Really cool you did that!!!
  • #229 21335623
    gangliu2018
    Level 7  
    MAJSTER XXL wrote:
    @simw cool but bloody expensive those 5 inches, maybe one day.

    For the time being I'm slowly embracing the new display on the new library and as usual it's going clumsily, but I can already see something. So far without buttons, encoders and the DAC itself. I've got the first line display done with the station name, the bank number and station number is immediately in the name downloaded from github from the new bank- for the v2 version of the radio where more characters per line will be available. I managed to do a split of the long names on 3 lines of the screen with full words retained. Unfortunately the chosen font does not keep the same number of characters per line depending on the size of the letters or special characters- I have to choose a font with a fixed width for all characters.

    In the penultimate line I will add the current date and time at the end and in the last line the weather data based on openweathermap - we will see what comes out of it.

    Prototype electronic display on a wooden shelf, showing radio station information. .
    Small LED display showing the radio station name along with song and technical information. .


    This is great. I like the new features. The weather forecast and the time and date display.
  • ADVERTISEMENT
  • #230 21337515
    MAJSTER XXL
    Level 29  
    Of course, it can't be too beautiful to be too good. I've encountered a strange limitation that so far I'm not managing to grasp. Namely, when the audio file format is added to the display on line 5 along with the current time, there is a screen shutdown / or some kind of reset after which it is just black. Surely this causes the need to refresh this field from the timer every 1 second. Setting it to 2 seconds also causes the screen to blackout. Only inserting a cycle for 3 seconds somehow manages this, but without some background blanking before inserting the new timer value. I can't figure it out, and so far I've tried 2 methods, drawing a black rectangle in this selected field and inserting spaces instead of data like "MP3 11:22:33". Can anyone advise anything clever? I haven't played with this library so far, I don't know if the screen driver is not working out or what else? Generally the execution of u8g2.sendBuffer(); can be seen as a slow input of data to the screen from top to bottom- it shouldn't work like that to the naked eye. Perhaps the screen driver can't cope with such a fast refresh rate? I am attaching a video of what this looks like and the source code for v2, which is on the fly for now and there are many lines commented out.
    In the setup I have in line 1594:
    timer.attach(3, updateTimer); // Set the timer to call the updateTimer function
    and then from line 1322:
    void updateTimer()

    link to v2 code on github:
    https://github.com/sarunia/ESP32_radio_player_v2/blob/main/ESP32_radio_v2/ESP32_radio_v2.ino





    .

    Added after 2 [hours] 3 [minutes]:

    OK, I've almost got it figured out, swapping from software SPI to hardware SPI helped, the screen went right back to the correct position (previously it was flipped 180 degrees) now it refreshes every second with no reset and no screen float, just need to work out the field blanking before inserting a new value.



    .

    Added after 1 [hour] 1 [minute]: .

    After changing to a fixed-width font like this (u8g2_font_spleen6x12_mr), everything, for me, became more readable and the problems with leftover rubbish seconds on the display stopped. It is now finally as it should be and stable.



    .
  • #231 21337971
    ArturAVS
    Moderator
    Do you refresh the whole screen when changing just one element, e.g. a timer?
  • #232 21338331
    tytka
    Level 22  
    MAJSTER XXL wrote:
    Now it's finally as it should be and stable.


    I applaud that, it looks quite nice.
    (But I see you still like the basic units, without using multiple symbols.)
  • #233 21338559
    MAJSTER XXL
    Level 29  
    @ArturAVS It seems to me that the u8g2.sendBuffer() function refreshes the whole screen, i.e. spits out the contents of the buffer with the current changes. The question is how this is physically controlled by the display controller afterwards, maybe it only refreshes the changes - I don't know. Today I made a weatherman, the data is pulled from the OpenWeatherMap server from the location indicated. You have to create an account with them to generate an API number, which is then used to generate a link with the location. You then need to receive the data as JSON and format it appropriately for the terminal serial and display. For now I'm inserting 3 parameters from the weatherman, but I'll probably do a floating line with the city name and all the received data. I refresh the download from the server with a timer every 30 seconds on a trial basis- it looks promising, picture below:

    Display showing information about playing music and weather parameters. .

    Screenshot of Arduino IDE displaying code for weather display. .
  • #234 21339211
    khoam
    Level 42  
    MAJSTER XXL wrote:
    I think the u8g2.sendBuffer() function refreshes the whole screen, i.e. spits out the contents of the buffer with the current changes. The question is how this is physically controlled by the display controller afterwards, maybe it only refreshes the changes - I don't know.
    .
    To "refresh" only parts of the screen you would need to use the updateDisplayArea () function instead of sendBuffer().
  • #235 21339595
    gangliu2018
    Level 7  
    >>21338559
    It all looks great. Looking forward to the new version V2 being completed.
  • #236 21344194
    MAJSTER XXL
    Level 29  
    If anyone is interested, the v2 version can already be slowly assembled even on a simple contact or prototype board. I've made the weatherman in 3 views - it will be more stable for the moment, there is an added option to scroll and select stations from the list, as well as support for inactivity when just scrolling through the list without confirming the selection. A little bit of fine-tuning of the program is needed, but it is pretty much already working on the new OLED. The current v2 version of the radio is uploaded on github. Below is a video of how it currently looks. I plan to add support for holding down the encoder button for 3 seconds to access the bank selection menu. At the moment the encoder with the number 2 is connected.




    .
  • #237 21344582
    gangliu2018
    Level 7  
    MAJSTER XXL wrote:
    If anyone is interested, the v2 version can already be slowly assembled even on a simple contact or prototype board. I've made the weatherman in 3 views - it will be more stable for the moment, there is an added option to scroll and select stations from the list, as well as support for inactivity when just scrolling through the list without confirming the selection. A little bit of fine-tuning of the program is needed, but it is pretty much already working on the new OLED. The current v2 version of the radio is uploaded on github. Below is a video of how it currently looks. I plan to add support for holding down the encoder button for 3 seconds to access the bank selection menu. At the moment the encoder with the number 2 is connected.




    .


    Great product.

    Can it be reduced to two encoders and no buttons? This will be exactly the same as the most classic radio.

    The volume control button can be pressed for three seconds to select functions, and the channel change button can be pressed for three seconds to enter the station list.
  • #238 21344743
    gulson
    System Administrator
    The product is generating worldwide interest, congratulations!
  • #239 21348181
    MAJSTER XXL
    Level 29  
    I added the bank selection, the entrance to the function is by holding down the encoder button for 3 seconds, then using the encoder wheel you select any bank number and confirm with the encoder button. Once the station is played, using the encoder wheel you get access to a scrolling list with the content of downloaded stations from the selected bank, the currently selected station on the list is highlighted, just confirm it with the encoder button. For now I am using one encoder, the second encoder will have the same functionality as the original v1 version of the radio, i.e. station volume control and menu function switching. You could also think in the future to include one byte in the station link at a fixed position in the array and store the volume there. Then, when switching channels, the volume parameter would be automatically adjusted to equalise the level on the line input for the amplifier.



    .

    Regarding the display itself, I am attaching a wiring diagram and how it looks from both sides. Important, you need to solder a jumper to make it work in 4 SPI mode:

    LCD display with a blue background on a blue circuit board with pins on the right side. 3.12-inch OLED display module with visible connectors and components on a blue board. .
  • #240 21349759
    Andrzej Ch.
    Level 33  
    @MAJSTER XXL
    I am just finishing the V1 project and will assemble V2 later, parts should be enough. The display has already arrived from China.
    Great work. My congratulations

    @hevet
    Have you removed the modified project of colleague @MAJSTER XXL from your github?
    Can you provide a link to the source code you are using?

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