logo elektroda
logo elektroda
X
logo elektroda

Internet radio and audio file player on ESP32-S3

MAJSTER XXL 101439 1232
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #961 21485132
    DJCheester
    Level 26  
    I ended up with a faulty one, after attaching the wifi antenna from an old tablet it works just fine, it was just without the logo and bought in Poland, then I ordered two units with the logo from Aloexpress and they work fine as far as the range is concerned.

    Best regards...
  • ADVERTISEMENT
  • #962 21485285
    robgold
    Level 20  
    @Sharki38 Buy any ESP32-S3. It's a lottery what you will end up with. You can buy one with an antenna output at MSALAMON Link but it's almost 100£. Cheaper is "Chinese" and if there are problems you can add a cable with the old antenna from the router, or if you have a HotAir station you can replace the module with the original with antenna output from TME (I did that). It still works out cheaper than the 100zł.

    To assemble the radio at the moment with Evo 3.16 software, you don't really need anything except the PCM module and ESP32. You can start the radio by downloading stations from GitHub, and you can control it via a web page by opening the IP address that the module writes on the terminal during startup.

    Added after 2 [hours] 5 [minutes]: .

    Update EVO 3.16 .
    I've uploaded the update to evo 3.16 on GitHub - Link

    - I've improved the encoder definitions - from now on they don't have to be disabled in the code if they are unconnected. We simply do not physically connect them

    - I have added options to the Recovery mode (enter by holding encoder 2 down and power on) to enable the WiFi Manager portal.
    Connecting to the wifi network: "ESP-radio" and going to 192.168.4.1, under the "Update" tab, we can upload updates without compiling code, running the Arduino. The progress of the update is shown on the OLED display. The bin file needed for the update is on GitHub.

    - The web server has been changed and now runs on the async library. When the radio page is turned on, the volume slider, the bank selection buttons with the currently playing bank and the station list appear. Clicking on the selected station or bank button switches the radio to that bank/station respectively. The page has such a narrow "bar" character because its main role is to open correctly on the phone. This allows you to control the radio from around the house.

    - For those who build their own memory banks, there is an option to quickly check a given stream address on the radio itself.
    In your browser, type in: http://ADRES IP RADIO/update?url=STATION STREAM ADDRESS
    In my case, when the radio got the IP 192.168.1.182, opening the address: http://192.168.1.182/update?url=http://s0.radiohost.pl:8018/stream
    will switch to the stream address of the Italo4You radio, the bank will take the value 0, the station 00.

    The new web server and encoder configuration allows you to build the radio with just the ESP module and the PCM decoder. You can control it with your phone. Of course, without an SD card apart from the station, bank and volume no configuration will be kept and the banks with station list will always be downloaded from the GitHub server but this gives you the opportunity to test and play around.

    Probably, there are still a lot of shortcomings but I count on your tests :) .

    This is what the new radio page looks like on the phone:
    ESP32 Web Radio webpage on smartphone. .

    Recovery mode during OTA update via WiFi manager web page:
    Recovery mode during OTA update on an ESP radio's OLED display. .
  • #963 21485569
    hevet
    Level 16  
    @robgold Trying to compile new version on VSCode-Platformio, but two errors pop up;

    'handlePreOtaUpdateCallback' was not declared in this scope
    'clearFlags' was not declared in this scope

    Which versions of the ESPAsyncWebServer and AsyncTCP libraries did you use?
  • #964 21485663
    robgold
    Level 20  
    That is, you have to swap the order of the functions in the main.cpp file or ino. I haven't checked this on Platformio yet. I'll check and upload an update.

    Added after 17 [minutes]: .

    Corrected, I put the main.cpp and ini file into a separate directory. Checked it compiles correctly.

    Async 3.6.0 (it's in the ini file on GitHub)
    Async TCP 3.3.2

    also compiles correctly with the following versions:

    lib_deps =
    ESP32Async/ESPAsyncWebServer @3.7.2
    ESP32Async/AsyncTCP @3.3.6
  • #965 21485768
    hevet
    Level 16  
    Ok, it works.
    On a suggestion, currently there is no option to disable auto dimming, if this is gone, is there still a point to the full brightness - 1/16th brightness button? If this possibility returns then I guess there is no point in keeping this button anyway? This is just my suggestion, but perhaps you are planning some more changes in this direction.
  • #966 21485940
    robgold
    Level 20  
    I have a plan for the future on how to solve this. Currently, automatic dimming can be manually disabled by changing the variable before compilation:

    Code: C / C++
    Log in, to see the code
    .
    to
    Code: C / C++
    Log in, to see the code
    .
  • ADVERTISEMENT
  • #967 21486018
    hevet
    Level 16  
    Thanks, I've made myself turn auto dimming off and on under the red key for now and saving the value to a file on the SD card, but I'm waiting to see what interesting things you come up with :) .
    Radio interface a big plus.
  • #968 21486726
    DJCheester
    Level 26  
    Hello

    I wanted to upload my colleague Robgold's latest software today and here is such an error during compilation (Arduino 1.8.19 win7 32bit ESP2.0.17)


    Code: Text
    Log in, to see the code
    .

    Screenshot of Arduino IDE with a compilation error on Windows 7. .

    Where to download the missing libraries from?

    Greetings ...
  • #970 21486978
    DJCheester
    Level 26  
    Thanks to hevet compiled works ;) .
  • ADVERTISEMENT
  • #971 21487096
    walus14041
    Level 5  
    Please help me with the pin description for esp32s3 wrom1 the touch does not work and displays the image strangely thank you in advance
    Close-up of an electronic board with wire connections and labeled pins.
    LCD display connected to an ESP32S3 module with wires on a fabric background.
  • #972 21487116
    hevet
    Level 16  
    @walus14041 but it's probably not the radio. What are you uploading, what is the display?
  • #974 21487142
    hevet
    Level 16  
    https://github.com/schreibfaul1/ESP32-MiniWeb...b/master/docs/MWR_V3.4_ESP32-S3_schematic.jpg here is a diagram of how to combine this. In the common.h file you have to change the values like this:
    #define _SSID                   "mySSID"                        // Your WiFi credentials here
    #define _PW                     "myWiFiPassword"                // Or in textfile on SD-card
    #define DECODER                 1                               // (1)MAX98357A PCM5102A CS4344... (2)AC101, (3)ES8388
    #define TFT_CONTROLLER          0                               // (0)ILI9341, (1)HX8347D, (2)ILI9486a, (3)ILI9486b, (4)ILI9488, (5)ST7796, (6)ST7796RPI
    #define DISPLAY_INVERSION       0                               // (0) off (1) on
    #define TFT_ROTATION            3                               // 1 or 3 (landscape)
    #define TFT_FREQUENCY           40000000                        // 80000000, 40000000, 27000000, 20000000, 10000000
    #define TP_VERSION              0                               // (0)ILI9341, (1)ILI9341RPI, (2)HX8347D, (3)ILI9486, (4)ILI9488, (5)ST7796, (3)ST7796RPI
    #define TP_ROTATION             3                               // 1 or 3 (landscape)
    #define TP_H_MIRROR             1                               // (0) default, (1) mirror up <-> down
    #define TP_V_MIRROR             1                               // (0) default, (1) mittor left <-> right
    #define I2S_COMM_FMT            0                               // (0) MAX98357A PCM5102A CS4344, (1) LSBJ (Least Significant Bit Justified format) PT8211
    #define SDMMC_FREQUENCY         80000000                        // 80000000 or 40000000 MHz
    #define FTP_USERNAME            "esp32"                         // user and pw in FTP Client
    #define FTP_PASSWORD            "esp32"
    #define CONN_TIMEOUT            2500                            // unencrypted connection timeout in ms (http://...)
    #define CONN_TIMEOUT_SSL        3500                            // encrypted connection timeout in ms (https://...)
    #define WIFI_TX_POWER           5                               // 2 ... 21 (dBm) Adjust the WiFi transmission power to optimise power consumption or increase range, default: 5
    
    .

    Also, you won't run the radio without the card and the appropriate files uploaded to it.
  • #975 21487149
    walus14041
    Level 5  
    >>21487142 I have only seen I don't have such pins on the display how would you help me and describe what pin where to solder thank you very much in advance
  • #976 21487160
    hevet
    Level 16  
    If you have an image on the display then you are well connected, unless you are more concerned with touch? The pins pretty much coincide in name with those on the schematic, I have such a display myself, only that it is 2.8 inches.
    For the touch you have to ADDITIONALLY connect the pins TP_DIN with TFT_SCK and TP_CLK with TFT_SCK.
  • #977 21487224
    DJCheester
    Level 26  
    Hello first impressions of the 3.16 soft.
    No artefacts on the display
    Good time display.
    Well, and one problem it doesn't save the volume I turn off on say 5 and it always starts up with 3 I don't have the encoders connected and I didn't declare the DT and CLK pins to -1 in the software but I read earlier that my colleague Robgold corrected this programmatically.

    Tomorrow I'll hook up the serial monitor via the Arduino IDE for half a day and see if anything happens there.

    Regards...
  • #978 21487237
    hevet
    Level 16  
    I have encoders hooked up and in my case, whether I change the volume from the remote control or the encoder, it saves and reads the volume correctly.
  • #979 21487347
    robgold
    Level 20  
    @DJCheester
    Saving the volume to the SD card or EEPROM is only done when the adjustment menu (volume bar) itself disappears after about 4 sec. If you go back with the "back" button the function will not save anything. You can see the following information in the terminal when writing. Check, maybe there is a problem with the card reader.

    Code: C / C++
    Log in, to see the code
    .
  • #980 21487413
    DJCheester
    Level 26  
    Ok thanks this afternoon I will run the radio with the serial monitor. I will let you know. Regards and thanks....
  • ADVERTISEMENT
  • #981 21488180
    DJCheester
    Level 26  
    Hello

    The radio works under serial monitor, without encoders - I didn't change anything in the software declaration after uploading it actually stores the value on the SD card but after restarting it goes down two points - below serial monitor from two runs.

    Code: Text
    Log in, to see the code
    .

    When I declared the DT and CLK encoders at "-1" SW I left it as it was
    The problem does not occur so clearly something still missing encoder is affecting this dimming.

    Code: Text
    Log in, to see the code
    .

    Greetings ....
  • #982 21488322
    robgold
    Level 20  
    I did a simple test at my place, changed the volume value, waited for information on the terminal about writing. I cut the power and the reading is correct. I did the same thing without turning off the power and doing a reset - the reading is also correct. I used the same values of 1 and 3 for the test. Declaring the encoders to -1 will "spill" errors on the "debug" terminal because it means declaring a value of 255.

    Tell me how you check what level is written and what is read ? Only on the terminal ? You don't happen to have the radio's website open somewhere during this test ?

    Change everything back to the correct values of the encoder declarations, and finger-pick the pins from the encoder that is unconnected. NOTHING should change. With the wrong declaration, connecting away you will see that the module changes the volume on the display.
  • #983 21488352
    DJCheester
    Level 26  
    I haven't opened the radio page yet. I'll see tomorrow as you write but as for me debug on the terminal doesn't bother me at all. But I will check tomorrow what you provide.

    As you looked on the log after start up immediately there is a volume change of 4 then 3 one under the other entry after that it is fine and I checked that if I give 10 volume and turn off it fires up with a value of 8 after 6 again so clearly some two pulses are going.

    I will see tomorrow.

    Regards...
  • #984 21488356
    robgold
    Level 20  
    And you don't have those capacitors and resistors on your PCB soldered there ? I suspect that you have 33nF soldered in lines A and B of the encoder and when they are "empty" they make a short circuit to GND on us which causes an impulse as if the encoder wanted to turn down the radio. when they are charged after a fraction of a second this problem no longer exists.
  • #985 21488359
    DJCheester
    Level 26  
    I don't have any resistors, I only have capacitors to ground from the CLK and DT pins, do you think they generate something at the start because afterwards they don't just start ?

    Greetings ...
  • #986 21488363
    robgold
    Level 20  
    Exactly right. A capacitor is short-circuited when it is uncharged.
  • #987 21488366
    DJCheester
    Level 26  
    So you have to get rid of the PCB capacitors of those 33nF ?

    I will see tomorrow without capacitors, regards....
  • #988 21488372
    robgold
    Level 20  
    Yes, they should be on the encoder PCB. I left a place for them on my PCB just in case I use the encoder itself, but correctly they should be as close as possible to the place where the "pins" are created, i.e. at the encoder itself. If you unplug the encoder then these lines are unconnected. The only thing that may remain is a 100nF capacitor between 3.3V and GND for the encoder power supply line.


    I'll upload a slight "tuning" today for Evo 3.16 on GitHub
    I've done the detection on what we open the page on, and for the computer it generates 4 tables to be able to select stations and bank faster without scrolling. For full HD monitors this fits on one screen. In addition, upload the contents of the "SD content" directory to your SD card. There are two icon images there. This way, the radio now has a radio icon in the browser. In addition, making a shortcut in Android or Apple will get the radio icon on the screen.

    I would like to remind you that it is not necessary to compile the ino file. If you already have 3.16, you can do an OTA update in "Recovery" mode.

    Green radio icon with antenna. .
    Web interface for selecting radio stations with a channel list and volume slider.
  • #989 21488381
    DJCheester
    Level 26  
    Well I already know the cause, thanks a lot 😀
  • #990 21488507
    hevet
    Level 16  
    @robgold I uploaded the last update, I found one bug. After changing the bank, either after reading from the SD card or after updating the list from the github server, the radio stays on the station from the previous bank only that the name disappears, only changing the station refreshes the bank.
    Additionally, when a bank has less than 99 stations, an additional station is added to the end of the bank in the radio interface, even though it is not on the github list.

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