close-circle
Close
0%
0%

WiFi Webradio with ESP8266 and VS1053

A wifi web radio player with only low costs boards.
KaRadio, listen the world.

Similar projects worth following
close
Control with any browsers (ie edge, chrome mozilla etc...).
or with an external hardware panel or with the uart interface or with telnet.
Memory for 255 stations
OTA (On the Air) upgrade,
Read direct mp3 or ogg or WMA streams or playlist .pls .m3u, asx and .xspf
Read up to a 320 kb/s stream,
Embedded wifi configuration via the web or serial or telnet.
Metadata displayed (ie Title of the current song if given in the stream),
Permanent setting (sound setting, stations, wifi)
Server multi clients with automatic refresh (websocket),
The stations may be downloaded and uploaded within the web site,
Stations sort management by drag drop.
very quick responsive web by caching local information in the browser and websocket.
additional hardware: a led indicates the state of the equipment
Optional: control switches, lcd display, additional ram for buffering

See http://www.instructables.com/id/Wifi-Webradio-With-ESP8266-and-VS1053 for the description of the minimal prototype.

See Github for sources

See the lcd +IR software's on Github AddOn

See some realizations of users at KaraDio

A nice telnet+IR extension from Gábriel Kovács gabeszakem@gmail.com: ESP8266-WiFi-UART-Bridge-master.zip

A nextion touchscreen display for KaraDio from yo2ldk : Here

For more informations or questions, you can enter to the Karadio facebook group


Release 1.6.1

Built on 2017/09/17

New:

  • 1.6.1: Click on header to rewind to the top of a page.
  • Header stays on top of the web page
  • gzipped html tranfert. More stable and improved speed
  • The page content follows the header size.

History:

history

Simplest prototype:

- Optional external ram (23LCV1024) support (1:CS/=GPIO16 2:MISO=GPIO12 3:NC 4:GND 5:MOSI=GPIO13 6:SCK=GPIO14 7:GND 8:3.3v)

Attention:
The optional led is now on GPIO2. The blue led on the ESP8266 is blinking at the same rate.
GPIO16 is now the Chip select for the external ram if any.
The external ram is detected at boot time if present.

To upgrade to this release, please flash user1.4096.new.4.bin at 0x1000 ,
user2.4096.new.4.bin at 0X81000 and blank.bin at 0x7e000 & 0x3fe000
After that, all next updates are done with the On The Air (OTA) feature.
New binaries are hosted at http://karadio.karawin.fr .

Loading the esp8266

First use

  • If the access point of your router is not known, the webradio initializes itself as an AP. Connect your wifi to the ssid "WifiWebRadio",
  • Browse to 192.164.4.1 to display the page, got to "setting" "Wifi" and configure your ssid ap, the password if any, the wanted IP or use dhcp if you know how to retrieve the dhcp given ip (terminal or scan of the network).
  • In the gateway field, enter the ip address of your router.
  • Validate. The equipment restart to the new configuration. Connect your wifi to your AP and browse to the ip given in configuration.
  • Congratulation, you can edit your own station list. Don't forget to save your stations list in case of problem or for new equipments.
  • if the AP is already know by the esp8266, the default ip at the first start is 192.168.1.254
  • a sample of stations list is on https://github.com/karawin/Ka-Radio/blob/master/ESP8266-Firmware/WebStations.txt . Can be uploaded via the web page.

Feedback

Please tell me if you succeeded or something more can be done, thanks.
The second step will add some hardware buttons (vol + -, station + -, play ...)

Wiring:

From ESP8266_ESP12( 3.3 v) or nodeMCU(5v) to VS1053 (5 v)

REST

ADC

CH_PD to 3.3v

GPIO16 (a 1Hz output)

D5:GPIO14 to VS1053 SCK

D6:GPIO12 to VS1053 MISO

D7:GPIO13 to VS1053 MOSI

TXD to CH340G UART rx

RXD from CH340G UART tx

D1:GPIO05 to VS1053 XDCS

D2:GPIO04 to VS1053 DREQ

D3:GPIO00 to VS1053 XRST

GPIO02

D8:GPIO15 to VS1053 XCS

octet-stream - 368.13 kB - 09/17/2017 at 10:26

