Wifi Webradio With ESP8266 and VS1053 (KaraDio)

85,413

119

186

About: Old retired engineer

A wifi web radio player with only two low costs boards.

2017/08/25 New release 1.6: See The hackaday page
For more informations or questions, you can enter to the Karadio facebook group

Description:

Control with any browsers (ie edge, chrome mozilla etc...).or with an external hardware panel or with the uart interface.

Memory for 256 stations

OTA upgrade

Read direct mp3 or ogg streams or playlist .pls .m3u and .xspf

Read up to a 320 kb/s stream,

New web page, Fit well on mobile or computer.

Embedded wifi configuration via the web or uart interface

Metadata displayed (ie Title of the current song if given in the stream),

All settings saved (sound setting, stations, wifi)

Server multi clients with automatic refresh for all (websocket),

The stations can be downloaded and uploaded within the web site,

Very quick responsive web by caching local information in the browser and websocket.

a led indicates the state of the equipment . Speed blink: init, 90%in 10%out: connection in progress, 10% in 90%out: Equipment ready.

External DAC i2s interface on the vs1053 enabled.

Autostart on power on if the autoplay is checked.

Supplies:

Step 1: Step1: What You Need

Parts required:

A nodeMcu V3 (on aliexpress)

A VS1053 module (aliexpress)

A Fiberglass board epoxy boards (aliexpress)

2.54mm 40 Pin Stright Female Single Row Pin Header Strip PCB Connector (aliexpress)

Some wires and Soldering Iron.

A pc or other with an usb port

and an usb to micro usb cable. (aliexpress)

An external amplifier or earphone.

A prototype can also be made using a breadboard and some jumper wires.

See The hackaday page

Step 2: Step2: Build the Webradio Hardware

Follow the schematic to wire the board.

Be careful, the vs1053 is hard to soldier. Pins are very close each other.
Use a very thin iron.

Check each wire before the next step.
The power comes from the micro usb of the nodeMcu linked to the pc or a 5 volts transformer.

Step 3: Step3: Loading the Software and First Use

Loading the software

You need the ESP flash download tool.

Load it at the Espressif page

The binaries files can be found on Github or hackaday

Follow the image to configure the tool depending of the tool release

To enter the flash mode of the nodeMcu, press and hold the flash button, the press the reset button. You ca release the flash button.
Start the download with the start button of the ESP flash tool.

After a while, the Finish green indication is shown.

Press the reset button of the nodeMcu. If succesful, the nodeMcu les blinks.

First use

If the acces point of your router is not known,

the webradio init itself as an AP. Connect your wifi to the ssid "WifiWebRadio", Browse to 192.168.4.1 to display the web 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.
Dont 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 is given by dhcp.
A sample of stations list can be uploaded via the web page and loaded to the webradio.

All future update will be made within the webradio interface via the ota feature.

Step 4: Some Images

The esp8266 is an incredible processor. This project is made with the freertos environment and contains many tasks: a web client to connect to the radio stream, a web server to provide the browser interface 'and a child task for each client), an uart task to display and and send commands to the webradio, a task to manage an external panel command on the adc entry (schematic in the hardware directory on github), a task for each client websocket, etc.
It is a complex project, but the processor is really powerful. The only limit is the lack of ram, which can be removed by adding an external chip on the spi bus. See the hackaday page or github page.

The uart interface can show some debug informations and can send controls to the webradio.
For a command list see the uartinterface.txt file at

http://karadio.karawin.fr/Interface.txt

20 People Made This Project!

Recommendations

  • Arduino Contest 2019

    Arduino Contest 2019
  • Gardening Contest

    Gardening Contest
  • Fandom Contest

    Fandom Contest

186 Discussions

0
None
Marecki_l

Tip 6 weeks ago

To all who facing problem with opening setting website on first run.
If you can connect to radio AP. That mean network connection between computer and radio works. And for some reason you can not open website.
There is a way to work around.
So you have to go to serial monitor for example from arduino ide. And there you have to type command wifi.con("your_AP_SSID","AP_password") pess "Send" button. Yoy shold get a message on serial monitor that your AP will be used at next boot. In my case I had an issue because my password was long and had spaces in string, I had to change temporarily my AP password to shorter and without spaces.
After this on next boot radio conected to my network and then it was possible to go to its website.
In my opinion the problem is in priority of services runing on ESP, web server is starting just after negotiations with AP's because it fails server doesnt start, and then at the end is runing Acces point service and dhcp server with 192.168.4.1 address. So connection to radio is possible byt website doesnt work.
So good luck an save three days :)

