After the Blog post Internet-radio with dem ESP32 a great echo hervoWe are now presenting a second variant, which has received numerous improvements and enhancements. The most significant change is the use of the I2S digital amplifier MAX98357A instead of the analog amplifier. The display was to 4 lines with 20 characters vergröures. Next to the station just played wou will find Date and time, and the current volume are displayed. The two lower lines show the Information about the current program that is sent along with the audio stream. The volumercontrol takes place justas well as the station selection via a rotary encoder. The configuration can be made, as with the improved version of Mr. Schröder (see update in the old post), via a Browser can be done. The channel list can also be changed and extended in this way.extended. Since some URLs are notplayable, a URL can now be tested via the browser configuration before it is saved.rt is saved. The supply via battery has been omitted, because the power consumption was too high. Additionally, a firmware update can be done via WLAN (Over The Air = OTA).
Required hardware
Number | Component | Note |
---|---|---|
1 |
|
|
2 |
|
|
1 |
|
|
1 |
|
|
1 |
|
|
1 |
|
|
1 |
|
|
2 |
|
|
1 |
|
|
2 |
|
|
2 |
|
|
1 |
|
|
1 |
|
|
2 |
|
|
2 |
Rotary knobs for 6mm axis |
|
Multiple |
|
|
1 |
|
|
1 |
|
Circuit
The following table shows the use of the Pins of the ESP32
Device |
Designation |
ESP32 |
Amplifier left |
LRC |
25 |
BCLK |
26 |
|
DIN |
27 |
|
|
GAIN |
GND |
|
SD |
+5V |
|
GND |
GND |
VIN |
+5V |
|
Amplifier right |
LRC |
25 |
BCLK |
26 |
|
|
DIN |
27 |
|
GAIN |
GND |
|
SD |
+5V via 470kΩ |
|
GND |
GND |
|
VIN |
+5V |
LCD display |
GND |
GND |
|
VCC |
+5V |
|
SDA |
21 |
|
SCL |
22 |
Encoder volume |
CLK |
14 |
|
DT |
13 |
|
SW |
|
|
+ |
+3.3V |
|
GND |
GND |
Encoder Transmitter selection |
CLK |
33 |
|
DT |
32 |
|
SW |
35 3.3V above10kΩ |
|
+ |
+3.3V |
|
GND |
GND |
Supply |
+5V |
VIN |
|
GND |
GND |
The ESP32 is assembled with the resistors and pin headers for the peripherals on a 50x70 mm breadboard. For the two 7-pin female connectors are used for the two amplifier modules.

The image shows the assembly and the wiring on the bottom side
The image shows the realization on a breadboard 50 x 70 mm
The wiring could also be done by a one-sided printedcircuit printed on one side. Only the red marked connection must be realized via a free connection. Three wire bridges are used for the I2S bus.
The two amplifier modules are plugged into the two 7-pin female connectors. The two rotary encoders and the display are connected with jumper wire cable F2F to the corresponding pin headers on the breadboard. The loudspeakers are connected to the screw terminals of the amplifier modules.