download-circle
Download

octet-stream - 368.13 kB - 09/17/2017 at 10:26

download-circle
Download

octet-stream - 3.98 kB - 09/17/2017 at 10:26

download-circle
Download

octet-stream - 4.00 kB - 07/21/2016 at 15:19

download-circle
Download

esp_init_data_default.bin

Must be written only one time.

octet-stream - 128.00 bytes - 07/21/2016 at 15:18

download-circle
Download

View all 6 components

View all 11 project logs

  • 1
    Step 1

    Wiring:

    From ESP8266_ESP12( 3.3 v) or nodeMCU(5v) to VS1053 (5 v)

    REST:

    ADC : gound if control panel not used

    CH_PD to 3.3v

    GPIO16 led output

    D5:GPIO14 to VS1053 SCK

    D6:GPIO12 to VS1053 MISO (or so)

    D7:GPIO13 to VS1053 MOSI (or si)

    TXD to CH340G UART rx

    RXD from CH340G UART tx

    D1:GPIO05 to VS1053 XDCS

    D2:GPIO04 to VS1053 DREQ

    D3:GPIO00 to VS1053 XRST

    GPIO02

    D8:GPIO15 to VS1053 XCS

  • 2
    Step 2

View all instructions

Enjoy this project?

Share

Discussions

archetix wrote 01/19/2017 at 13:52 point

Hello I want to commend this great project.
I have a suggestion for a configuration option GPIO2
such as switch power amplifier
could be a useful function (standby mode)
Thank you...


  Are you sure? yes | no

Thomas wrote 01/20/2017 at 04:59 point

Hi Archetix, 

i also tried to use  a Pam based amplifier beacause it is very cheap.

But i has very frustrating klicking when loudness is low. i guess your cirquit can eleminate that, right?

Regards

Thomas

  Are you sure? yes | no

jp cocatrix wrote 01/20/2017 at 16:33 point

Well done for the ground to avoid loop!

  Are you sure? yes | no

vis22 wrote 01/15/2017 at 20:10 point

Thank you for your project, it is allowed to breathe life into my boom-box.

  Are you sure? yes | no

jp cocatrix wrote 01/15/2017 at 20:53 point

You are welcome.

  Are you sure? yes | no

Sergio wrote 01/15/2017 at 14:59 point

The new updates, load into WEb browser more quickly than old versions.

  Are you sure? yes | no

jp cocatrix wrote 01/15/2017 at 15:42 point

Yes, a bug in the websocket corrected.

  Are you sure? yes | no

Richard wrote 01/12/2017 at 15:48 point

I am finding the Nokia 5110 display a little unreliable.  

I've changed the CLI baud rate to 28800 and the display shows the correct station data some of the time, but as you move through the stations, the display will stop updating. 

The CLI data is still being sent as I can monitor it. 

Is it worth trying a slower baud?

  Are you sure? yes | no

jp cocatrix wrote 01/12/2017 at 16:00 point

With karadioNokia5110 or karadioU8glib?

It is not normal, but yes try a slower baud.

If it stop to display any change after stopping, something is wrong in your soft or wiring.

  Are you sure? yes | no

Richard wrote 01/12/2017 at 17:10 point

This was with the older Nokia5110. I just tried the U8glib version, but it's failing to build as Arduino IDE 1.6.5 can't find the U8glib header files...

  Are you sure? yes | no

satbk_2 wrote 01/10/2017 at 16:53 point

Hi all. Please tell me how can I connect the LCD module to this radio? Which module can be connected? Thank you

  Are you sure? yes | no

jp cocatrix wrote 01/12/2017 at 16:06 point

  Are you sure? yes | no

mangup wrote 01/10/2017 at 08:05 point

Thanks for update!

  Are you sure? yes | no

Thomas wrote 01/10/2017 at 05:15 point

Morning JP,

thanks a lot for your work in Karadio and your newest update.

Now my stop button is working again :-)

Have a nice day

Thomas

  Are you sure? yes | no

polgrv wrote 01/08/2017 at 17:50 point

jp cocatrix,

thank you for what you've shared with us!

One note: both here and on the GitHub README.md you report 192.164.4.1 as setup page on the staring AP mode. For me was 192.168.4.1, but I've not changed anything in your files. Is it possible the published IP is wrong?

