Have a beautiful antique radio that’s beyond repair? This ESP8266 based Internet radio by [Edzelf] would be an excellent starting point to get it running again, as an alternative to a Raspberry-Pi based design. The basic premise is straightforward: an ESP8266 handles the connection to an Internet radio station of your choice, and a VS1053 codec module decodes the stream to produce an audio signal (which will require some form of amplification afterwards).
Besides the excellent documentation (PDF warning), where this firmware really shines is the sheer number of features that have been added. It includes a web interface that allows you to select an arbitrary station as well as cycle through presets, adjust volume, bass, and treble.
If you prefer physical controls, it supports buttons and dials. If you’re in the mood for something more Internet of Things, it can be controlled by the MQTT protocol as well. It even supports a color TFT screen by default, although this reduces the number of pins that can be used for button input.
The firmware also supports playing arbitrary .mp3 files hosted on a server. Given the low parts count and the wealth of options for controlling the device, we could see this device making its way into doorbells, practical jokes, and small museum exhibits.
To see it in action, check out the video below:
[Thanks JeeCee]
remind me similar project based on esp8266 and VS1053 – https://github.com/karawin/Ka-Radio
Or on hackaday https://hackaday.io/project/11570-wifi-webradio-with-esp8266-and-vs1053 ;-)
That uses rtos, this uses arduino, I found edzelf’s project more enjoyable to hack around with also streamed higher bitrate samples better for me. The max I could get streaming on ka-radio was 24kbps not sure why.
I play 320Kbps without problem.
Wonder if there was bug fixes since I was testing it out. I basically abandoned ship after getting no response here maybe I should have done another issue for it https://github.com/karawin/Ka-Radio/issues/24 maybe you can help? I was already on to esp-radio by then and was able to hack in IHeartRadio streams into it which was so my partner could listen to their hometown radio station they loved which they couldn’t get where we are now.
I see
extraram state: 1 0x30 0123456789ABCDEF
So your external ram is detected.
What is your problem?
I made 4 karadio without problem.
The problem when I was testing it says in 3rd post down before the debug output
”
Seems it detects it fine, I guess I just expected too much, that it was going to solve the constant stutter
Any way to figure out what is wrong with any streams above 24kbps.
Using an Adafruit Huzzah (ESP8266).
50Mbps connection, any way to do a speed test on the module?
”
I’ll have to recompile the latest code and see if it’s still the case. Do you run the processor @80MHz or 160MHz?
80 MHz is enough for 320 Kbps
Sprite_tm made something similar that uses the ESP8266 itself for decoding, but it has no web interface (nearly all the chip’s RAM is used for the MP3 decoder, and it uses an external RAM chip for buffering).
Here’s the link for anyone interested: https://github.com/espressif/ESP8266_MP3_DECODER
Edzelf’s uses no ext ram just an internal ring buffer.
If it has to have a web interface, then I want this:
http://radio.garden/live/port-louis/radiomoris/
:o)
Awesome!!! Absolutely a good example of human-machine-interface efficiency, thanks for the link.
I helped add IHeartRadio streams to it, that interface may be a bit memory hungry for the esp8266, very neat idea.
You dont really need the VS1053.
if you settle for mono audio you get a 44.1KHz 16bit PDM-DAC straight on the i2s output.
https://janostman.wordpress.com/audio-hacking-with-the-esp8266/
nice links you got there, leading straight to paypal checkout instead of some webshop
Tried to get both esp-radio & ka-radio projects to add mono dac output like esp8266encoder was doing, both shot me down with it’s not worth the extra effort and doesn’t sound very good.
I’d say you did something wrong if my PDM didnt work.
Its the same algorithm used by PDM microphones, however at 3MHz bitrate instead of 1.4MHz.
But it does sound good.
I like the MQTT feature as it allows you to have audio announcements of events in a smart house, regular time and weather reports plus door bell, email notification. I wonder if you could add RFID so that you could log your presence as you entered a room and have your notifications and music follow you around.
Also liked MQTT as why I was attracted to this code base, hacked around with the code to make it work with OpenHAB with MQTT control interface was lot’s of fun to get working. Over killed the mqtt memory constraints though with too much information.
https://gist.github.com/NonaSuomy/e50cfdf079fe1bbbcac30a381e34fd93
I also wanted to send audio prompts to it for notifications from openhab like “hello family, it’s after 10PM your garage door is still open would you like me to close it?” Etc… I did a sample test with online tts engines found out there is a max url size you can send it ~100 chars, then found out you can use POST instead and that allows for longer sentences.
https://gist.github.com/NonaSuomy/8a41816defe7b3d918c147d9d274c101
So that is a fun possibility to feed it any text you want like that or similar.
You could do some openhab scripting to get your rfid working like that, “sounds” pretty straight forward, interesting idea.
Here is what the MQTT controls looked like after hacking around. https://github.com/Edzelf/Esp-radio/issues/77
My mouse wheel is dead because of you.
B^)
haha you’re welcome? I didn’t realize HaD auto generates embedded GIST windows for GIST links as all I did was put the URL in the post :D
Just to note, may want to add to the article that edzelf also ported his work to the ESP32 https://github.com/Edzelf/ESP32-Radio
Kinda meh that he still uses a hardware mp3 decoder. The ESP8266 already was pretty capable of decoding mp3s at 80MHz (the mp3 decoder was limited to mono because of memory usage); the ESP32 can do stereo MP3s at any rate while still idling its CPUs most of the time.
Hey Sprite_tm love all you do! Any PoC for that or was that a coming hint of a project? ;)
Would it be plausible to do AAC in the same way, as most radio stations stream with this format now. MP3 seems to be going the way of the Dodo bird and that encoder ic basically supports almost every format with upgrade possibilities to more formats. It will also encode audio as well to those formats. Would be cool to see someone do a massive roundup of decoding every possible audio format on the fly for the ESP. Probably legal concerns but would be interesting.
VS1053 – Ogg Vorbis / MP3 / AAC / WMA / FLAC / MIDI Audio Codec Chip
Introduction
VS1053 is a versatile “MP3 decoder chip” belonging to VLSI Solution’s extensive slave audio processor family. In addition to being able to decode all the most common audio formats – including the advanced features of newer AAC files – functionality of this IC can be greatly expanded just by loading a bit of extra software to its RAM memory. In addition to being able to decode all major audio formats, VS1053 is capable of recording in three different audio formats, from lossless 16-bit PCM to highly compressed, yet high-quality Ogg Vorbis files. For the best headphone listening experience the VS1053 includes EarSpeaker spatial processing which accurately simulates how a room with stereo loudspeakers would sound. This option can naturally be turned off when required. All in all, VS1053 is an easy-to-use, powerful workhorse for audio playback and recording applications.
Features
Decodes multiple formats
Ogg Vorbis
MP3 = MPEG 1 & 2 audio layer III (CBR+VBR+ABR)
MP1 & MP2 = MPEG 1 & 2 audio layers I & II optional
MPEG4 / 2 AAC-LC(+PNS), HE-AAC v2 (Level 3) (SBR + PS)
WMA4.0/4.1/7/8/9 all profiles (5-384 kbps)
FLAC lossless audio with software plugin (upto 24 bits, 48 kHz)
WAV (PCM + IMA ADPCM)
General MIDI 1 / SP-MIDI format 0
Encodes three different formats from mic/line in mono or stereo
Ogg Vorbis with software plugin
IMA ADPCM
16-bit PCM
Streaming support
EarSpeaker Spatial Processing
Bass and treble controls
Operates with a single 12-13 MHz or 24-26 MHz clock
Internal PLL clock multiplier
Low-power operation
High-quality on-chip stereo DAC with no phase error between channels
Zero-cross detection for smooth volume change
Stereo earphone driver capable of driving a 30 ohm load
Quiet power-on and power-off
I2S interface for external DAC
Separate voltages for analog, digital, I/O
16.5 KiB on-chip RAM for user code and data
Serial control and data interfaces
Can be used as a slave co-processor
SPI flash boot for special applications
UART for debugging purposes
New functions may be added with software and up to 8 GPIO pins
There is a newer IC they offer now as well but have not seen it on the cheap dev board Chinese markets yet. http://www.vlsi.fi/en/products/vs1063.html
The new ESP32 already has bluetooth, so i guess it can be used as bluetooth speaker. Idealy BT speaker that can receive audio from multiple BT sources and mix them together.
While simultaneously working as pulseaudio sink.
VS1053 – Ogg Vorbis / MP3 / AAC / WMA / FLAC / MIDI Audio Codec Chip
unveiling
VS1053 is a versatile “MP3 decomputer coder chip” belonging to VLSI solution’s extensive slave audio CPU category.
Features
Decomputer codes multiple data formats
Ogg Vorbis
MP3 = MPEG 1 & 2 audio stratum III (CBR+VBR+ABR)
MP1 & MP2 = MPEG 1 & 2 audio stratums I & II optional
MPEG4 / 2 AAC-LC(+PNS), HE-AAC v2 (Level 3) (SBR + PS)
WMA4.0/4.1/7/8/9 all profiles (5-384 kbps)
FLAC lossless audio with software package plugin (upto 24 bits, 48 kHz)
WAV (PCM + IMA ADPCM)
General MIDI 1 / SP-MIDI data format 0
Encomputer codes three unlike data formats from mic/line of business in mono or stereo
Ogg Vorbis with software package plugin
IMA ADPCM
16-bit PCM
Streaming sustenance
EarSpeaker Spatial Processing
Bass and treble commands
Operates with a exclusive 12-13 MHz or 24-26 MHz clock
Internal PLL clock multiplier
Low-power functioning
High-quality on-chip stereo DAC with no phase fault between channels
Zero-cross spotting for legato bulk variety
stereoscopic photograph earphone device driver adequate to(p) of driving a 30 ohm lading
hushed power-on and power-off
I2S interface for extraneous DAC
separate voltages for analogue, digital, I/O
16.5 KiB on-chip RAM for drug user computer code and data
in series(p) command and data interfaces
Can be used as a slave co-CPU
SPI photoflash iron heel for peculiar(a) applications
UART for debugging purposes
New functions may be added with software package and up to 8 GPIO pins
Fine project. Flashed my ESP8266f, used the AP to connect to my WiFi. Music plays, In serial console I can see some info, but I am not able to send commands via serial to the ESP. Also I am not able to connect to the WebInterface. maybe i have overseen a little bit ?!?
you can buy the PCB made for this project from here:
https://www.tindie.com/products/masihvahida/esp8266-internet-radio/
I am in a middle of this project originally from this guy
https://www.youtube.com/watch?v=1q8UP5HhdpM&t=9s
I am stuck – it reboot on and on and on giving me an ‘exception 18’ and it repeats itself and not selecting my wifi
Any help?
Regards
Erik Hoffman