Software
The sketch was split into several parts for clarity. For this purpose a function is used, which is provided by the Arduino IDE. If there are other ".ino" or ".h" files in the same folder besides the main sketch, which has the same name as the folder, the compiler appends them to the main sketch in alphabetical order.
Since the whole code has become very large, it is only available for download.
Sketch for download
The ZIP file contains the folder with all related files. It has to be unpacked into the working directory of the Arduino IDE (mostly documents\Arduino\). In the following, the individual parts are briefly described. A detailed description can be found as comments in the code.
- ino: This is the main sketch. Global variables and data structures are defined.
- setup() after initializing the serial interface the configuration data is read from the preferences. Then the setup functions of the individual program parts are called, with the exception of web server and OTA. The connection to the local WLAN is established. If the connection was not successful, information about the configuration is shown on the display. If the connection is successful, the real-time clock is initialized and playback of the last station listened to is started. Now the setup for web server and OTA can also be called up.
- loop() first checks if there are OTA requests and then if there are requests for the web server. It checks if the connection to the WLAN still exists. If the connection exists, the audio stream and the two encoders are checked for events. Once per minute the display of the time is updated. If the connection was interrupted for more than 5 minutes, the ESP32 is restarted.
- ino: In this part all functions related to the audio streams are implemented.
- setup_audio() prepares the system. Buffer and stream output are initialized.
- audio_loop() checks the status of the audio stream.
- MDCallback(void *cbData, const char *type, bool isUnicode, const char *string)
is called whenever new metadata is available in the received stream. Metadata of type "Title" will be shown on the display. - stopPlaying() stops playing the stream and releases the associated resources.
- bool startUrl(String url) Starts playing a stream from a given URL. If the start is not successful, false is returned.
- setGain() sets the volume to the value of the global variable currentGain.
- ino: Contains functions to control the display and the definition of special characters like speaker and German umlauts.
- setup_display() initializes the display and creates the special characters in the display RAM.
- String extraChar(String text) replaces the German umlauts in the passed UTF8 text with the corresponding special character code.
- showStation() shows the name of the current radio station in the second line of the display. The display starts at position 2 and is truncated to 18 characters. If the current station is also the active station, the speaker symbol is displayed at position 0.
- displayMessage2(uint8_t line, String msg) the given string is displayed in two lines starting from the given line. Both lines will be deleted before. If the string has more than 20 characters, a line break occurs. The second line will be truncated after 20 characters.
- displayDateTime() The first line displays the date and time. In the rightmost position the current volume is displayed in percent.
- displayMessage(uint8_t line, String msg) the given string will be displayed in the given line. The line will be deleted before. The string will be truncated to a maximum of 20 characters.
- displayClear() deletes all four lines.
- clearLine(uint8_t line) deletes the specified line
- ino: Controls the volume control with a rotary encoder.
- gain_loop() checks if the value of the rotary encoder has changed. If it has, the new volume value is saved and set.
- IRAM_ATTR readGainISR() Interrupt handling for the encoder
- setup_gain() starts the encoder, registers the interrupt routine, sets the limits and the current value as default.
- h: Contains the HTML pages for the web server. With the command sequence
const char MAIN_page[] PROGMEM = R"=====(
any text.........
)=====";
an arbitrary text can be inserted directly as a constant into the program memory. This is very handy for HTML pages, as they can then be designed and tested outside the IDE. The present pages use jQuery, Ajax and JavaScript. The advantage of Ajax for interactive pages is that when changes are made, only the changed part of the page is updated. Three HTML constants are defined.- OPTION_entry a template for entries in the radio station selection list
- MAIN_page the main page with configuration and maintenance of the station list
- CONFIG_page Page for entering the access data if the ESP32 is in access point mode for initial configuration.
- ino: Here you can find the functions to update the firmware via WLAN.
- setup_ota() the host name and password are set. Then callback functions are registered.
- ota_onStart() is called at the start of an OTA upload. The display is cleared and a corresponding message is shown in the first line
- ota_onEnd() is called after the upload is finished. A corresponding message is displayed in the third line.
- ota_onProgress(unsigned int progress, unsigned int total) is called at regular intervals during the upload and provides information about the progress. The second line of the display shows the progress in percent.
- ota_onError(ota_error_t error) is called when an error occurs. The error message is then displayed in the fourth line.
- ino controls the station selection with a rotary encoder
- rotary_loop() checks if the value of the rotary encoder has changed. If it has, the next station from the station list is displayed. If the button on the encoder is pressed within 10 seconds, the new station is switched to. If the button is not pressed, there is no change and the current station is displayed again.
- IRAM_ATTR readRotaryISR() Interrupt handling for the encoder
- setup_rotary() starts the encoder, registers the interrupt routine, sets the limits and the current value as default.
- ino: defines a program memory constant with the default transmitter list.
- setup_senderlist() fills the station list in RAM with the station list from the preferences. If there is no station list there, the default station list is used.
- ino: Contains the setup and functions to respond to http requests.
- setup_webserver(): Registers the individual functions to handle http requests and starts the server on port 80.
- webserver_loop() it is checked if there are new requests.
- handleRoot() handles a request for the main page. If there is a connection to the local WLAN, the main page is sent to the client. If the ESP32 is in access point mode for the basic configuration, the configuration page is transmitted. In this case, any existing parameters must also be processed in order to save the access data or trigger a restart.
- sendStations() responds to the Ajax command with the URL /cmd/stations. Sends the list of stations as HTML optionlist. This list is then built into the dropdown element via javascript in the client.
- setAccessData() responds to the Ajax command with the URL /cmd/setaccess. The configuration data SSID, PKEY and NTP server are stored in the preferences.
- getAccessData() responds to the Ajax command with the URL /cmd/getaccess. The configuration data SSID, PKEY and NTP server are sent as response. The end of line is used as the separator.
- getStationData() responds to the Ajax command with the URL /cmd/getstation. The ID of the desired station is expected as argument. The name, URL and enable flag of the specified station is sent as response. The end of line is used as separator.
- setStationData() responds to the Ajax command with the URL /cmd/setstation. The ID of the desired station is expected as argument. If the ID is valid, the data passed as argument for the name, the URL and the enable flag will be stored in the station list.
- testStation() responds to the Ajax command with the URL /cmd/teststation. The URL to be tested is expected as an argument. An attempt is made to start the replay of the specified URL. If the attempt is not successful, it switches back to the current station and responds with "ERROR".
- endTest() responds to the Ajax command with the URL /cmd/endtest. The test is terminated by starting the playback of the current station.
- restart() responds to the Ajax command with the URL /cmd/restart. The ESP32 is restarted.
- ino: Contains the function to connect to the local WLAN or to provide an access point if a connection is not possible.
- boolean initWiFi(String ssid, String pkey) Attempts to connect to the local WLAN using the specified credentials. If no SSID is specified or the connection attempt fails, an access point is started. This access point can then be used to access the configuration page from a browser at the address 192.168.4.1.
In order to compile the sketch, the Arduino IDE must be prepared accordingly. The Arduino IDE supports a large number of boards with different microcontrollers by default, but not the ESP32. Therefore, in order to be able to create and upload programs for these controllers, a software package for support must be installed.
First you need to tell the Arduino IDE where to find the additional data it needs. To do this open in the menu File open the item Preferences. In the Preferences window there is the input field called "Additional board administrator URLs". If you click on the icon to the right of the input field, a window will open where you can enter the URL https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json can be entered.
Now select the board management in the Arduino IDE under Tool → Board.
A window will open listing all available packages. To narrow down the list, you enter "esp32" in the search field. Then you get only one entry in the list. Install the package "esp32". If the package was already installed, please check if you have the latest version.
Another library is needed for the rotary encoder. Its name is "AiEsp32RotaryEncoder" by Igor Antolic in version 1.4.0.
But the core of this project is the library "ESP8266Audio" by Earle F. Philhower in version 1.9.7.
This library allows to read and decode different digital audio streams and play them back over different output channels. As input, the program memory, the internal RAM', a file system, an SD card, an HTTP stream, or an ICY stream can be used. The ICY stream is typically used by Internet radios.
WAV, MOD, MIDI, FLAC, AAC and MP3 files can be decoded. MP3 is required for web radio. Finally, the output can be in memory, files or I2S.
When all libraries are installed, the sketch can be compiled and uploaded to the hardware.
Attention. Since the sketch is composed of numerous parts, compiling can take a long time, especially the first time. In the preferences "Compiler Warnings" should be set to "none", because the LCD library will give a warning by mistake
Commissioning
At the first startup there are no preferences yet. Therefore no connection to the local WLAN can be established. An access point with the SSID "webradioconf" without password is started. A connection to this access point can now be established with a smartphone, for example. Afterwards, the configuration page can be called up in a browser via the address 192.168.4.1.
After the restart, the connection to the local WLAN should be established successfully. The playback of station 0 from the default list (NDR2) should start with a volume of 50%. The volume encoder can be used to set the gain. Changes are saved in the preferences so that the same volume is set the next time the device is switched on. The other encoder can be used to select a station from the list. When turning the encoder, the second line of the display shows the name of the station. By pressing the head on the encoder, the currently displayed station becomes the current station and playback starts. This value is also stored in the preferences. At the next start, the last selected station is automatically played back. If the button on the encoder is not pressed within 10 seconds, the display jumps back to the current station.
Configuration and editing of the station list
The configuration page should be accessible via the URL http://webradio/. In the upper part the access data and the NTP server can be changed. The changes will not take effect until the "Save" button has been clicked.
With the button "Restart" a restart can be triggered.
The drop-down list contains all stations of the station list. Selectable stations have a black dot in front of the name. In the form below, the data for the selected station is displayed and can be changed. If the "Use" check mark is not set, the station cannot be selected in the device. Since some URLs do not work, a new URL should be tested with the "Test" button. Clicking this button starts the playback of the URL on the device. If playback does not work, the device immediately switches back to the current station and displays a message. If playback is possible, a box with a button is displayed. Clicking on this button closes the box and ends the test. The current station is played again. The "Change" button can be used to permanently change the changes for the selected station.
Firmware update via OTA
To update the program it is not necessary to open the device and establish a USB connection. In the Arduino IDE you should see the following entry at the ports.
You can now upload a sketch via this port. For protection, the password "radioupdate" must be entered when prompted. Since the serial port cannot be used, messages are shown on the display.
Notes
The ESP32 has a CPU with two cores. With Internet Radio the web data stream must be read from the Internet via the http protocol. This is done in the system thread running on core 0. The application must decode the received stream and write it to the buffer, from which the data is then output via DMA without CPU intervention. The decoding is done in the application thread running on core 1. If additional CPU time is now used for display and encoder, short interruptions occur that can be heard acoustically when the encoders are turned.
A power supply via the USB bus of the ESP32 module is possible. The supply via the external input is only a recommendation.
The 3D object to the console housing is arranged in such a way that 3D printing is possible without support structures. The link to the print files can be found in the component list at the beginning of the article.
Have fun with the radio!
112 comments
Bernhard Rekemeier
Berechnung: ?
5 / (4,7+10) x 4,7 = 3,4 # nö
5V / (4,7k+10k) x 4,7k – 5V = 3,4V # ja
Jeder ESP- Dev. hat einen Spannungsregler von 5V auf 3,3 V. Also sollten die GPIOs auch auf 3,3V laufen. Wo 5V draufsteht, sollte auch 5 V vorhanden sein, z.B. BME280 Sensor, den es in 5V und 3,3V gibt. Ich arbeite ausschließlich mit 3,3 V auf den ESPs, bisher ohne Probleme. Auch an die 10k Widerstände (3,3V an SDA) denken, wenn der I2C-Bus mit mehr Devices verwendet wird(Display und Sensor).
Pit
@Gerald Lechner
Falsch, ich habe nicht “im Prinzip” recht sonder meine Aussage ist eindeutig richtig,
weder der ESP8266 noch der ESP32 ist 5V telerant. Das etwas gerade geht OBWOHL es technisch falsch ist macht es nicht besser. Ihre vorgeschlagene Loesung
<
Die Pullup Widerstände sind 4,7kOhm. wenn man beide Leitungen über 10kOhm mit Masse
verbindet ändert sich die Leerlaufspannung von 5V auf 3.4 V. Spannungsteiler 5 / (4.7 + 10) * 4.7 = 3.4
>
Ginge natuerlich auch.
Ich bin halt der Meinung man sollte in Schaltungsvorschlaegen technisch sauber arbeiten damit Menschen die etwas nachbauen sich nicht falsches merken, denn in einer anderen Kombination von Modulen mit dem ESP koennte derartiges ihn zerstoeren.
Gerald Lechner
@Pit: Sie haben im Prinzip recht. Da beide Signalleitungen vom ESP32 als Ausgang betrieben werden ist es aber nicht ganz so kritisch. Ich hatte noch keine Probleme damit.
Die Pullup Widerstände sind 4,7kOhm. wenn man beide Leitungen über 10kOhm mit Masse
verbindet ändert sich die Leerlaufspannung von 5V auf 3.4 V. Spannungsteiler 5 / (4.7 + 10) * 4.7 = 3.4
Pit
Hi
Hier das gleiche Problem wie bei der urspruenglichen Variante:
ich finde die Anschaltung des Display es etwas “gefaehrlich” fuer den ESP32,
denn so wie dargestellt wird der I2C ueber die PullUps auf der Display-Interfaceplatine
auf 5V gezogen, der ESP32 mag aber , soweit mir bekannt , keine 5V am GPIO.
Deswegen wuerde ich vorschlagen entweder das Display auf 3V3 oder die PullUps
von der Interfaceplatine entfernen und 2 neue gegen 3V3 in die Schaltung zu integrieren.
Michel
@Hans-Jürgen
https://github.com/adafruit/Fritzing-Library/blob/master/parts/Adafruit%20MAX98357A.fzpz
Hans-Jürgen
Moin,
kann mir jemand einen Tip geben, wo ich das Fritzing-File für den Verstärker MAX98357A finde?
Ich möchte versuchen, eine Platine für das Wlan-Radio mit dem TFT-Display zu erstellen.
Danke schon mal
Hans-Jürgen
Rainer
Hat schon jemand die Platine dafür hergestellt. Wenn ja würde ich gerne gegen Unkosten erstatten, diese erstehen.
Mfg Rainer
Rainer
Läuft prima. Etwas friemelig war der Zusammenbau mit dem 4x 20 Zeilen Display. Wenig Platz um die Lautsprecher fest zu schrauben. Aber nun funktioniert alles.
Wumba
Nochmal ein Repost, weil ich mal weider drüber gestolpert bin: Stottern kommtn, wenn der 10 k Widerstand am GPIO 35 zum 3,3 V Anschluss fehlt.
Warum ist das so?
#Stottern#Abbruch#Aussetzer
Konrad
Hallo beisammen,
Kleine Frage an Alle: Hat jemand das mit der SD-Card mal ausprobiert und die jeweiligen mp3 Musikdateien “angespielt”? Habe noch nicht das TFT Display ausprobiert und würde mich einfach mal interessieren, wie man die Karte musiktechnisch über die Knöpfe ansteuert.
Auch war irgendwo mal die Idee zu einem Radiowecker. Gibt es dazu schon Ansätze?
Danke
Konrad
Kamil
Thank you Mr. Lechner for precise answer. Now it is OK.
Just the last question concerning special characters. In the software subpart “display”, there is code on the first about 50 lines for german characters.
(How to display them on dot 8×8 and than if such character is detected which display pattern should be used).
I have tried to use those functions to display some my language characters. For example: é. (e with acute), Dec. code is 195 169. If I put all data inside functions, I was not succesfull. The result was e without any sign over it. I have tried to see original Titel for song through Serial monitor, Titel in my language was without acute?
I suppose: some special characters are not even transfered by internet? I could not compare with German
station, because few choosen German stations displayed names of English songs only without special german characters.
Can you advice how to display special not german characters?
Gerald Lechner
@Kamil: This problem occurs if you missed the 10k resistor from 3.3V to GPIO35. This resistor is always required even if the rotary switch for station selection is not supplied.
Konrad
@Tommy: Großes Dankeschön. Tolle Arbeit.
Thommy
Hallo zusammen,
ich habe das Gehäuse eben bei Thingiverse veröffentlicht. Es sind STL Dateien, sowie auch die SCAD Dateien zum Download verfügbar. (Damit ihr das Modell ggf. anpassen könnt. Die Einschmelzmuttern M3 findet ihr bei Amazon oder bei Ebay. Dort gibt es Sets die aus Einschmelzmutter und Schraube besteht. Alles hält damit noch besser und es wird auch nix lose mit der Zeit, als wenn man nur Schrauben in den Kunststoff schraubt. Ich nutze diese für all meine Projekte und habe damit sehr gute Erfahrungen gemacht. Vielleicht noch einen Tip beim Drucken der Beschriftungen – ich habe hierfür bei Cura einen Filamentwechsel eingestellt, damit er ab einer bestimmten Höhe nicht mehr blau sondern weiß druckt. Wem das zu umständlich ist, der druckt einfarbig und malt die Konturen mit einem weißen Edding(oder besser weißen Acrylfarbstift) nach. Und wer sicht fragt warum das Radio “No. 7” heißt; das ist mein 7. Radio was ich gebaut habe.(nicht immer das gleiche, sondern eigene Projekte)
So genug gesabbelt – Viel Spaß beim nachdrucken. ;-)
Hier gehts zum Gehäuse: https://www.thingiverse.com/thing:5954124
Kamil
To make more clear what is " pulsating sound": Sound is ON for about 0.5s, than OFF for 0.5s, than ON, than OFF and so on, like modulated by rectangular pulses 1Hz (not 0.5Hz). Does not matter which web station is selected.
Kamil
Hallo,
very nice project and clear software.
But I have a problem with sound:
Compilation and upload is O.K.
Display is 4×20 original AZ Delivery. Esp32 is 30 pins.
Display is working, but after WiFi is connected, there is sound pulsating in frequency about 0.5 Hz, Volume is O,K.
If there is not pulsation, sound looks good.
I simplified hardware for just ESP32 and one Max amplifier. Sound was pulsating again.
Than I loaded other very simple software. Sound was OK. It means, that problem could be in software?
I have check project with external power 5V, but results are the same.
I have tried to adjust SD pin by resistor to different modes, no influence.
Multimeter show me some pulsation on pin 27 of ESP32.
Can you advice,
best regards
Kamil
Günter
Kanal-/Lautstärke-Fehler gefunden, es war die Zeile 40 in der audio.ino (out = new AudioOutputI2S(0,1);). Obwohl ich die Zeile im sketch gemäß Hinweisen geändert hatte, hat die IDE immer die falsche Version geladen (mein Fehler: das Archiv existierte zuerst noch ausgepackt in /Downloads,) Es ist nicht das erste Mal, dass ich an der 2.0-IDE verzweifle). Auch wenn der Compiler nichts beanstandet, lohnt es sich also, den Output durchzulesen. Das Löschen des entpackten Archivs in /Downloads war die Abhilfe. Nun ein schönes begeisterndes Gerät geworden, vielen Dank.
Günter R..
Siegfried
@ Günter R : ich habe die Audio Bibliothek auf Version 1.9.5 und damit läuft es stabil und gut. ESP32 Version ist dabei 2.0.6
Gruß
Günter R.
Herzlichen Dank an Herrn Lechner zuerst, für einen wirklich vollständigen Projekt-Umfang. Auch hier läuft fast alles auf Anhieb, denn leider bekomme ich nur auf einem Kanl und dort stark verzerrtes pumpendes Audiosignal (auf allen Sendern übrigens). Die Audio-Biblithek ist Version 1.9.7. Gibt es Erkenntnisse, dass eine ältere Version diesen Fehler vielleicht noch nicht haben könnte? Vielen Dank im Voraus…
Konrad
@Thommy: Hier, hier, hier!! Sieht echt toll aus. Bitte gerne die slt Dateien, bzw. CAD. Großes Dankeschön
Kleine Frage an Alle: Hat jemand das mit der SD-Card mal ausprobiert und die jeweiligen mp3 Musikdateien “angespielt”? Habe noch nicht das TFT Display ausprobiert und würde mich einfach mal interessieren, wie man die Karte musiktechnisch über die Knöpfe ansteuert.
Danke
Konrad
Dank
Rainer Hoffmann
@Thommy
Ein sehr schönes Gehäuse hast du da entworfen. Ich bin interessiert!
Thommy
@Sven
Doch es könnte tatsächlich am Code liegen. Schau mal bitte in der webradio_MAX_TFT.ino Datei nach. Dort findest du folgende Zeile:
“bool newTitle = false;”
Diese Zeile ist muss aber auf true gesetzt werden, da sonst keine Titel angezeigt werden.
Also die Zeile wie folgt abändern:
“bool newTitle = true;”
Danach bloß noch auf deinen ESP32 flashen und es sollte funktionieren.
Bitte auch noch in der audio.ino Datei nachsehen. Dort gibt es die selbe Zeile. Die sollte auch auf “true” stehen.
Thommy
Ich habe die Version mit dem 1.8er Display und der Platine von Herrn Lechner nachgebaut. Das Gehäuse hat mir nicht ganz so gefallen, deswegen habe ich ein eigenes konstruiert. Die beiden Knöpfe und die Schriftzüge natürlich auch. Für die Befestigung der Platine, der Lautsprecher und dem Deckel habe ich Einschmelzgewinde M3 genommen.
https://photos.app.goo.gl/EvanbvWFKMPprEx79
Wenn Interesse am Gehäuse besteht kann ich es gern kostenlos zur Verfügung stellen. Ich habe es mit openscad konstruiert, sodass man es leicht anpassen kann.
Sven Laur
@Siegfried: Danke für Deine Antwort. Bei mir zeigen auch die von Dir erwähnten Sender keine Titelinformationen an. Hat jemand eine Idee wie man hier am besten nach dem Fehler suchen kann? Am Code wird es sicher nicht liegen, wenn andere die Infos angezeigt bekommen. Am Display liegt es auch nicht da ich die Variable „Titel“ über den seriellenMonitor ausgegeben habe und dort auch kein Inhalt vorhanden war. Kann man die Titelinfos auch mit einem anderen Programm auslesen um das mal zu testen? Bin für jeden Hinweis dankbar denn irgendwie wurmt mich das, dass mein halbes Display leer bleibt. :-)
Siegfried
@ Sven Laur: bei mir zeigen auch nicht alle Sender diese Titel an, aber z.B. MDR oder NDR oder Antenne Bayern liefern diese Info und dann sehe ich diese auch auf dem Display ( habe das 2.8“Display )
Gruß
Siegfried
@Klaus : zum Display ILI 9341
https://radio-bastler.de/forum/showthread.php?tid=21930&highlight=azdelivery
Im Radio-Bastel-Forum hat der Jupp diese Änderung sehr gut beschrieben. Allerdings muss man sich da anmelden. Es lohnt sich, weil es da auch noch viele Vorschläge gibt, wenn man ein Gehäuse dazu benötigt.
Torsten Krämer
@ Siegfried: Verdammte Tat – der Kontakt am Widerstand war mau…. Es war genau das Thema – Danke Dir . Es zeigt mal wieder nicht machen → richtig machen ….. Danke !
Torsten Krämer
@Siegfried: Servus, das Thema 10 k hatte ich irgendwo schon gelesen, keine Idee wo , sorry. darum habe ich das ganze Radio einmal genau wie in der Beschreibung aufgebaut inkl. der Endstufen für Lautsprecher. Ich benötige eigentlich nur Line out, wollte aber möglichst jede Situation ausschließen. Leider identischer “Erfolg”. Meine letzte Idee ist aktuell das es am verwenden ESP32 Board liegen könnte (?). Leider aktuell bei Az nicht verfügbar. Ich hatte einen alternativen Lieferanten probiert. Ist das überhaupt mehr als eine theoretische Option? Gerne Eure Meinung und Anregungen aller Art. Stottern ist nach wie vor da. Grüße Torsten
Sven Laur
Hallo Zusammen,
sehr schönes Projekt, höre gerade in meinem Bastelkeller über WLAN glasklar Musik. :-)
Gibt es schon eine Idee warum die Titelanzeige nicht funktioniert? Hat jemand diese Anzeige?
Ich nutze die Version mit dem TFT Display (webradio_MAX_TFT)
Ich habe in die Funktion MDCallback mal ein Serial.println eingefügt, aber das meldet sich nicht.
Daher gehe ich mal davon aus das die Funktion nicht aufgeführt wird.
Bei der Programmzeile "file→RegisterMetadataCB(MDCallback, NULL); " im Teil audio.ino Teil bin ich raus. Das übersteigt meine bescheidenen Programmierfähigkeiten. Aufgerufen müsste die Zeile aber nach meiner Meinung werden da die etwas weiter unten programmierten Meldungen auf dem Seriellen Monitor kommen. Kann mir hierbei jemand helfen? Vielen Dank.
klaus
Hallo
ich habe mit Erfolg beide Varianten des Projektes nachgebaut. Auch ohne viel Erfahrung mit der Programierung des ESP`s
Vielen Dank für das Projekt.
Jetzt habe ich aber ein Problem. Da ich auch ein TFT Display 2,4 " ILI9341 noch habe wollte ich dieses in dem Projekt verwenden. Nach runterladen und aufspielen des TFT Codes auf den ESP erhalte ich natürlich nicht die exakte Display Anzeige weil ein anderes Display programmiert ist.
Jetzt meine Frage: Wo und was muss ich ändern im Code kann mir da jemand vielleicht helfen.
Das Radio funktioniert schon auch das Display zeigt die richtigen Werte und Symbole an. Nur etwas zu klein für das Display und gespiegelt ist es auch.
Siegfried
@ Torsten Krämer bei mir gibt es solch Reaktion, wenn der 10 k Widerstand am GPIO 35 zum 3,3 V Anschluss fehlt (Encoder Sender SW muss ja nicht unbedingt angeschlossen sein)
Torsten Krämer
Hallo zusammen,
lange Geschichte kurz: Ich habe ein Stottern auf der Audioausgabe. grob alle 200ms Aussetzer und Neustart. Ich habe sowohl 5102A, als auch die Verstärker aus dem Artikel probiert. Kann das am ESP32 Modul liegen? Gerne Tipps aller Art. Danke Euch….
Manfred Süsens
Ich habe das Internet-Radio in den Versionen V1 und V2 nachgebaut. Aber nicht um damit Internet-Radio zu hören, denn ich habe 4 Internet Radios von AUNA, die wunderbar funktionieren und einen guten Klang haben. Allerdings haben die auch einen Nachteil: Alle Radios holen ihre Daten selbst, d.h. bei gleichen eingestellten Sender werden die Daten viermal geholt!
Aber ich habe auch eine FRITZ!BOX, die einen internen Media-Server hat. Also könnte der jeweilige Sender doch einmal geholt werden und dann im Haus verteilt werden. Funktioniert mit den AUNA-Internet-Radios auch prima, wenn ich dort auf Media-Server umschalte. Allerdings verlieren die AUNA-Radios beim AUS/EIN-schalten die Einstellung auf Media-Server und ich muss mich nach Einschalten wieder durch alle Menüs durchhangeln.
Das wollte ich dann mal mit den ESP32-Internet Radios probieren. Also habe ich einfach die URL vom Deutschlandfunk mit der URL meines Media-Server ersetzt (http:\\192.168.X.X:49200\ST\AUDIO\DLNA-1-0\icecast.ndr.de\ndr\ndr1niedersachsen\oldenburg\mp3\128\stream.mp3).
Leider mit mäßigen Erfolg. Es gibt eine Verbindung und auch Daten, allerdings gibt es auch nach kurzer Zeit jede Menge Aussetzer und Krächzer.
Hat vielleicht ein wissender eine Ahnung woran das liegt?
Achim Kleine
Ich habe mich mal am Script von Andreas Kühn versucht und die Anzeige auf ein ILI9341 Anzeigemodul angepasst,
welches in verschiedenen Größen erhältlich ist, da auch ich das 1,8" ewas klein finde.
Das ILI9341 hat ein paar Vorteile zum ST7735, die wichtigste ist, das die Auflösung höher ist mit 320×240 Pixeln.
Desweiteren ist es in verschiedenen Dispaygrößen erhältlich, sodaß ein wechsel auf ein größeres Display bei gleicher Auflösung einfach ist.
Bedingt durch die höhere Auflösung habe ich ein wenig mit den Schriften gespielt, wodurch nun bis zu fünf Zeilen im Radiotext angezeigt werden.
Ich habe das farblich ein wenig umgestaltet, die Anzeige für den Senderwechsel erfolgt nun durch Farbwechsel in der Senderanzeige.
Außerdem habe ich die Prozentuale Anzeige für die Lautstärke aus der Zeitanzeige herausgenommen und durch einen farbigen Balken
unter der Radiotextanzeige ersetzt, welcher aber noch in kleiner Schrift mit der Ziffernanzeige hinterlegt ist.
Da ich kein Arduinoprofi bin gibt es vielleicht schönere Lösungen für die Änderungen.
Desweiteren habe ich ein Gehäuse für den 3D Druck entworfen, welches in meinem Fall auf der Stereoanlage steht und diese mit der Musik versorgt.
Es sind Frontplatten für das 1,8" und ein 2,2" ILI Display dabei.
@ Gerald Lechner
Bei Interesse kann ich Ihnen die Dateien zum Veröffentlichen zukommen lassen
p.s. Wenn der Aufbau mit dem mal Steckbrett nicht funktioniert, messt mal die verwendeten Drahtbrücken durch, ich habe eine Woche mit Fehlersuche
verbracht, bis das ILI funktionierte, Fehlerquelle waren zwei defekte Brücken ……
Gerd
Danke für die neue Version.
Mein Wunsch ist “Ein Knopf für Alles”Ich meine damit, mit nur einem Rotary Encoder
a) den Sender zu ählen, ein OK-Druck startet den Stream (ist es ja bereits)
b) nun sollte der Rotary Encoder beim drehen die Lautstärke sofort einstellen
erst ein OK-Druck führt zurück zur Senderwahl.
c) Als Zukunftswunsch evtl. ein langer OK-Druck für Deep Sleep
Mangels Know-how kann ich diese Änderungen nicht durchführen,
vielleicht interessiert dieser Wunsch aber jemanden der helfen kann.
Gerd
Uwe Schmidt
Hallo,
vielen Dank für dieses Projekt.
Hat auch auf Anhieb geklappt. Nur einen Fehler hab ich- ich bekomme noch auf einen Lautsprecher den Ton. Wenn ich den anderen Verstärker anstecke( den mit dem 470k Widerstand) dann gibt es nur lautes Geschäpper. Die Verdrahtung hab ich mehrmals überprüft, auch die Verstärker getauscht – ohne Ergebnis.
Man kann schon mit einem Lautsprecher leben, aber es muss ja funktionieren. Am Sketch kann es wohl kam liegen, das ging alles ohne Probleme.
Vielleicht hat ja noch jemand eine Idee was das sein könnte, ich währe jedenfalls sehr dankbar.
Beste Grüße Uwe
Konrad
@Horst Mayer:
1. Das mit dem 2 zeiligen Display mit Laufschrift würde mich sehr interessieren. Bitte gerne hier posten. Vielen Dank.
2. Versorgung mit „Battery Expansion Shield 18650“: Auch das würde mich brennend interessieren. Das Produkt habe ich mir auch zugelegt; – bin aber als selbst definierter Anfänger nicht so richtig klar gekommen damit. Auf Nachfrage an AZ, mehr Daten / Hintergrundinfo dazu zu erhalten habe nicht so viel erhalten. Auch hier gerne mal eine Verdrahtung, gerne mit Erläuterung. Großes Danke auch hier.
@Hr. Lechner: In wieweit macht es nicht schon Sinn, den Flash nun mit zu verwenden? Testweise habe ich es schon mit Erfolg gemacht. ( Siehe auch fipsok.de). Das Hochladenden des Programmes dauert inzwischen bei mir ca. 15 Minuten (im Wiederholungsfall – also nicht beim ersten Mal; – da ist es ja noch länger)! Bei nur kleineren Änderungen im Programm macht das jetzt schon keine Freude
Einfach ein Supertolles Projekt. Und wenn das Ganze dann mit SD-Card (mp3 -Player), Wecker und Touchscreen final gemacht wird…… Woh!!
Wenn jemand dazu dann noch die slt Datei für einen 3D Druck zur Verfügung stellt, würde dich schon von Schwarmintelligenzprojekt reden.
Grüße
Konrad
Thommy
@ Achim Agster: Vielleicht hat dein Display eine andere I2C Adresse? Standard bei “display.ino” ist 0×27 diesen Wert kannst du ändern.
Mein Display hatte z.B. die Adresse 0×3f.
Du kannst aber auch testen welche Adresse dein Display hat. Dazu bitte folgendes Script auf deinen ESP32 flashen und dann im Serialmonitor nachschauen. Die Adresse notieren, dann in der display.ino eintragen und den Radiocode flashen:
// -—————————————————-
// i2c_scanner
//
// Version 1
// This program (or code that looks like it)
// can be found in many places.
// For example on the Arduino.cc forum.
// The original author is not know.
// Version 2, Juni 2012, Using Arduino 1.0.1
// Adapted to be as simple as possible by Arduino.cc user Krodal
// Version 3, Feb 26 2013
// V3 by louarnold
// Version 4, March 3, 2013, Using Arduino 1.0.3
// by Arduino.cc user Krodal.
// Changes by louarnold removed.
// Scanning addresses changed from 0…127 to 1…119,
// according to the i2c scanner by Nick Gammon
// https://www.gammon.com.au/forum/?id=10896
// Version 5, March 28, 2013
// As version 4, but address scans now to 127.
// A sensor seems to use address 120.
// Version 6, November 27, 2015.
// Added waiting for the Leonardo serial communication.
//
//
// This sketch tests the standard 7-bit addresses
// Devices with higher bit address might not be seen properly.
//
#include
void setup()
Serial.begin(9600); while (!Serial); // Leonardo: wait for serial monitor Serial.println(“\nI2C Scanner”);{
Wire.begin();
}
void loop()
Serial.println(“Scanning…”); nDevices = 0; for(address = 1; address < 127; address++ ) { // The i2c_scanner uses the return value of // the Write.endTransmisstion to see if // a device did acknowledge to the address. Wire.beginTransmission(address); error = Wire.endTransmission(); if (error == 0) { Serial.print(“I2C device found at address 0x”); if (address<16) Serial.print(“0”); Serial.print(address,HEX); Serial.println(" !"); nDevices++; } else if (error==4) { Serial.print(“Unknown error at address 0x”); if (address<16) Serial.print(“0”); Serial.println(address,HEX); } } if (nDevices == 0) Serial.println(“No I2C devices found\n”); else Serial.println(“done\n”); delay(5000); // wait 5 seconds for next scan{
byte error, address;
int nDevices;
}
Gerald Lechner
@Achim Agster: Nachdem es beim Kompilieren keinen Fehler gab, nehme ich an, die LCD-Library ist die richtige. Ich habe vielmehr die Vermutung, dass der Kontrast nicht richtig eingestellt ist. Drehen Sie mal am blauen Potentiometer auf der I2C Adapter Platine.
Siegfried
@ Achim Agster: in der Bibliotheksverwaltung gibt es von Marco Schwartz die Version 1.1.2 „LiquidCristal I2C“ , die hatte ich genutzt
Gruß Siegfried
Achim Agster
Hallo Herr Lechner,
danke für das geniale Projekt. Ich suche schon länger ein minimalistisches Internetradio – dieses hier finde ich klasse.
Ich hab das Radio schrittweise aufgebaut. Momentan ist alles angeschlossen bis auf die beiden Encoder.
Es steigt schon mal kein Rauch auf ;-)
Es kommt sogar Musik und die Webseite meldet sich wie gewünscht.
Ich hab’ nur ein Problem: Das Display zeigt nichts an.
Lötfehler habe ich ausgeschlossen.
Ich verwende ide Library LiquidCrystal I2C von Frank de Brabander Version 1.1.2 (So die Anzeige im Library Manager)
Installiert habe ich die Library manuell nach Download von Github.
Die hat es mir angezeigt als ich nach der von Marco Schwartz gesucht habe. Das repository ist allerdings umgezogen zu John Rickman.
Verwende ich die richtige Library ?
Woran kann es noch liegen ?
Horst Mayer
Zunächst ein herzlicher Dank an Herrn Gerald Lechner für dieses tolle Projekt. Vom Sound her ist das mit dem externen I2S Verstärker ja ein ganz gewaltiger Fortschritt gegenüber den internen 8 Bit DACs in der ersten Ausführung.
Aber da es immer noch etwas zu verbessern und weiter zu entwickeln gibt, die folgenden Anmerkungen:
1. „Die Versorgung über Akku wurde weggelassen, da der Stromverbrauch zu hoch war.“ kann ich nicht nachvollziehen. Statt den beiden Modulen „Laderegler und DC/DC Step Up Converter“ habe ich zur Versorgung ein „Battery Expansion Shield 18650“ (gibt es auch bei AZ-Delivery) verwendet. Das vereint beide Funktionen und das Radio spielt damit Stundenlang ohne aufladen.
2. Entgegen dem bzw. zusätzlich zu dem Verdrahtungsplan habe ich den ungenutzten Push Button (SW) des Lautstärke Encoders an den naheliegenden P12 für eine spätere Verwendung angeschlossen. Später habe ich sogar fest gestellt, dass dies in der SW in gain.ino gar auch schon mit „#define ROTARY_ENCODER_BUTTON_PIN 12“ vorgesehen ist. Mit dem high Pegel des nicht gedrückten Push Buttons bootet der ESP32 aber nicht. P12 ist dafür also nicht geeignet und kann zu einer langen Fehlersuche führen.
3. Der externe PullUp nach 3V3 ist bei meinen Rotary Encodern schon auf der Trägerplatine vorhanden. Der externe PullUp ist dann entbehrlich. Doppelt schadet hier aber nicht.
4. Mit der Frage nach dem Pegel-Übergang vom ESP32 mit 3,3 V nach dem Display mit 5 V hat Herr Klaas nicht ganz Unrecht. Für reine Digitalsignale mit TTL-Pegel von 3,3 V nach 5 V ist das unkritisch, wie Herr Lechner in seiner Antwort direkt danach ausgeführt hat. Hier ist der Pegelübergang aber am I2C-Bus. Da wird der I2C Port-Expander am Display mit 5 V und der ESP mit 3,3 V betrieben und die die SDA-Leitung am I2C ist bidirektional. Genau genommen gehört da ein I2C Level Shifter rein. Ich bin das Problem dadurch umgangen, dass ich ein 3,3 V Display verwende und daher alles an 3,3 V betreibe.
5. Die Lautstärkeanzeige mit
lcd.print(" “);
lcd.setCursor(18,0);
lcd.print(g);
zeigt die ein oder zweistellige Lautstärke unschön linksbündig an.
Schöner geht es wie folgt:
if (g < 10) lcd.print(”0");
lcd.print(g);
Also bei Werten von 0 bis 9 ein führende Null oder, wer will, kann auch ein Leerzeichen nehmen, und dann einstellig die Lautstärke und 2 Stellige Werte 1:1 auf die beiden Stellen.
6. Die Drehrichtung des Sender Rotary Encoders ist falsch herum. Eine Rechtsdrehung führt zu niedrigeren statt (wie zu erwarten) höheren Stationsplätzen. Ändern kann man dies durch Vertauschen der Leitungen an den Pins 32 und 33 am ESP32 oder durch entsprechende Anpassung der defines für ROTARY_ENCODER_A und ROTARY_ENCODER_B in rotary.ino (hier ebenfalls 32 und 33 untereinander tauschen)
7. Vermutlich durch Rundungsfehler erzeugt die Lautstärke 1 genauso wie Lautstärke 0 absolute Stille im Lautsprecher. Abhilfe: „float v = curGain / 100.0;“ –> „float v = (curGain + 1) / 100.0;“ in audio.ino.
8. Der String „char title64; //character array to hold meta data message“ im Hauptprogramm ist zu vergrößern, z.B. zu verdoppeln, da die ausgestrahlten Meldungen teilweise länger als 64 Zeichen sind. Bei BR24 habe ich schon über 100 gesehen.
9. Die im Programmlauf asynchrone Ausgabe von Datum und Uhrzeit alle 60 s ist unglücklich ausgeführt und kann dazu führen, dass die angezeigte Zeit um fast eine Minute nachgehen kann. Wird die Zeitanzeige gerade in der 59. Sekunde aktualisiert, bleibt diese falsche Zeit über die Folgeminute falsch stehen. Hier wäre eine Synchronisation auf den Wechsel der „echten“ Zeit angebracht, also die Ausgabe immer dann, wenn ein Wechsel der Minute erkannt wird. Das führt auch nur zu einer Ausgabe pro Minute, aber eben zum richtigen Zeitpunkt.
10. Da 2 Zeilen zu je 20 Zeichen, insgesamt also 40 Zeichen nicht reichen und der Zeilenumbruch beim nächst gelegenen Leerzeichen auch kritisch ist, habe ich die Textausgabe als Laufschrift in einer Zeile realisiert. (dies u.a. weil ich ein 2 zeiliges Display verwendet habe). In der oberen Zeile: Lautstärke, Lautsprechersymbol und dann die Station im Wechsel mit der Zeit. Und in der zweiten Zeile die Textmeldung, bis 20 Zeichen statisch bis zum nächsten Wechsel, bei mehr als 20 Zeichen als Laufschrift. Die Codeänderungen dazu sind etwas zu umfangreich für diese Aufzählung. Auf Wunsch kann ich sie aber in einem separaten Posting nachreichen.
Unabhängig von dieser Aufzählung habe ich kein Gehäuse gedruckt, sondern nach alter Väter Sitte (Bohrer, Fräser etc.) das Radio in eine alte 5 ¼ Diskettenbox aus Kunststoff eingebaut und damit einen Look ähnlich einem alten Autoradio erreicht. (rechts und links ein Drehknopf auf der schmalen Seite und dazwischen das Display) Ein Bild davon kann ich hier wohl nicht posten, aber gerne zur Veröffentlichung am Ende des Beitrags zur Verfügung stellen.
Gruß Horst Mayer
Siegfried
Hallo an Alle,
ich habe das Radio mit dem Display nach Andreas Kühn aufgebaut. Jetzt möchte ich mit einen größeren Display probieren und dazu müssen die Einstellungen in der Display.ino geändert werden. Hat dieses schon mal jemand gemacht und kann Unterstützung geben, an welchen Stellen und welche Werte.
Vielen Dank an Gerald und Herrn Kühn.
Siegfried
Achim Kleine
@ Andreas
Habe das nun auch mit dem PCM5102 umgesetzt, funktioniert bei mir, wenn auf der Bestückungsseite die Brücke SCK gesetzt wird.
Gab dazu im Netz eine Beschreibung, da auf der Platine noch mehr Brücken auf der Rückseite sind hab ich das mal hier kopiert.
https://raspberrypi.stackexchange.com/questions/76188/how-to-make-pcm5102-dac-work-on-raspberry-pi-zerow
“On the front (component side) there is one pair of pads which may be bridged to tie the SCK (system clock) low.
This will force the PCM510x to generate the system clock using its internal PLL.
You may bridge these pads to remove the need for an external SCK or connect the SCK pin to ground (0V).
The Raspberry Pi does not supply a system clock so this will be required to connect to the Raspberry Pi.
On the back (non-component side) there are 4 sets of 3 pads for the 4 functions:
FLT – Filter select : Normal latency (Low) / Low latency (High) DEMP – De-emphasis control for 44.1kHz sampling rate: Off (Low) / On (High) XSMT – Soft mute control(1): Soft mute (Low) / soft un-mute (High) FMT – Audio format selection : I2S (Low) / Left justified (High)The centre pad is connected to the corresponding pin. Each of these function pads may be bridged with solder either high or low (or the pins connected to +3.3V / 0V).
(My board is supplied with 1, 2 & 4 bridged low and 3 bridged high, i.e. normal latency filter, 44.1kHz de-emphasis disabled, soft-mute not asserted, I2S audio format.)
The normal filter is an FIR with good response, delaying the signal by approx. 500us (at 44.1 kHz) which should be fine. The fast filter is an IIR with slightly poorer response and delays the signal approx. 80us. Very few (if any) audio sources have pre-emphasis applied so DEMP should be low. The XSMT pin would allow muting of the output via a GPI (if the solder bridge was removed).
Raspberry Pi supports I2S bitstream so FMT should be low."
Bei meinem Board waren alle Rückseitigen Brücken korrekt gesetzt, einzig SCK auf der Vorderseite musste gelötet werden.
Gerald Lechner
@Andreas: Es sollte mit dem PCM5102 auch funktionieren. Nachdem Sie die Definition der Pins geändert haben, nehme ich an, dass Sie die den PCM5102 dann auch entsprechend angeklemmt haben. Datenleitung an Pin 25 rechts/links Umschaltung an Pin 26 und den Bittakt an Pin 27.
Bezüglich Titel/Interpret.
Im File audio.ino gibt es die Funktion MDCallback, die Metadaten im Stream findet und falls es ein Titel ist die Nachricht in die globale Variable title speichert. Außerdem muss das Flag newTitle auf true gesetzt werden. In der Hauptschleife im File webradio_MAX.ino wird dieses Flag abgefragt. Falls es gesetzt ist, wird die Funktion displayMessage2(2,title) aufgerufen, die den Titel ab der dritten Zeile anzeigt. Diese Funktion befindest sich im File display.ino. Es könnte auch sein, dass die Station, die Sie edmpfangen keine Metadaten mitsendet. Aber ich nehme an, dass Sie verschiedene Stastionen versucht haben.
Andreas
Hi Gerald,
super Nummer mit der neuen Soft.
Leider macht der PCM5102 den ich nutze, nur geschtotter.
So angeklemmt: #define DOUT 25, #define LRCLK 26, #define BCLK 27.
Leider kein Titel und Interpret im Display.
Gruß
Andreas
Konrad S.
Hallo Herr Lechner,
absolut tolles Projekt. Speziell mit der überarbeiteten Codevariante. Die kurzen “Abhacker” sind nun weg! Toll.
Auch dass man die Senderliste umnummerieren kann; – Klasse!
Gestern habe ich von meinem Schwager dann den 3D Druck bekommen. Alles passt jetzt. Wahnsinn. Ich bin total begeistert.
Es gibt somit von meiner Seite fast nichts mehr zu verbessern (eigentlich Schade).
Kleiner Hinweis: OTA habe ich mal ausprobiert. So richtig hat es nicht geklappt. Auch wenn ich das Passwort “radioupdate” eingegeben habe; – nach einer gefühlten halben Stunde mit Warten habe ich abgebrochen und habe das Radio aufgeschraubt und über die übliche USB und serielle Schittstelle hochgeladen; ohne Probleme. Hätte ich noch länger warten sollen?
Weitere Frage: Gibt es zum TFT Display auch eine 3D Druck Datei? Würde mich auch interessieren.
Bezüglich der Platine habe ich schon eine email an Sie geschrieben.
Danke aus dem Süden der Republik
Konrad
Riemi
Hat noch jemand eine alternative für die Lautsprecher um noch bessere Qualität zu haben?
Siegfried
Hallo in die Runde,
gibt es hier einen „Mitbauer“, der das Design auf eine Platine zaubern wird und diese evtl. auch produzieren lässt. Ich hab die Variante mit dem 1,8“ Display und würde mich da finanziell beteiligen.
Rutscht gut ins Jahr 23
Vielen Dank an Gerald und das AZ Team
Ulrich Klaas
Hallo,
mich haben noch ein paar Sachen beim Tuning gestört und deshalb habe ich rotary_loop() etwas geändert.
1) Wenn ein Sender läuft und man sucht durch wählt den Sender dann aber nicht an springt die Anzeige ja wieder auf den aktiven Sender.
Das ist schön. Nur wenn man wieder tunen will geht es diesmal nicht von dem eingestellten Sender weiter sonder von da wo man beim
letzten mal aufgehört hat.
2) Hat man mehrere deaktivierte Sender oder halt am Ende der Liste viele noch nicht definierte so wird der nächste aktivierte angezeigt nur man
muss halt n-mal weiter drehen (also über alle deaktivierten) bis sich die Anzeige wieder ändert.
3) Da ist auch ein Bug drin : Will man rückwärts über einen deaktivierten Sender drehen hängt die Anzeige ! Man kann nur noch vorwärts drehen.
So sieht meine modifizierte rotary_loop() aus :
//handle events from rotary encoder
//called from main loop
uint8_t changedByCode = false;
void rotary_loop()
disabledStations = false; if (changedByCode) { // Value changed by my changes (uk) do not retrigger and clean event rotaryEncoder.encoderChanged(); changedByCode = false; } else { //don’t do anything unless value changed if (richtung = rotaryEncoder.encoderChanged()) { Serial.print(“Encode changed. Richtung:”);Serial.println(richtung); uint8_t cnt = 0; //overflow counter, prevents endless loop if no station is enabled v = rotaryEncoder.readEncoder(); while ((!stationlist[v].enabled) && (cnt < 2)){ disabledStations = true; if ((richtung > 0) && (richtung != STATIONS)) // STATIONS means from 0 to 45 backwards ! { v++; if (v >= STATIONS){ v=0; cnt++; } } else { v—; if (v < 0) { v = STATIONS – 1; cnt++; } } } //set new currtent station and show its name if (v < STATIONS) { curStation = v; showStation(); if (disabledStations) { // found di//no event to handle. rotaryEncoder.encoderChanged() triggers on thissabled stations → correct rotary to jump over rotaryEncoder.setEncoderValue(curStation); //set encoder to the found station changedByCode = true; //no event to handle. rotaryEncoder.encoderChanged() triggers on this } lastchange = millis(); } } //if no change happened within 10s set active station as current station if ((lastchange > 0) && ((millis()-lastchange) > 10000)){ curStation = actStation; lastchange = 0; showStation(); rotaryEncoder.setEncoderValue(actStation); //start tuning from here again changedByCode = true; //no event to handle. rotaryEncoder.encoderChanged() triggers on this } //react on rotary encoder switch if (rotaryEncoder.isEncoderButtonClicked()) { //set current station as active station and start streaming actStation = curStation; pref.putUShort(“station”,curStation); if (!startUrl(String(stationlist[actStation].url))) { //if start fails we switch back to station 0 actStation = 0; startUrl(String(stationlist[actStation].url)); } //call show station to display the speaker symbol showStation(); } }{
int16_t v;
uint8_t disabledStations;
int16_t richtung;
}