If it could be useful, to upload your files on the ESP working on Linux, I downloaded from GitHub esptool.py, I added the dependency to get it working, I copied in the esptool folder all the .BIN files and I just executed this shell command after I connected my NodeMcu board to the USB port:

python2.7 esptool.py --port /dev/ttyUSB0 write_flash -ff 40m -fm qio -fs 32m 0x00000 boot_v1.5.bin 0x01000 user1.4096.new.4.bin 0x81000 user2.4096.new.4.bin 0x7E000 blank.bin 0x3FE000 blank.bin 0xFC000 esp_init_data_default.bin 0x3FC000 esp_init_data_default.bin

This is my first running implementation (to replace the mono speaker I've already a small amp board and I've just to putt all in a box):

karadio_by_paolo

Boards from aliexpress, connection cable from an internal mainboard->front panel USB cable and a strip of female headers.

  Are you sure? yes | no

jp cocatrix wrote 01/20/2017 at 16:44 point

Hello,

I haven't see your message befor. Sorry.

Yes a mistale in the README. Corrected thanks.

Thanks for the shell. I add it in the next delivery.

  Are you sure? yes | no

Thomas wrote 01/08/2017 at 08:31 point

Since my first Radio is still not fully build up i did a second one for the father of my Girlfriend.

I buld it up in a small stereo speaker which is used available for approx. 12€ on A...zon.

You can recognize it on the blue light of life :)

et="_blank">

  Are you sure? yes | no

jp cocatrix wrote 01/08/2017 at 17:15 point

Well done!

  Are you sure? yes | no

ldv82 wrote 01/06/2017 at 19:17 point

jp cocatrix

I have a suggestion to add a button in the interface to reset the default tone. 

To reset the EQ settings.

  Are you sure? yes | no

jp cocatrix wrote 01/06/2017 at 20:41 point

ok, Easy ;-)

  Are you sure? yes | no

balaji wrote 12/29/2016 at 08:42 point

Hello, 

I liked your project very much. 

I have one question will this method work with Adafruits VS1053 mp3 codec
https://www.adafruit.com/product/1381


Thanks in advance

Balaji

  Are you sure? yes | no

Thomas wrote 12/28/2016 at 08:04 point

Hello together,

has anyone a idea how to play a local playlist, running on a computer in the own network?

I tried 192.168.2.176\radio\Madonna\Madonna.m3u

Im using Windows 7 and the folder is enabled for anybody

Regards

Thomas

  Are you sure? yes | no

jp cocatrix wrote 12/28/2016 at 09:16 point

M3U is a playlist. Edit it and don't forget to add 192.168.2.176\ before the real stream mp3 or ogg or other. Or simply call it with the direct mp3 name.

  Are you sure? yes | no

Thomas wrote 12/29/2016 at 07:13 point

Thanks for your hints but i did not catch it.

I have created a folder wit a mp3 in it   D:\1\1.mp3

Folder 1 is enabled as 1. So in my opinion the path should be:

192.168.2.176\1\1.mp3

If i enter this into a new station he doubles the last entered statoin from above.

Can you tell me what i have to enter exactly for my shown example?

Thanks

Thomas

  Are you sure? yes | no

ldv82 wrote 12/28/2016 at 11:58 point
"Stream What You Hear" program sends sound from your computer sound card to the stream, but does not work well with me. Still, you can use VLC player to make the flow of the local network. I liked the other way. Shoutcast-dsp-1-9-0-windows (Winamp plugin) and SHOUTcastGUI (a simple server). All that will be playing in Winamp, will be transferred to the stream network.

  Are you sure? yes | no

Thomas wrote 12/29/2016 at 07:16 point

Hi Idv82, i will try later.

First i will understand the other way

Regards

Thomas

  Are you sure? yes | no

jp cocatrix wrote 01/04/2017 at 15:11 point

No change on adc. The empty value is 1V, (I measured 0.98 on my proto)

The stop is at 0.19 here and play at 0.36

But it is possible to increase the range to 220. Ok

