logo elektroda
logo elektroda
X
logo elektroda

Internet radio and audio file player on ESP32-S3

MAJSTER XXL 100722 1227
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #361 21391680
    robgold
    Level 20  
    If you want a minimum of signal separation to be maintained (if at all possible when building with "Arduino-lego" bricks) then you should have 2 layers with the ground poured.

    The displays can be plugged into the same connector, they have a 4-pin SPI. However, the smaller one is based on a different driver. Requires recompilation of the code.

    The power supply needs to be built from scratch with a minimum of filtering (you have on my schematic - 1nF, 10nF, 100nF plus electrolyte). The USB connector on the ESP board allows you to power the whole thing but the Chinese boards have absolutely no filtering or any ESD protection. Just adding a USB socket in my opinion is definitely not enough.
  • ADVERTISEMENT
  • #362 21391723
    DJCheester
    Level 26  
    Acha that is, you can give two connectors to oleds but the software must be compiled separately and uploaded each time you change it.
    But it is a detail of the radio, which is known to be done once and not every 5 minutes to replace the displays.

    The issue of power supply is a full agreement and I certainly planned capacitors.

    Here, with sandwich mounting, will interference affect so much? I've seen how these radios on contacts played, so it should be on PCB.

    In my opinion, the paths are relatively short and it should be ok without additional masses and polygons, but maybe I'm wrong, moreover, there are no polygons in the author's case either.

    Wifi signals and the whole CPU is on ESP the rest is peripherals such as OLED i2s communication for digital audio and basically the rest is less significant signals such as card or encoders.

    But maybe I'm wrong, we'll see what I draw I'll show you and we'll correct this and that together.

    Regards...
  • ADVERTISEMENT
  • #363 21391763
    robgold
    Level 20  
    Then turn off the stream for a while, crank the amp up to maximum and listen to how it all "plays" nicely :) I'm far from an audiophile, especially as I don't expect miracles even though the PCM itself has a good performance but still it's good to at least put the power supply together properly. Of course, on a spider it works too. But I can see, and hear, that a bit of knowledge of electronics and EMC compatibility can be put into it.

    I don't really understand why you necessarily want two connectors for OLEDs ?
  • #364 21391824
    wirbud
    Level 13  
    TWO words about power supply - anything in audio - the purity of the current and its quality is absolutely paramount in terms of sound quality. The simplest analogy is the quality, purity or even the taste of the water in which we brew tea, coffee or drink something stronger..... What source such a drink.

    Gentlemen - I would very much like to try SPDIF.... I've already written about it but you recommend the WM8805 board - it's a hardware solution and probably a good one.
    But maybe it doesn't make sense with AAC 192 (although there are a few stations even with FLAC) where the hardware has a right to play "well"....
    I'm expecting a package from ali tomorrow with modules and OLED for this project. I can't compile anything on my comp because I messed up Python with something....
    "Error loading Python lib '/var/folders/z3/8xznzgws4mj69vhn2ndjj_8w0000gn/T/_MEIUJEr5E/libpython3.8.dylib'"

    Well, and disaster. I know - there are bins so with hardware compatibility I will embrace the topic - but without SPDIF.

    Based on this project, could someone compile me a project of a radio with SPDIF decoding inside ESP32 ? I would be very grateful. If the result is poor then I will let go of the idea of an "audiophile somewhat version of a net radio and focus on DAB+". The drivers' radio is really great on the air!

    Thanks

    this is the project - https://github.com/Edzelf/ESP32Radio-V2/tree/main
  • #365 21392076
    DJCheester
    Level 26  
    Hello for the versatility of PCBs but this is just a figment of my imagination.

    I started comparing materials - on the author's PCB the OLED is connected to different ESP32 pins than on yours ?

    Did you change this during the modification and the current softy supports these changes ?

    On the author's there were pins 3,46, 8,9 and on yours it is from 38 to 42 ??

    As for the connectors for the OLED for the time being I put this 2x8 pin under the 3 inch screen


    Pin diagram with function description and numbers. .

    Greetings ...

    Added after 1 [hours] 11 [minutes]:

    Hello, for now a sketch of a single sided PCB without polygons - for now there are connections and this to check I will sit down when there will be a moment again - through-hole components, I have added a PAM8403 2x3W amplifier module with speaker outputs so that the radio can be used on its own 5V amplifier power supply next to it I will add some more filter capacitors. the main filtration is designed for ESP as well as a 4-pin small PCB with a USB power socket

    I made the PCB for now, first version, it is possible that there are some mistakes, I will just check it.

    On the PCB

    2x5pin connectors from two encoders
    1x5pin connector from directional buttons
    IDC16pin - for the OLED display (I have given up on one connector for now)
    6-pin - memory card module
    4-pin - under ESP power socket module
    2x chinch - audio output
    2x2pin - added 2x3W amplifier and speaker output
    That's it


    Single-sided PCB design with various trace connections. .


    Greetings ..,

    Added after 1 [hour] 56 [minutes]:

    Board more roughly embraced from colleague's schematic, added 2x3W PAM8403 amplifier in Chinese version and two capacitors at the amplifier.

    As for the software is there the possibility of programo vol+/- ? because this would take care of the radio as a standalone device, for example after adding the speakers it would function as a kitchen radio.

    The board after my inspection - I will still check the connections tomorrow at ease (with a fresh mind) and when the modules arrive I will check the pin spacing so that everything fits.

    PCB schematic with circuit paths and connectors. .

    I'll do the board, we'll see maybe there won't be too much interference (I'm not an audiophile and for me it will be important how it already plays and receives)

    The board virtually looks like this

    View of a single-sided PCB with various electronic components.

    Where the horizontal gold pins are, there will be a USB socket (4-pin) and a memory card socket (6-pin)

    For my purposes I will make a single sided PCB looking like this

    Single-sided PCB with numerous tracks and mounting holes, viewed from an angle. .

    Alternatively, you will be able to order for yourself in China with polygon


    View of a single-layer PCB with yellow mounting standoffs

    That's the end of the work for today, I'm waiting for the modules I will verify the pin spacing before etching and the correctness of the paths tomorrow.

    Greetings ...
  • #366 21392530
    robgold
    Level 20  
    Mate, sure on what you proposed this radio will "somehow" play but this board breaks all PCB design standards.

    I hope you won't be offended if I leave a few comments:
    - reseller capacitors are scattered all over the PCB and not at the power supply pins
    - wrong connection of capacitors on the 5V line - go ALWAYS through the capacitor then to the power supply of the circuit (amplifier and ceramic at the bottom)
    - try to keep the line length of the interfaces even, be it SPI or I2S. The 10 Ohm resistors should be as close as possible to the display connector
    - do not route the paths under the WiFi antenna. This area should be completely outlined as a "KeepOutArea" in Eagel. you will have problems catching WiFi networks
    - no filter capacitors at the 3.3V power supply output
    - components under the ESP module - they should not be there
    -electrolytic capacitors - top right corner of PCB - see point one - they do nothing when connected this way (far from the power source), you enter the power supply on the board and first connect the capacitors and only from them you get power to the ESP, DAC, OLED, Amplifier etc.
    - You do not route the paths at 90st. - risk of etching such a path
    - The 33nF capacitors should be close to the encoder connectors and preferably soldered as SMD at the encoders themselves. This is to eliminate "pins".

    As for the question about connecting the OLED, I do not know how it is on the PCB MajstraXXL. Perhaps its PCB is still under the v1 version of the radio and the display was plugged into the i2c bus.
    In the current version with the OLED SPI we plug into the SPI hardware interface. You have the schematic here: Link .
  • #367 21392621
    CodeBoy
    Level 33  
    Hi. I also have a question if it would be possible to add a clock to this radio, to be more precise I mean an alarm clock which would wake up the radio. This is how I have an analogue radio now. I must admit that for me it would be a nice addition to this project. But unfortunately I do not have the knowledge to add it;) .
  • #368 21392711
    DJCheester
    Level 26  
    Hello no offence 😀

    Comments welcome.

    Under the antenna it actually needs to be changed because I didn't think, as for other things like capacitors I'll think about it this is the first version of the PCB.

    I made radios in the past but FM and am and there actually everything mattered.

    Here the circuits in cz are only on the ESP module the rest is already digital bus speeds there are some but with e.g. I2C in Arduino it didn't matter so much here i2s, OLED etc.

    Rather, these ready-made PCM or ESP modules probably already have some filtering circuits so I wouldn't worry so much about it.

    I will remove the components from under the ESP module from under the antenna, but from the socket side I don't think they pose much of a problem.

    I'm designing the board so that it will play, a digital signal, so I wouldn't expect any significant deterioration in quality here, maybe some hums and squeaks, but I've already got used to that when listening to current Chinese products.

    It played on people's contacts without any capacitor.

    I will take a fresh look at these comments possibly tomorrow.

    Now yes is the diagram you attached correct ie pins ? LCD ESP ?

    Does the radio implement volume by software ?


    And of such useful things it would be worth thinking if it is to be pro equipment, some kind of standby button (there are nice metal ones with LED backlighting) could be added to the PCB

    Add a standby option, e.g. a clock on off or a longer hold to switch off completely.

    A date watch would be nice for the kitchen.
    I am still thinking about using the radio as a kitchen radio, so I am designing and proposing changes from this angle.

    And options, if it is possible to make several sound presets in software, like in rock, party, classic, dance loudness etc. switched from the encoder.

    These are my suggestions, and the possible issue mentioned by Cideboy, which is an alarm clock as an option.

    Greetings ...

    Added after 18 [minutes]:

    Listen and such a TV would work with this radio ?

    https://pl.aliexpress.com/item/1005006861743547.html

    I'm already a retiree when it comes to electronics so I'd love a screen like this.

    What do you think and would it work without software modifications?

    Best regards...
  • #369 21393178
    robgold
    Level 20  
    The fact that you are retired from electronics is no excuse :) All the more reason for you to foster, as we say in the company, "technical culture" at a high level. Especially since Elektroda has an educational value for many young art students. Then such "sultanas" come to work and claim that you don't need this one, and you don't need that one either ... because somehow it worked on the "contactor" desk ;) .

    It's not like I just threw some capacitors on the schematic, just anywhere and it doesn't matter if they are there or not. Yes, we are not designing an FM radio, you won't switch an intermediate if you are missing a few pF. But the ESP itself runs at 240MHz, on top of that the development board is not designed to run on every possible circuit. When writing the software it is powered from a fairly well (surprisingly) filtered USB port on the computer. However, later on if it is used in a finished device you need to take care of that level of various harmonics coming from, for example, a USB charger. You have to make the device so that your circuit works, but also so that your neighbour upstairs can listen to the FM or AM radio in peace. In other words, you need to take care of power supply filtering, radiated emissions, immunity ...in short EMC :) .

    I assure you that you can cut out all the passive components I threw in and the circuit will work. What we care about, however, is that it works well. If, for example, such an electrolytic capacitor as a "storage" lies far from a circuit that has a pulsed nature of current draw (e.g. an amplifier) then you might as well not install it.

    To answer your questions:
    - A 5.5 inch display on an SSD1322 will work. It is the same controller. Only the price is a deterrent, but if one is better for you go ahead and use it.
    - The diagram I have attached should reflect the configurations in the softy:

    // pin definition for the OLED display
    #define SPI_MOSI_OLED 39 // MOSI pin (Master Out Slave In) for the SPI OLED interface
    #define SPI_MISO_OLED 0 // MISO pin (Master In Slave Out) none for OLED display
    #define SPI_SCK_OLED 38 // SCK (Serial Clock) pin for SPI OLED interface
    #define CS_OLED 42 // CS (Chip Select) pin for OLED interface
    #define DC_OLED 40 // DC (Data/Command) pin for OLED interface
    #define RESET_OLED 41 // Reset pin for the OLED interface

    Looking at it quickly it seems to me that this is the case. We are working on GPIO port numbers not PIN numbering.

    - There are no standby power modes implemented at the moment.
    - Equalizer will probably appear in the future. Perhaps not as ready-made 'presets' but a setting of three Hi-Mid-Low filters. I'll have a moment to add it.
  • ADVERTISEMENT
  • #370 21393217
    DJCheester
    Level 26  
    Hey thanks for the clarification, from the point of view of new digital electronics you are right I was making and creating retro tube transistors digital and 8-bit processors up to say 20MHz.

    30+ years now in electronics, I'm generally over the last project I did, and I wasn't supposed to touch it anymore.
    I once said to myself, if I can't see the electronic components, I'm done, and that's what happened.

    If it wasn't for a project for a mate who cared a lot about it, I wouldn't have taken it on.

    Maybe PCBs and solutions, i.e. monolayers and thick cloths, are a relic of the past, as young people say nowadays everything is done differently, everything is ordered in China and it is good to use such solutions as much as possible.

    So, for me, the elements on the PCB will remain as far as possible, I will take into account your suggestions, the project is still in the design phase so a lot can be done.

    I will post the Eagle files of the board only after I etch and run and if someone wants to do it, and if not you can always order a professional PCB like you do from china and solder.

    So you can count on EQ in the future from the software side.

    Please think about standby mode additional switch (you could give such a pin already on the PCB and the second pin responsible for illumination of the button).

    As far as the code is concerned, unfortunately I have never written anything in ESP, only Arduino and simple programs so I can't do anything myself, but the issue of standby mode and the clock which can be downloaded from the net seems to be a software solution only. This used to be done with a battery and an RTC chip, but now we have a network.

    I don't have a casing, but my friends have 3D printers and if someone made a project of such a casing, it would be a 100% success that the radio was created on the forum. As they say "Made in Elektroda".

    Greetings and all the best....
  • #371 21393243
    robgold
    Level 20  
    I am not creating a professional PCB. I am very far from the professional skills of a PCB design engineer. Such people take years of training and thousands of designed circuits. I'm just trying to approach the subject as correctly as possible.

    The 3D printing case is available from me on GitHub. The back is missing because I'm working on it but the front and profile is already available -> Link .
  • #372 21393594
    gangliu2018
    Level 7  
    >>21392530 >>21393243
    robgold,
    I appreciate your solution. I am very happy with the single button operation.

    Can you remove the SD card? I don't play audio files anyway. It can just connect to github every time。

    Without an SD card, DIY will reduce a lot of things.
  • #373 21394257
    robgold
    Level 20  
    Unfortunately, the radio will not work without an SD card. It holds the station banks with the URLs. Of course it is possible to make such a compilation, but then everyone will have to have their own place on the network where they will keep the banks or listen to what MajsterXXL or I will make available on GitHub as a list of stations :) .
  • ADVERTISEMENT
  • #374 21395090
    gangliu2018
    Level 7  
    >>21394257
    robgold,Thanks for your answers.
    If you remove the SD card, you can use the radio link on github. ESP32_radio_v2_evo3.1 uses this radio link
    https://raw.githubusercontent.com/dzikakuna/ESP32_radio_streams/main/bank01.txt
    People who want to save time can just use the set radio link.
    Those who want to listen to other radio stations can simply create their own account and radio link on github. This is much easier for me than adding an SD card.

    Have you considered removing the SD card?
  • #375 21396019
    robgold
    Level 20  
    @MAJSTER XXL , other colleagues

    I uploaded a new revision of the radio - 3.11, the changes are:
    I replaced the EEPROM function holding the station tables with writing to PSRAM. I have the impression that the radio works faster but maybe it's just an impression.
    By the way Majster it seems to me that EEPROM did not work because it was incorrectly declared.

    It was:
    EEPROM.begin((MAX_STATIONS * (STATION_NAME_LENGTH + 1)));

    And then the write looked like this:
    EEPROM.write(stationsCount * (STATION_NAME_LENGTH + 1), length); ie:

    EEPROM.write(0* (42 + 1), 42); ->> EEPROM.write(0, 42);
    EEPROM.write(1* (42 + 1), length); ->> EEPROM.write(42+1, 42);
    EEPROM.write(0* (42 + 1), 42); ->> EEPROM.write(84+1, 42);

    Each time +1 cell was added at each iteration and the size of the declared EEPROM was only + 1 and not 1x the number of stations larger.
    That is, with 95 stations the offset was by 95 cells. In other words, there were 95 cells missing from the EEPROM size declaration.
    Everything works until you have 2.5 stations less in the file, i.e. realistically 97 stations. Then you are left with a reserve of 3x42 characters.
    This came out when writing to PSRAM. The memory and the entire ESP were lost.
    Please take a look to see if I am thinking correctly.

    Currently I have 100 stations declared, in the file test 104 and it works correctly cutting out only 100. To my eye it "laughs" as I wrote faster. I recommend, dig into this PSRAM support.

    A second addition, more apparent perhaps to all:

    In the VERY primitive version with support for 1 connection, the web server works.
    By going to the radio's IP page you can change stations, bank, volume. Such basic parameters.
    Perhaps I will convert this eventually to AsyncWeb to support this without primitive "GET" functions. For now, this is an experimental version

    ESP32 Internet Radio interface with station list and control buttons. .
  • #376 21396401
    MAJSTER XXL
    Level 29  
    @robgold Unfortunately I have had little time lately and a lot of work and it does not look like I will have any easier in the coming weeks, in the field of design and installation of teletechnical systems, mainly fire-fighting and related, my day often ends at 10 pm, my eyes are tired of drawing, my brain tired of programming systems and discussions on objects. Over the weekend I planned to work on making a remote control, I bought and today the IR receiver modules and a toy remote control arrived, but with nicely conceived buttons. I've even pre-prepared the code on the IRremote library, but after uploading to the ESP32 module it reboots on startup, hmmm..., I'll probably start my own so that it spits me raw data byte packets of received buttons from the remote on the serial and somehow I'll probably chunk it into a declaration in the code and assign it to execute commands.
    Here's how it looks:


    Toy remote control with multiple functional buttons. .


    IR receiver module with three pins labeled GND, VCC, and OUT. .

    I have made a note at the end of the first post in our topic that a version of my v2 and your evo has been created with the corresponding links to github, so that those who are starting to read this will at least find their way around these already 13 pages.


    edit. I'm going to try based on this library, as even the example code works:


    Screenshot from Arduino IDE showing IR module code for ESP32. .
  • #378 21396596
    Slawek K.
    Level 35  
    It would be completely better and hassle-free to write and compile this in Visual Studio Code from Platformio, there wouldn't be those errors that appear in the thread because people use different versions of the Arduino IDE, and more importantly, in Platformio, each project has a separate set of libraries, and not like in the Arduino IDE, common to all, consider if it's not worth it - code syntax the same, but intellisense beats the Arduino IDE :) .
  • #379 21396644
    robgold
    Level 20  
    >>21396401 @MAJSTER XXL .

    I don't envy the work situation but sometimes it happens, there's nothing we can do about it. At my place there are also such days and sometimes weeks.

    Regarding the remote control. I once made a bathroom radio using this type of remote control on the NEC protocol. It was supposed to be built into the ceiling, so only the remote control was an option. Eventually it ended up in the mirror. It has been playing for 3 years now and zero problems. I used the library then:

    IRremote by Ken Shirriff in Arduino. I took a look at this project and the library supports ESP32.

    The remote control itself is very cool, There used to be these tiny remote controls with such a nice arrangement of buttons. Today it is possible to build a device not very different from the factory solutions.
  • #380 21396840
    DJCheester
    Level 26  
    Hello, there is the author of the project very cool 😀

    The project will develop again.

    Question for the author to post the actual schematic with the IR receiver connection, I am just planning a PCB, I would add that right away.

    Second question, are the pins from robgold's colleague's schematic the same, i.e. encoders, OLED, card and PCM?

    And last question to the author, are the directional buttons that have recently appeared on the schematic, will they be used?

    Regards...
  • #381 21396969
    robgold
    Level 20  
    If the example that Majster gave is transferred directly to the code then you already have the PIN given:

    Freenove_ESP32_IR_Recv ir_recv(35); --< GPIO35

    @MAJSTER XXL
    By the way quite nice this library, simple but can work as a task in core 1.
    Not many standards it supports, but let's just say the NEC or base reads correctly. It's a shame that Denon is not here.

    @DJCheester .
    The schematics are identical. In my case I added a ladder of resistors to the JOY connector so that 5 buttons can be connected.
    If you have any doubts about connecting specific peripherals, please ask. I will try to resolve any doubts.

    There was also a Jazz24 radio thread, unfortunately the AAC 256 stream cuts very badly. I will upload a 128kb mp3 stream to Bank 1.
    I know it's not crazy with this type of music but the i2s library and AAC decoder can't cache this stream something.
  • #382 21397128
    Andrzej Ch.
    Level 33  
    >>21396401 .

    It would be great if this IR remote would work with this device. I have a very similar remote control and IR receiver for development with this receiver.
    I remember suggesting the addition of an IR remote a few pages back.
  • #383 21397262
    Damian_Max
    Level 19  
    @Slawek K. ..only that the latest Arduino IDE stands on vscode, so that this one xD, at least the latest one on macOS.
    And the idea with Platformio is a good one. Except that the main contributors don't need it, so someone new could do it, like me or you xD....
  • #384 21397517
    robgold
    Level 20  
    Fellows, what is the advantage of Platformio besides that it also consolidates libraries in one directory ? I installed it and it doesn't even have all the ESP32-S3 boards. The handling is very unintuitive in my opinion.
  • #385 21397542
    Slawek K.
    Level 35  
    robgold wrote:
    Colleagues, what is the advantage of Platformio besides that it also consolidates libraries in one directory ? I installed it and it doesn't even have all the ESP32-S3 boards. The handling is very unintuitive in my opinion.
    .
    As always, it's a matter of getting used to it. What I wrote about libraries is just one advantage. You can assign a specific platform release (in this case ESP32) to each project, i.e. a kind of tile manager from the Aruduino IDE, which means that it will always compile without errors, because it is based on exactly the specific version and downloads it itself from git - and much more.

    But I won't rubbish you here in the thread because that's not what it's about :) and the project is cool and I'm following it all the time :) .

    By the way, it makes me wonder what is the use value of giving on lcd bitrate and other streaming parameters :D I know that it's a habit from Winamp (who remembers) and times when it worked on slow connections :D nowadays it's enough to listen and immediately you know whether it's clear or poor quality :) .

    Greetings
  • #386 21397651
    robgold
    Level 20  
    You're right, it's some kind of vintage WinAmp origin :) ...but on the other hand it's a very quick preview of the station's "broadcast" quality. Sometimes if the radio gets "hiccups" you can see the codec. Unfortunately the high bitrate FLAC and AAC decoder performs poorly and eats up a lot of resources. The radio itself and the library have a small buffer in PSRAM. There are stations that allow you to have 300k there are some that buffer at 72k. On the terminal in evo3.11, the status of the audio buffer is spit out every 1s (clock refresh)
    in the form:

    debug--Audio buffer:638966 / 72576

    Here is a Melo radio stream for Katowice broadcasting 128k, mp3 but already in 48kHz
    I personally like to have this information on display. I would sooner get rid of the second hand, but it again serves as a heartbeat. It lets you know that the hardware is still alive ;) .
  • #387 21398086
    ArturAVS
    Moderator
    That's what I'm looking at... And I have acquired the desire to build :D myself. The parts have already been ordered, and the board will be built as an SMD. I will not be using off-the-shelf modules, but the components themselves. I.e. ESP32-S3 module, PCM5102 also soldered to the board. I hope to fit on a PCB the size of a "packet of pipes". I will order the boards from JLCPcb, and only the "user interface" board, i.e. encoders with display (or buttons), will be to make myself.
  • #388 21398149
    robgold
    Level 20  
    @ArturAVS .
    This is exactly the PCB I have been dreaming of and is slowly being built in my PRO version for this project. I am happy to join :) .
    USB-C socket Link on PCB, SMD card reader on back panel with option to connect module on front panel. To this an ESP32 module Link with input for an external antenna, connectors for everything JST raster 2.54 and an aluminium case. The enclosure I have chosen is a Hammond 1455R1601BK. It's big but is meant to rest on top of another audio 'block'. Here you can probably choose something much smaller. Of course, this forced a 2.08 inch display (supported from the Evo2 version onwards). Encoders 30 imp instead of 20. The PCB for the 1-way encoders is already there, although I don't like this component from the library and will improve it a bit.

    Display showing SD card error message on a radio device. .
    Front panel of the enclosure with an LCD display showing the text Radio Italo! and Abra kadabra. .
    PCB layout for an encoder on a black background. .
    Electrical schematic with resistor and capacitor connections. .

    Of course, this does not exclude work on a Standard version where, however, it is easier to put modules together like lego blocks for many and we want the project to be widely available.

    @MAJSTER XXL
    I had a look at this decoder for IR yesterday. I have the impression that it feeds the bits as they fly i.e. LSB-MSB. I did the conversion the way they often give the pilot codes on the websites (MSB-LSB). In other words conversion from big endian to little endian. I used to do a Kenwood - Joy Renault radio converter and I kept this order of bits. Code below. You might use. A version with the shuffle pinned to the core. Receiver pinned to GPIO15 instead of GPIO35 for testing.

    By the way, I dug up the remote control from that project, based on which I read the codes. It turns out that it works in NEC standard, is cheap (~£15-20 ALi) and has rubber buttons. So, if you like such more "pilot-like" remotes, look for the RC-406

    Remote control with numeric and control buttons on a wooden surface

    
    #include "Freenove_IR_Lib_for_ESP32.h"
    uint32_t data;
    uint8_t command;
    uint8_t address;
    uint32_t reverse_bits(uint32_t inval, int bits)
    {
    if ( bits > 0 )
    {
    bits--;
    return reverse_bits(inval >> 1, bits) | ((inval & 1) << bits);
    }
    return 0;
    }
    
    Freenove_ESP32_IR_Recv ir_recv(15); //ESP32-GPIO15
    
    void ir_task(void* parameter){
       parameter = parameter;
      while(1){
        ir_recv.task();
      }
       vTaskDelete(NULL);
    }
    
    
    
    void setup() {
      Serial.begin(115200);
      xTaskCreatePinnedToCore(ir_task, "ir_task", 2048, NULL, 10, NULL, 1);
    }
    
    void loop() 
    {
      //  ir_recv.task();
    
      if(ir_recv.nec_available())
      {
        if (ir_recv.data() != 0xffffffff) 
        {
          Serial.printf("IR Protocol:%s, IR Code: %#x\r\n", ir_recv.protocol(), ir_recv.data());
          data = reverse_bits(ir_recv.data(),32);
          address = (data & 0xFF);
          command = (data >> 16);
          
          Serial.printf("data:%#x\r\n",data);
          Serial.printf("address:%#x\r\n",address);
          Serial.printf("command:%#x\r\n",command);
         
          Serial.println(data);
        }
      }
    
    }
    
    .
  • #389 21398171
    ArturAVS
    Moderator
    Well, I like small and compact devices :D . ESP module, with external antenna (U.FL -> SMA), as someone will need, will insert with built-in. On the software side, there will be room for improvement. I purchased the display on the SSD1309 controller over I2C. Tomorrow I sit down to draw the boards. I will upload the results before ordering from JLCPcb. It comes out to about $21 for 10 boards.

    Edit

    And the IR receiver input, which GPIO should it be plugged into? Because I think the schematic in the title post got a bit "off"....
  • #390 21398193
    MAJSTER XXL
    Level 29  
    Unfortunately, attempts to run operation from the IR remote control are so far unsuccessful. Tasks or functions that are supposed to capture the packet and process it into a "readable" form do not manage. The problems are as follows:
    - either the start of the task blocks further code execution
    - or the ESP32 module resets
    - or the audio is only audible when receiving data from the IR,
    I also tried to do it in an interrupt, the effects are similar, you can see that after receiving a packet and processing it, it does not release the task or exit any function.
    All other libraries, or more precisely the examples from them, cause ESP32 resets.
    Only this Freenove_IR_Lib_for_ESP32.h runs with my v2 radio code, but it doesn't work as expected. I'll get back to the topic tomorrow or tonight. Maybe I'll do a walk-through of the whole frame on interrupts to put it together. To figure it out you need to put together the bytes from the timing frames, and for that you need to be familiar with the standard of at least the NEC.

    @robgold maybe you can figure something out faster here?

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