0
None
ragulec

Question 6 weeks ago

Hi,
Thanks for your efforts. I want to built this radio. I uploaded the firmware to NodeMCU. Then, I disconnect wifi from my router and connect to WiFiKaRadio. After this, I tried to to connect 192.168.4.1 but no successs. I changed TCP/IP settings 192.168.4.1 for GW, the same number as DNS. I never connected to 192.168.4.1.
What can I do?
Regards.

1 answer
0
None
karawinragulec

Reply 6 weeks ago

The esp is now the AP (access point)
Just connect your computer wifi to WifiKaRadio then with a browser open 192.168.4.1
It may take 30 sec or a bit more.
No need to change the router or other setting if your computer is connected with the wifi.
If it is connected with ethernet, yes, connect the router to 192.168.4.1
It is better to see the github page for the uptodate software.
I refresh instructables at a very low speed ;-)
https://hackaday.io/project/11570-wifi-webradio-with-esp8266-and-vs1053 .
https://github.com/karawin/Ka-Radio
https://github.com/karawin/Ka-Radio32

0
None
Marecki_l

Question 6 weeks ago

HelloI am using NodeMCU V3.2 LoLin, and will be happy if somebody can help me with this project.
I was trying upload this firmware to my unit and had no success, so I changed, just for test, memeory size for 32Mbit-C1 and uploaded firmware. Supricely unit booted and worked fine, I could connect to it with my laptop, only thing I cant open its website or ping interface.
So I did another test changed flash size to 32Mbit and uploaded firmware again an suprice it boots but still cant open its website.

22:22:44.127 -> External ram not detected
22:22:44.127 -> uart speed: 115200
22:22:44.127 -> Release 1.9, Revision 0
22:22:44.127 -> SDK 2.0.0(30727a0)
22:22:44.127 -> data : 0x3ffe8000 ~ 0x3ffe886c, len: 2156
22:22:44.127 -> rodata: 0x3ffe8870 ~ 0x3ffe8e78, len: 1544
22:22:44.127 -> bss : 0x3ffe8e78 ~ 0x3fff0330, len: 29880
22:22:44.174 -> heap : 0x3fff0330 ~ 0x40000000, len: 64720
22:22:44.174 -> Heap size: 41824
22:22:44.174 -> size_map: 4
22:22:44.174 -> Eeprom_start: 3e0000
22:22:44.174 -> Eeprom_start1: 3d0000
22:22:44.174 -> Flash size: 4194304
22:22:44.174 -> t0 task: 40108808
22:22:44.174 -> t1 task: 40108860
22:22:44.174 -> t2 task: 401088b8
22:22:44.174 -> t3 task: 40108910
22:22:44.174 -> t4 task: 40108968
22:22:44.174 -> Heap size: 34904
22:22:44.174 -> mode : sta(cc:50:e3:56:56:88)
22:22:44.174 -> add if0
22:22:44.174 -> SCI_Mode (0x4800) = 0xFFFF
22:22:44.174 -> SCI_Status (0x48) = 0xFFFF
22:22:44.174 -> VS Version (VS1053 is 4) = 15
22:22:44.174 -> SCI_ClockF = 0xFFFF
22:22:44.174 -> device: 401089f0
22:22:44.174 -> volume: 255
22:22:44.174 -> UART READY
erase setting1 (only one time)
22:22:45.098 -> AP1: , AP2:
22:22:45.098 -> first use
AP1:Station Ip: 192.168.1.254
22:22:45.239 -> Trying , I: 0 status: 0
22:22:49.223 ->
Config not found
The default AP is WifiKaRadio. Connect your wifi to it.
22:22:51.286 -> Then connect a webbrowser to 192.168.4.1 and go to Setting
22:22:51.286 -> May be long to load the first time.Be patient.
Erase the database and set ssid, password and ip's field
del if0
22:22:51.286 -> usl
22:22:51.286 -> sul 0 0
22:22:51.286 -> mode : softAP(ce:50:e3:56:56:88)
22:22:51.286 -> dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
22:22:51.286 -> add if1
22:22:51.286 -> bcn 100
22:22:51.379 -> sleep enable,type: 2
22:22:51.379 -> No panel
ADC Div: 0 from adc: 9
22:22:51.379 -> autostart: playing:0, currentstation:0
22:23:29.278 -> add 1
22:23:29.278 -> aid 1
22:23:29.278 -> station: 00:19:d2:66:f4:10 join, AID = 1