if ((adc >400) && (adc < 580)) // volume +
        {
            vol = VS1053_GetVolume();
            if (vol <244)
            {    
                vol+=10;    
//                printf("vol %d   vol1 %d\n",vol,vol1);                    
                sprintf(Vol,"%d",vol);
                setVolumew(Vol);
            }
        }
        else if ((adc >730) && (adc < 830)) // volume -
        {
            vol = VS1053_GetVolume();
            if (vol >10)
            {    
                vol-=10;
//                printf("vol %d   vol1 %d\n",vol,vol1);                    
                sprintf(Vol,"%d",vol);
                setVolumew(Vol);
            }
        }        
        if (!inside)
        {    
            if (adc < 200) // stop
            {
                inside = true;
                clientDisconnect();
            }
            else if ((adc >278) && (adc < 380)) //start
            {
                inside = true;
                sprintf(Vol,"%d",currentStation);
                playStation    (Vol);
            }
            else if ((adc >830) && (adc < 920)) // station+
            {
                inside = true;
                wsStationNext();
            }
            else if ((adc >590) && (adc < 710)) // station-
            {
                inside = true;
                wsStationPrev();
            }
        }

  Are you sure? yes | no

jp cocatrix wrote 12/29/2016 at 10:01 point

KaRadio is a http stream player. It doesn't know about the file system of another computer  nor embed nfs or CIFS or uPnP protocol above tcp/ip. To play a file from a pc you need to convert it to a stream. Vlc can do that or any html server like apache or https://sourceforge.net/projects/miniweb/ and many other. Karadio send a get to this server to receive the stream, that's all it can do.

Hope this help

  Are you sure? yes | no

Thomas wrote 01/04/2017 at 15:00 point

Ok, that was not clear to me but it is logical. Setting up a own server is on my todo list for near future, but not now.

Did you changed the ADC Value for STOP in 1.1.3 ?

Stop Button does not work anymore. I measured voltage on ADC Pin when Stop is pressed. It is 0,202V so ADC should be 197. Could the Value be set to 220 in next release?

Regards

Thomas

  Are you sure? yes | no

V-Man wrote 12/27/2016 at 18:38 point

Thanks for this beautiful Thing! 

I encounter something weird with the Alientek mp3 module: when I connect a headphone I get beautiful sound free of noise, but when I connect it to a either a small amplifier or the Aux of my stereo, I get only very bad sound or no sound at all. What could be happening here? Anyone experiencing this as well?

  Are you sure? yes | no

Thomas wrote 12/27/2016 at 20:24 point

Hi V-Man, 

Maybe you are using a Mono cable. Has it two Or three poles?

If two it maybe a Mono one. You need a Stereo one. If it is already Stereo, try a shielded one.

Also ist ist Not good to cascade two class D Amplifiers. 

If you realy need to, usw one with Differential Inputs such as MAX98306.

Regards

Thomas

  Are you sure? yes | no

V-Man wrote 12/28/2016 at 06:57 point

Thanks for your tips, Thomas!

My cable is certainly stereo, I'll have a look into using another amplifier, this might well be the problem......

V.

  Are you sure? yes | no

jp cocatrix wrote 12/28/2016 at 09:18 point

No problem here with alientek on headphone or aux entry of a hifi.

  Are you sure? yes | no

Antimaster wrote 12/24/2016 at 13:45 point

I've build the radion in a nice wood case. If some one can say me how to insert pictures i can show you my case.

  Are you sure? yes | no

Thomas wrote 12/27/2016 at 11:07 point

We woukd realy like toll See your Radio.

Upload your picture here and integrate Link into your Post here.

http://tinypic.com

Regards Thomas

  Are you sure? yes | no

mangup wrote 12/22/2016 at 22:12 point

Nice project. I made it! As a user I have opion that there is missing config for alternative wifi connection.  I made portable speaker with this webradio client and I am limited to small radius where is first of two AP that I have. Thanks to make this project and share with others!!!!

  Are you sure? yes | no

jp cocatrix wrote 12/22/2016 at 22:20 point

Thanks, It is in the todo list. If an AP is successfully connected, it will be added in an internal history list. If the equipment is moved away from the current AP, the list will be tried before the default AP. I have to improve the speed of the detection and make a not too long history of AP ;-)

  Are you sure? yes | no

