logo elektroda
logo elektroda
X
logo elektroda

Internet radio and audio file player on ESP32-S3

MAJSTER XXL 106320 1247
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #841 21466133
    Slawek K.
    Level 35  
    marek003 wrote:
    For those who want to run the project "under platformio", information that you only need to add 3 libraries to the project in the patformio.ini file (available under platformio)
    lib_deps =
    olikraus/U8g2
    tzapu/WiFiManager
    arduinogetstarted/ezButton


    Add yourself such an entry in platformio.ini:

    Code: Text
    Log in, to see the code
    .
  • ADVERTISEMENT
  • #842 21466256
    robgold
    Level 20  
    @Slawek K.

    Then give me some more hints as to what is wrong with my Platform configuration, that after adding your post I get:

    Code: C / C++
    Log in, to see the code
    .

    Interestingly, when I insert from my finger:

    [env:esp32-s3-devkitc-1]
    platform = espressif32
    board = esp32-s3-devkitc-1
    framework = arduino
    monitor_speed = 115200
    lib_extra_dirs = ~/Documents/Arduino/libraries
    lib_deps = esphome/ESP32-audioI2S@^2.0.7

    This compiles correctly after disabling VUmeter, which is not present in version 2.0.7. However, I would like to use the Audio library version 3. What am I doing wrong ?


    @DJCheester
    Of course I uploaded everything to a directory at my place but forgot to fire up the GitHub app to push it to the server ;) .

    @MAJSTER XXL I had a dilemma with these transitions because I know how much it bothers companies in Poland (they have a very calibrated process, machines). On many boards made in China there are such transitions so I decided to leave them. These two can be rearranged, the one on the TOP layer would stay unless I moved one resistor under the module and I insisted that I don't want to have any component under the ESP module or transitions under the antenna. We'll see what comes.
  • #843 21466298
    marek003
    Level 40  
    >>21466133 .
    @Sławek K, as I wrote "I can't type in the platformio.ini reference to the library with the specific, lower version of which is posted on GitHub". .

    Your proposed entry will download the latest version 3.1.0, and I meant 3.0.12e.

    @robgold
    Well, precisely the error of the library itself (inside the library).
    I downloaded the version 3.0.12 from GitHub and pasted it (after unzipping) in its entirety (the whole directory) into the "lib" directory and everything worked.
  • #844 21466381
    khoam
    Level 42  
    marek003 wrote:
    Your proposed entry downloads the latest version 3.1.0, and I meant 3.0.12e.
    .
    Small hint:
    Code: Ini
    Log in, to see the code
    .
  • #845 21466575
    marek003
    Level 40  
    khoam wrote:
    Little hint:

    :) I will say that because of this "small" hint I was already about to tear the keyboard apart :) .
    But I did learn a little.

    I was treating the # sign as a comment and looking for solutions and substituting various things (I even got the project hung up when I used the canopy sign ^ ), and here's such a hitch :)

    In this case, the following entry in platformio.ini takes care of everything :

    With specific library versions:
    Code: Text
    Log in, to see the code
    .

    All necessary libraries and the ESP32-audioI2S library version 3.0.12e (commit-hash downloads itself as you can see in the "terminal") are downloaded.
    It does not cause errors.

    With always new versions of the libraries (updated when the project is opened):
    Code: Text
    Log in, to see the code
    Code: Text
    Log in, to see the code
    .
    3.0.12 at ESP32-audioI2S I left because for now the newer one causes an error
  • #846 21466646
    Slawek K.
    Level 35  
    @khoam was faster :) .

    I've converted the code of colleague @robgold for myself on platformio, i.e. I've created a tree of encapsulated header files dividing functions and procedures into groups because I can't see everything in one arduino file and searching for anything is a pain while scrolling :) .
    Compiles correctly - I also had a problem with the latest version of the audio library, version 3.0.x sorted it out. The plus side is that it downloads the correct versions of the libraries for itself and avoids what has been scrolling through this thread in many posts, i.e. whether the Arduino version is ok, where to download the libraries from, etc. etc., leaving aside the fact that Arduino keeps all the libraries in one place without the possibility of using different versions in different projects.

    Greetings
  • #847 21466834
    simw
    Level 27  
    Slawek K. wrote:
    I have converted my colleague @robgold's code for myself into a platform
    .
    I'd love to know the results, I'm probably not the only one, because this one ino can sting the eyes too :)
  • ADVERTISEMENT
  • #848 21467362
    DJCheester
    Level 26  
    robgold wrote:
    @DJCheester
    Of course I uploaded everything to the directory at my place but forgot to fire up the GitHub app to push it to the server


    No problem tomorrow afternoon or evening I'll try to update and upload the render.

    Regards...
  • #849 21467804
    efi222
    Level 19  
    Slawek K. wrote:
    I have reworked the code of my colleague @robgold for myself on the platform, i.e. I have created a tree of encapsulated header files, dividing functions and procedures into groups because I cannot see how everything is in one Arduino file
    .
    In the Arduino IDE you can do a similar thing.
  • #850 21467832
    DJCheester
    Level 26  
    Hello I am attaching the renderings of the latest version of the PCB by colleague Robgold.

    Render of an ESP32 Web Radio PCB with attached components. .
    Render of a printed circuit board (PCB) showing traces and soldering points. .
    Render of ESP32 Web Radio PCB with various components and connectors. .
    Render of ESP32 Web Radio PCB design .
    ESP32 Web Radio PCB render with component labels. .
    Render of a green PCB with a pattern of circuit traces. .

    Greetings ...
  • #851 21467846
    MAJSTER XXL
    Level 29  
    Continued taming the OLED on SSD1363 256x128 over I2C, all init and attempted control without the U8g2 library, progress such that the initial greys turned into full brightness and normal / inverse mode switching and on and off in the main loop works, unfortunately there is still an erroneous init or control itself, hard to guess. I've gone through all the setting commands with the manual and it continues to fail:

    Code: C / C++
    Log in, to see the code
    .



    .
  • #852 21467921
    robgold
    Level 20  
    @MAJSTER XXL And have you tried sending the configuration as it is in the instructions, i.e. the first byte with D/C=0 and the following bytes with DC=1. Write such an initialisation from your finger without the function.

    (D/C# = 0, R/W#(WR#)= 0, E(RD#) = 1) unless specific setting is stated
    Single byte command (D/C# = 0), Multiple byte command (D/C# = 0 for first byte, D/C# = 1 for other bytes)

    Currently as far as I can see you are sending everything as single bytes completing the transmission.

    What version of u8g2 do you have visible in the Arduino ? Have you uploaded the test 2.36.5 correctly with support for this display ?
    Screenshot of library manager with the U8g2 library highlighted in version 2.36.5. .

    Platform: .
    If anyone wants to try it I'm uploading the platformio.ini file to compile the radio. To tell you the truth (yes I know now you're going to get thunderstruck) I don't see any major benefits of using this overlay on VS. While VS itself is OK, Platformio has a ton of shortcomings and zero friendly interface. It reminds me of when I was setting up my first Linux servers in the late 90's and was fascinated by the fiddling around with everything, configs for Apache etc. Today, I would expect at least a good GUI for the user. Especially since dinosaurs like AVR Studio or Microchip MPLab IDE had a friendlier interface.

    The current ino file is arranged in such a way that it is enough to "copy & paste" into the main.cpp file in Platformio and it compiles straight away. The USB port is set up so that any "Serial.printy" lands on the UART as in Arduino.

    platformio.ini
    Code: C / C++
    Log in, to see the code
    .

    The WiFiManager library is specially parked and I uploaded it manually to the libs directory because there is an error in it. The DNS server port address is there as a variable of type byte [byte], which the compiler does not recognise and you have to correct it manually to uint8_t. To save myself this I inserted it manually.
  • #853 21467955
    MAJSTER XXL
    Level 29  
    @robgold but the number, I figured there was nothing newer than the visible library in the Arduino IDE, and all I had to do was swap it, I didn't get that either. On the other hand, it was worth the effort to figure it out on foot, at the weekend I'll compare where I went wrong.
    Thanks a lot for pointing me in the right direction!


    OLED display showing blue text 1234567890 -- ABCDEFGH. .
  • ADVERTISEMENT
  • #854 21467969
    robgold
    Level 20  
    Glad to see it's working !!! :) .
    Do some tests how fast you can refresh the screen on i2c with this library. Post as you can my compilation for a while and tell me how the vumeter goes and the scroller. My display is just "flying" to me :) .

    Added after 1 [minute]:

    Such "dilemmas" annoy and irritate when something doesn't work but at the same time they teach the most.
  • #855 21468659
    robgold
    Level 20  
    I've uploaded an update to 3.15 on Github. Link This version has dual screen refresh disabled. I think I have 100% solved the problem of any "ghosting", "artifacts" on the OLED display. Now everything switches smoothly and without such problems. Please test and let me know if anyone has managed to catch any "bushes" on the display.
  • #856 21468811
    MAJSTER XXL
    Level 29  
    @robgold so far I uploaded this from you on the fly and it's a tragedy, the audio cuts impossibly, the screen refresh rate is completely unacceptable, even on the serial the loading went like a thousand times too slow. I've uploaded what I have to my profile under my next version, but for now I don't have much time to fiddle with it:
    https://github.com/sarunia/ESP32_internet_rad...internet_radio_v3/ESP32_internet_radio_v3.ino

    this is what the timing looks like even while loading the station:
    Code: C / C++
    Log in, to see the code
    .

    and yes video, even the second hand does not go smoothly:

    bb1fe8aac .

    I will immediately check on my version on a more static screen operation.
  • #857 21468834
    hevet
    Level 16  
    @MAJSTER XXL at my place nothing like that happens. The stations run smoothly, robgold even turned on the vumeter on the FLAC stations and here there is not even any clipping.

    @robgold I see one problem, exactly with banks 15 and 16. When I turn on the station list on these banks only the first digit of the station number is visible. With stations 1 to 9 it is known to be fine, but stations e.g. from number 11 to 19 have the number 1. I upload pictures to illustrate

    Display showing a list of radio stations with incorrectly displayed station numbers. .
  • #858 21468852
    MAJSTER XXL
    Level 29  
    @hevet not the point, as I'm testing a brand new display with 2x the vertical resolution.

    On my let's say more static softy it's much better but not perfect, screen refresh rate very poor, but already at least the audio doesn't stutter, stations loaded as fast as they should:

    Code: C / C++
    Log in, to see the code
    .

    I'll sit on it a bit at the weekend, maybe something will clear up, but I'm definitely doing some sort of double screen refresh due to that earlier rubbish appearing and that may be making it look bad too:



    .
  • #859 21468858
    hevet
    Level 16  
    @MAJSTER XXL well yes, I hadn't noticed 😆
  • #860 21469076
    MAJSTER XXL
    Level 29  
    Generally, I don't recommend the display on the I2C bus, it can't run faster than 400kHz, and that's not much compared to SPI, and somehow its brightness is not that impressive, probably also due to quite small pixels. I will still order the same one on SPI for a test, but I wouldn't expect any cool fluidity there, let's hope I'm wrong....
    @robgold when do you expect your screen and of course will you have one after SPI? I unfortunately clicked something when adding to the cart and not knowing why it went on I2C, well at least battle tested though....
    I set it to display 9 lines at once
    int maxVisibleLines = 9; // Maximum number of visible lines on the OLED screen
    But handling this scrolling is a pain, sadly.
  • #861 21469126
    robgold
    Level 20  
    @MAJSTER XXL I was just about to write if you set Wire.setClock(400000); and tried to crank it up to 1MHz Wire.setClock(1000000); but as I understand you already tried. I remember when I lowered the SPI to 500k it was terribly slow even loading the station was much slower because the progress bar had to be refreshed. My display has arrived at the airport in China and is awaiting transit so I assume it will arrive after the weekend.

    @hevet The problem has been since the bank update with banks >9 and stations >9, I misgenerated the files. I have discussed this with Majster before. Download yourself banks 10-16 again from GitHub -> i.e. do a "network update". It should be OK.
  • ADVERTISEMENT
  • #862 21469130
    hevet
    Level 16  
    I have just done an update and nothing changes.
  • #863 21469148
    robgold
    Level 20  
    @hevet, are you sure you did the update from the web ? Do it again. Before I upload something to GitHub I test it at home. I don't want to write the classic "weird, it works for me" but that's exactly what it is :) .

    Display showing a list of radio stations.
  • #864 21469175
    MAJSTER XXL
    Level 29  
    @robgold of course I tried, according to the manual the minimum clock cycle of the i2c bus is 2.5us, that is a setup for 400kHz, it looks like it doesn't accept more than that anyway, I'll check with the analyser later, because even setting it to 4MHz doesn't change anything, everything is muddled by this, the whole radio control operation....


    Table showing I²C interface timing parameters, including symbols, parameter names, minimum, typical, maximum values, and units. .
  • #865 21469188
    robgold
    Level 20  
    @MAJSTER XXL, convert this display piece to SPI and problem solved. It's a shame to pay for another one and they are not cheap. Two thin wires nicely done and flooded with UV mask should not disturb your aesthetics.

    Added after 3 [minutes]: .

    And such another note have you tried "Wire.setClock( 400000UL); with that UL at the end (what Unisigned Long) because I don't know if the Arduino doesn't read it like an Integer and still sets you 100k by omitting that parameter.
  • #866 21469197
    hevet
    Level 16  
    @robgold the problem only occurs on banks 15 and 16, the others from 1 to 14 are ok.
  • #867 21469256
    robgold
    Level 20  
    Bank 15 is OK. In Bank 16, I changed the names a bit because unfortunately, when copying the names, characters outside the ASCII range were copied and it was a bit off. Check now.
  • #869 21469805
    CodeBoy
    Level 33  
    Someone on the Sony forum showed off such a conversion, and I have to say it's impressive.

    Here is a description from the user
    "I would like to share my humble opinion after a week of using the Sony DAR1000ES SAT tuner modified for internet radio by Marcin Pakuła.
    The whole modification is based on the factory DAC installed in the sat tuner. The DAC is of very good quality so it was a shame to throw it away. Only the necessary modules are added. Everything nicely and neatly mounted, I would say better than factory 😃.
    It works stably, without lag, provided that you use the radio stations that transmit at a higher birate. I often get lag on black metal stations (approx. 60kbps - so not great).
    With stations from 128kbps and above I have not had any problems. Of course, everything also depends on the wifi range (the tuner is connected to the internet via wifi). The wifi range is visible on the front panel of the DAR1000. A larger antenna can be used, which is attached to the rear of the tuner.
    Control is by means of buttons on the front panel, the original RM-D1000 remote control, a universal remote control application on a phone/tablet, or an application written by Marcin especially for this purpose. In the application, we can search for stations, save them to our own list, which we can then modify and finally save in the tuner's memory and as a file (copy) on our computer. Marcin modifies the applications on the fly, if he notices that something works unstable/problematic. In general, we worked together on the app and everything that had any problems was fixed. All software is stable and works without any problems. Marcin Pakuła is a very nice man and patiently answers questions and guides you "by the hand" if someone has problems with the installation. The software in the tuner is written in such a way that it tells you on the screen what to do during installation.
    The stations have "rds" which means they display information about the current station and the currently playing song.
    This is my second DAR1000ES after modification. The first one is made into a spectrum analyser. The one with the internet radio tuner is a very interesting solution and I will say honestly that I am listening to the radio again 😃.
    About the modification itself. The DAR1000ES tuner of course you have to have your own. You send it to Martin and he takes care of the rest. All enquiries regarding price, deadlines and technical matters should be directed to Marcin.
    I for my part highly recommend Marcin himself as well as his modifications."


    Interior of a modified Sony DAR1000ES SAT tuner with additional modules. .
    Motherboard of the SAT tuner Sony DAR1000ES with an installed additional module. .
    Modified Sony DAR1000ES SAT tuner with a display showing text. .
    Close-up of the rear section of a Sony DAR1000ES tuner with an additional WiFi antenna. .

    As far as I am concerned, a cool idea without "destroying" the original too much.
    It is known that we have the DAC at home, I am more concerned about using the original display :) .
  • #870 21470056
    wirbud
    Level 13  
    Latest version 3.15 - sometimes with screen cleaning there is rubbish. When I move the volume, returning the screen is OK. I get a lot less hangs. I have the impression that my display is not ok. With ESP32 yoradio works. On ESP32S3 yoradio doesn't work - effects like on Majster's old library. On the forum radio (ver. 3.14 or 15 in the screen rather works correctly.... unless it is the screen that causes such hangs, lack of refresh or pendency.
    I only have the 2nd encoder - the first one is defined by definition:

    // Encoder 1 - grounded for the player
    #define CLK_PIN1 -1 //6 // Connection from pin 6 to CLK on right encoder
    #define DT_PIN1 -1 //5 // Connection from pin 5 to DT on right encoder
    #define SW_PIN1 1 //4 // Connection from pin 4 to SW on right encoder (button)
    // encoder 2 - used for radio
    // swap pins for 2 for convenience as pins are next to each other
    #define CLK_PIN2 6 // Connection from pin 6 to CLK on right encoder
    #define DT_PIN2 5 // Connection from pin 5 to DT on right encoder
    #define SW_PIN2 4 // Connection from pin 4 to SW on a right-hand encoder (button)

    Station numbers on bank 16 I only have the tens digit visible. How does it connect from the network? Via WEB?
    Radio display with ESP32 player and electronic components. .

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