screen.png
2 answers
0
None
karawinMarecki_l

Reply 6 weeks ago

Connect your wifi to the webradio AP and open 192.168.4.1

0
None
Marecki_lkarawin

Reply 6 weeks ago

Hello thanks for your answer. Might my english i s not good enough. So I will try again.
I have connected my laptop to webradio AP my laptop gets IP address 192.168.4.2 net mask 255.255.255.0 gateway 192.168.4.1 and DNS 192.168.4.1, and that's the end of comunication. I type address 192.168.4.1 in web browser but the website doesn't open.
Also webradio doesn't response to ping packets. It seem like all comunication stops just after DHCP negotiations. I also run on my windows desktop network scanner to check if any services are listening on webradio and it shows the address 192.168.4.1 but no services on it.
As I mentioned above I am using NodeMCU V3.2 LoLin, I have tested it on two brand new units and I can asure that they are OK I have tested them using other program sketch.
If I can make some other tests to find where is the problem, or might someone can guide me how to compile this firmware from sources. Best if it is possible tu use Arduino IDE.
I do not have a lot experience in this matter so please forgive me stupid questions.

0
None
ThanhncCTIN

Question 2 months ago

Hello,
I made it, everything run ok, except it can not recover to play or can not run Auto play in case of WiFi or internet gateway turn on/off. Please suggest. Tks

1 answer
0
None
Vlad Vlad

Question 5 months ago

Hello.
I was made your good project: with Wemos d1 mini pro, Arduino Pro Micro 5Volt version, LCD 2004 and 6 hardware control buttons. Everything works except one. I have problem with LCD. LCD show only squares on 2 strings. I will uploaded "Hello World!" sketch to test wiring between LCD and Arduino and it works. I have set Uart speed 28800 in LCD1602 sketch and by sys.uart ("28800") command on Wemos. I wired TX from Wemos to RX Arduino, grounds conected together. LCD not works. Where is the mistake? Can you help?

1 answer
0
None
karawinVlad Vlad

Reply 5 months ago

It seems that the mini pro don't receive the serial.

0
None
TM1960

1 year ago

can't connect to WifiWebRadio WIn10/Android also it won't connect to my AP
using an Lolin 8266 V3

Now if I use an wemos version it works great.
what could be wrong.

7 replies
0
None
TM1960karawin

Reply 1 year ago

Hi karawin, Thanks for your reply.
here is the screendump I don't see an issue but maybe you do.
wifi.list give no result

ka-serial-l.PNG
0
None
karawinTM1960

Reply 1 year ago

your ap SNLK not found. Check it.

0
None
TM1960karawin

Reply 1 year ago

Ok Fixed this problem.
First of all when you have strange output on the serial port /USB
this is because your board runs at 40Mhz so set the Xtal setting good in the Firmware tool. or the baud rate will be 40/26=177.230 Bps.
In my case I not sure whats wrong with the V3 boards but this is how i solved it:
Using Firmware-loader 3.63. go to the RFConfig.
Set 40Mhz,SetFeqEnable,PracticalFreqOffset=320,FullRFCalinRFInit
And GenInitBin the file "esp8266_init_data_setting.bin" must be loaded in your device so place that in SPIDownload.
I had 3 Lolin V3 units NEW that did not connect to the Wifi.
Now they DO!.

Hope it helps others as I'm new to 8266 needed to read a lot to understand it.

image004.jpgimage006.jpg
0
None
karawinTM1960

Reply 1 year ago

<connect the wifi of your computer to the wifiwebradio ap, then the browser to 192.168.4.1

0
None
karawinkarawin

Reply 1 year ago

your ap SNLK not found. Check it

0
None
TM1960karawin

Reply 1 year ago

Its only this Lolin that does not see the AP's my other version/Wemos
connects with no problem, Ap is here. wifi.list gives no response and can't connect to the SoftAp from multiple other clients..
I assume there is someting wrong with this Lolin V3 board.

0
None
gussmith

Question 1 year ago

I have Nodemcu devkit v0.9. Will this also work or do I need specifically Nodemcu V3?

1 answer