mangup wrote 12/22/2016 at 22:25 point

Super! 

Thanks Dejan

  Are you sure? yes | no

mangup wrote 12/28/2016 at 00:16 point

I have one question. I don't understend function Monitoring in Main section. What that function do?
Thanks.

  Are you sure? yes | no

mangup wrote 12/30/2016 at 10:01 point

I found some bug. I make two webradio. One to play streeming on work and one for home (differend ip). I use phone to access and control both webradio. They don't have same playlist. But when I connect I have just last refreshed list from cache. Maybe we should each device to have its own id and through him to read his list from cache?

  Are you sure? yes | no

Thomas wrote 12/28/2016 at 08:06 point

With Monitoring you can hear the selected station on the device which is running the frontend. Try to access Karadio with you Mobile. Select a station press monitoring and increase the volume of your mobile. Then you will see.

Regards

Thomas

  Are you sure? yes | no

mangup wrote 12/28/2016 at 09:16 point

Thanks for explanation. Work how you said.

  Are you sure? yes | no

jp cocatrix wrote 12/30/2016 at 10:55 point

"I found some bug. I make two webradio. One to play streeming on work and
one for home (differend ip). I use phone to access and control both
webradio. They don't have same playlist. But when I connect I have just
last refreshed list from cache. Maybe we should each device to have its
own id and through him to read his list from cache?"

It should not be a problem if ip are different between both because the browser "local storage" for the stations cache is per ip.

What browser do you use on the mobile?

  Are you sure? yes | no

mangup wrote 12/30/2016 at 11:23 point

I try firefox and some integratet in samsung s4

  Are you sure? yes | no

totalizator wrote 12/20/2016 at 13:17 point

After upgrade to 1.1.3 I can no longer play my liquidsoap mp3 stream. Has something changed? When playing it in an external player I have to add http:// prefix but I can't add it here. It worked in 1.1.2. Any ideas?

  Are you sure? yes | no

jp cocatrix wrote 12/20/2016 at 13:22 point

remind me the url?

  Are you sure? yes | no

jp cocatrix wrote 12/21/2016 at 10:37 point

  Are you sure? yes | no

Thomas wrote 12/20/2016 at 14:43 point

Try to reimport your webstations.txt

This helped myself with non working stations after updating.

Regards

Thomas

  Are you sure? yes | no

jp cocatrix wrote 12/20/2016 at 15:28 point

or do a refresh local list to read again the station list from the esp to the browser.

  Are you sure? yes | no

totalizator wrote 12/20/2016 at 23:37 point

Thank you but none of this helped. The fact is that it stopped working after the upgrade but there is a positive outcome. I have been using Liquidsoap to stream music from Mopidy https://www.mopidy.com/ but apparently this is not the best choice for a streaming frontend so I have switched to Icecast. Few seconds to configure it like here http://desmart.com/blog/music-as-part-of-positive-work-environment and it works even better - it's very lightweight (Icecast, contrary to what I have thought) and the stream starts immediately now.

  Are you sure? yes | no

Thomas wrote 12/19/2016 at 11:01 point

No Ide if it is possible, but what is about a functionality to syncronise playback of two or more KaRadios?

Regards

Thomas

  Are you sure? yes | no

jp cocatrix wrote 12/20/2016 at 08:40 point

I don't think it is feasible due to the buffering technique of the stream. With equivalent memory the result may be acceptable but not perfect.

  Are you sure? yes | no

yo2ldk wrote 12/16/2016 at 06:31 point

Hi all radio fan !

 check this:

http://radio.garden/live/

  Are you sure? yes | no

jp cocatrix wrote 12/16/2016 at 08:04 point

Amazing. Thanks

  Are you sure? yes | no

totalizator wrote 12/18/2016 at 21:31 point

Check this attachment if you need "a few" radio stations urls: http://talk.maemo.org/showpost.php?p=1461456&postcount=46 There is like ...all of them.

  Are you sure? yes | no

Thomas wrote 12/19/2016 at 07:24 point

Hi Totalizator,

great, thanks a lot.

Thomas

  Are you sure? yes | no

yo2ldk wrote 12/19/2016 at 12:19 point

nice collection, thank you !

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates