Close
0%
0%

WiFi Webradio on ESP8266 or ESP32

KaRadio
A fully featured wifi web radio player with only low cost boards.
with or without a vs1053 board

Similar projects worth following
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,
Encoder, IR, lcd ...
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 github source for the ESP32 version ( vs1053 or i2s or pcm or internal DAC)

See A project derived from KaRadio32 in progress.

See the lcd +IR software's on Github AddOn

See some realizations of users at KaraDio

A nextion touchscreen display for KaraDio from yo2ldk : Here

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


KaRadio32 Release 2.3

Release 2.3 Rev 0 - Built on 2022/02/23

New:

  • 2.3 R0:
    • RAM optimization
    • Audio buffer size incremented.
    • Bugs correction: HTML chunks processing and Meta computing
    • Stack crash on http instant command removed
    • AAC Decoding improved
  • 2.2 R1:
    • Introducing WIFI QoS Ip precedence AC_VI
    • SPDIF output improved
    • DAC bugs removed.
    • AAC Decoding improved (but not perfect)
    • New patch for the vs1053. Play OGG too.
  • 2.2 R0:
    • Many internal optimizations
    • ascii unicode #&xxxx; decoded
    • aac decoder improved.
    • Added html commands volume+ and volume-

    KaRadio: Release 2.1

    Release 2.1 R0 - Built on 2021/02/15

    • 2.1 R0:
      • Security: the ssid passwords are no longer sent on each "Setting" display, but only when changed.
      • Bug fixed: in parse playlist. Possible memory leak. Thanks to HmarikBel
      • Bug fixed: Special char in station name was incorrectly sent.
      • Some minors improvements.
    • 2.0 R0:
      • Better handling of the large "header moved"
      • Better monitoring
      • timezone suggestion on the setting page

    History:

    history

    For ESP32 see the github page KaRadio32.

    ESP8266 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...

Read more »

KaRadio32.bin

KaRadio32 2.3R0

application/octet-stream - 1.49 MB - 01/01/2021 at 21:11

Download

user2.4096.new.4.bin

KaRadio 2.1 R1 Partition 1

application/octet-stream - 424.75 kB - 01/11/2020 at 18:13

Download

user1.4096.new.4.bin

KaRadio 2.1 R1 Partition 2

application/octet-stream - 424.75 kB - 01/11/2020 at 18:13

Download

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

Download

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

Download

View all 6 files

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

View all instructions

Enjoy this project?

Share

Discussions

jan wrote 02/12/2017 at 15:40 point

Hi JP the ESP 8266 is not starting when I connect it to the USB port I have to press the reset button on the ESP 8266 to start it up  then its going oke

is it possible to get it started directly ? or by a command from Arduino

Is it possible to get time information sent to tx

  Are you sure? yes | no

Jean-Pierre Cocatrix wrote 02/12/2017 at 21:29 point

Not sure to be able to do something for that. May be a weak usb?.
It works ok here.

The time is only on the browser for the moment. Do you need the time for displaying on the lcd?

  Are you sure? yes | no

jan wrote 02/12/2017 at 21:36 point

Yes i like the time on the Nextion diplay

  Are you sure? yes | no

jan wrote 04/15/2017 at 19:18 point

Thanks JP for the time for the display I not yet have it fix for my self butt will at it soon to the screen.

  Are you sure? yes | no

Sergio wrote 02/06/2017 at 05:02 point

Hi JP, since update 1.14 or 1.1.5and 1.1.6, i have something extrange with my player, after 30 min of playing the player stops alone. i have to push again the play button to continue listening a radio station. i testing for some hours and this problem happend every 30 min. can you check the sleep/wake code? Thanks.

  Are you sure? yes | no

Jean-Pierre Cocatrix wrote 02/06/2017 at 06:50 point

When the stream disappear, a connection is retried once.
In Log you see:
##CLI.STOPPED# from try restart
##CLI.PLAYING#
##CLI.PLAYING#
##CLI.STOPPED# from data not played

The timeout is 10 seconds for a registered station and 2 seconds for an instant play.


The wake/Sleep code has nothing to do here.

  Are you sure? yes | no

Sergio wrote 02/06/2017 at 14:47 point

Thanks JP for your help, now i see this in log

##CLI.STOPPED# from try restart
##CLI.STOPPED# from clientConnect
##CLI.PLAYING#

But no sound on the speakers

i have to reset de player

  Are you sure? yes | no

Jean-Pierre Cocatrix wrote 02/07/2017 at 13:16 point

You are right, a problem found when the stream disappears for a while.
I will debug. Thanks

  Are you sure? yes | no

yo2ldk Alexandru wrote 02/03/2017 at 19:15 point

I publish my project with all need it to adapt the Nextion touchscreen on KaRAdio:

  https://hackaday.io/project/19707-nextion-touchscreen-display-for-web-player-karadio

  Are you sure? yes | no

Jean-Pierre Cocatrix wrote 02/03/2017 at 20:15 point

Great.
JP Means Jean-Pierre ;-)

  Are you sure? yes | no

jan wrote 01/31/2017 at 20:29 point

Hi I have a question is it possible to connect a Nextion touch screen to it to control the radio

I love the web radio and the possibility to  update it thru the web interface I like to use this project to at it in a shower project I`m doing at this moment the Nextion wil be built in to controle the shower like temp end the 6 massage jets I like to ad the web radio into this project     

  Are you sure? yes | no

Jean-Pierre Cocatrix wrote 01/31/2017 at 20:40 point

https://hackaday.io/yo2ldk done  it. Contact him.

  Are you sure? yes | no

ldv82 wrote 01/31/2017 at 18:54 point

Send commands sys.patch ( "0"). How do I know if it is adopted? Thank you. Everything worked. But I did not understand why. Many times you enter a command sys.patch ( "0"), but it did not help. More will not upgrade the firmware unnecessarily in this.

  Are you sure? yes | no

Jean-Pierre Cocatrix wrote 01/31/2017 at 20:03 point

##CLI.URLSET#: stream.pcradio.biz
##CLI.PATHSET#: /Ruki_Vverh-low
##CLI.PORTSET#: 8000
##CLI.OVOLSET#: 0
##CLI.VOL#: 79
Header: Moved
##CLI.STOPPED# from C_HEADER
##CLI.URLSET#: 85.25.43.52
##CLI.PATHSET#: /Ruki_Vverh-low
##CLI.PORTSET#: 8000
##CLI.ICY0#:  Ruki_Vverh
##CLI.ICY3#:  http:\/\/www.pcradio.ru\/
##CLI.ICY4#:  Misc
##CLI.ICY5#:  24
##CLI.ICY6#:  Liquidsoap Radio!
##CLI.ICY7#:  channels=2;samplerate=44100;bitrate=24
##CLI.PLAYING#
##CLI.META#:
##CLI.VOL#: 132
##CLI.META#: Руки Вверх! - Убегай

It play well! but only with the patch.
Without it, the vs1053 crash.

If the patch is loaded you see:

VS Version (VS1053 is 4) = 4
SCI_ClockF = 0xB800
I2S Speed: 0
plugin size 18ce 2 c67
plugin start: 7 1 8050 6
scandone

Do a sys.patch ( "1") to enable it again, and reboot.

Are you sure to have the last release? Do an OTA upgrade please.
This is an alpha command not yet documented.

  Are you sure? yes | no

ldv82 wrote 01/31/2017 at 20:26 point
Yes. Already there were rows in the log
plugin size 18ce 2 c67
plugin start: 7 1 8050 6
Tried sys.patch command ( "1") of the sample. Maybe it helped.

What is the difference sys.patch command ( "0") and sys.patch ( "1")?

  Are you sure? yes | no

Jean-Pierre Cocatrix wrote 01/31/2017 at 20:42 point

sys.patch ( "0")  inhibe the patch loading at reboot

sys.patch ( "1")  load the patch at reboot.

Some vs1053 doesn't support the patch, so i added this advanced command.

  Are you sure? yes | no

ldv82 wrote 01/30/2017 at 12:21 point

JP cocatrix
Upgrading to version 1.1.5+ via OTA already have? I updated via OTA and just hang on AAC channels began again. And I do not have the firmware 1,1,5, which worked.

It would be nice to be able download the last stable version of firmware.

  Are you sure? yes | no

Jean-Pierre Cocatrix wrote 01/30/2017 at 12:38 point

Sorry, i don't understand your request.
AAC Channel?
Send a log please.

I don't want to store old release. Just make the new one working for everybody.

  Are you sure? yes | no

Jean-Pierre Cocatrix wrote 01/30/2017 at 12:55 point

This release adds the official patch for aac. If it is a problem, send

sys.patch("0")

And reboot again.
It seems that some vs1053b are not really up to date to accept this patch.

No mean to see it from the software. (vs version is 4 for all vs1053)

  Are you sure? yes | no

vis22 wrote 01/28/2017 at 11:28 point

Currently OTA passes starts WEB interface to 192.168.4.1. 

After entering the existing AP SSID: AP PASSWORD and Validate their begin to pour in on UART
Fatal exception (0):
epc1 = 0x401000bb, epc2 = 0x00000000, epc3 = 0x4028251f, excvaddr = 0x00000000, depc = 0x0 0000000


I returned to version 1.1.5 from 24.01.2017.

  Are you sure? yes | no

Jean-Pierre Cocatrix wrote 01/28/2017 at 12:27 point

Tested with 2 old prototypes, and a brand new one succesfully.
May be another problem?

  Are you sure? yes | no

vis22 wrote 01/28/2017 at 08:44 point

Dear jp cocatrix, seems to firmware 1.1.5 is not workable, as is the case of OTA and the github.kom, had through UART revert to version 1.1.4.

  Are you sure? yes | no

Jean-Pierre Cocatrix wrote 01/28/2017 at 09:12 point

Yes, true. A wrong update. Do an OTA again.
Thanks a lot.

Tell me if it works now.

  Are you sure? yes | no

vis22 wrote 02/04/2017 at 23:29 point

Sorry, but there is really only Problem with ESP8266-7 (tested on 3 copies). With ESP8266-12 no problem.

  Are you sure? yes | no

Jean-Pierre Cocatrix wrote 02/05/2017 at 09:12 point

vis22 wrote 10 hours ago
Sorry, but there is really only Problem with ESP8266-7 (tested on 3 copies). With ESP8266-12 no problem.

Sure, it is linked for esp8266 with 4MBytes only for OTA. (esp12 is ok)
I never tell that it support other flash size.

  Are you sure? yes | no

Pierre-Francois Bonnefoi wrote 01/26/2017 at 10:18 point

Wonderful project : tried it, love it ! Two suggestions : implement mDNS for easy discovery and allow two manual IP configurations, one for each provided AP.

  Are you sure? yes | no

Jean-Pierre Cocatrix wrote 01/26/2017 at 17:49 point

The free ram memory is critical. So i am not sure to implement mDNS.
Less critical is the ip conf for each AP.  For the moment I recommend to use a static DHCP lease to avoid the need of two fixed IP. With a well configured router, it is transparent. That's why I added the MAC address. I have to develop a new bank in eeprom to store more permanent configurations. The first one is full, that's why I postponed the second IP.

Thanks for your suggestions and appreciations.

  Are you sure? yes | no

Dominique GEORGES wrote 01/25/2017 at 23:21 point

Very good project : step 1 OK for me : module ESP8266 OK. Now I wait module VS1053 and go ! 

Thank you for your help. DOM from France !

  Are you sure? yes | no

vis22 wrote 01/25/2017 at 16:30 point

Many thanks.

  Are you sure? yes | no

vis22 wrote 01/24/2017 at 21:00 point

Many thanks!!!

I will try to connect the IR remote from the boom box.


P.S. Dear jp kokatriks, in the current version karadioU8glib.ino on github.com no strings the #define IR and the #ifdef IRLib2 ?

  Are you sure? yes | no

vis22 wrote 01/24/2017 at 18:05 point

Спасибо за совет.

Выход модуля питания 5V установлен конденсатор 220 мкФ.

Технический паспорт для vc1053 рекомендует конденсаторы 22 мкФ в силовых цепях.
Установленная на плате модуля С17 и С18 были сомнительными номинальным.
Под руки были только 100 мкФ.
В результате, цель достигнута, отказы прекратились.


Могу ли я узнать ИК-датчик схема проводки и способ настройки командных кодов ИК?

  Are you sure? yes | no

Jean-Pierre Cocatrix wrote 01/24/2017 at 18:12 point

In u8glibConf.h of the software:

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
**** Instruction for the IR module *****************************************************************************************
------------------------------------
The model used here is from:
https://www.aliexpress.com/item/Hot-Selling-1pcs-New-Infrared-IR-Wireless-Remote-Control-Module-Kits-For-Arduino-Wholesale/32334118062.html?spm=2114.13010608.0.0.XzmgYk
or equivalent. Cost less than 1$

- Based on NEC protocol; Built-in 1 x AG10 battery;
- Remote control range: above 8m;
- Wavelength: 940Nm;
- Frequency: crystal oscillator: 455KHz; IR carrier frequency: 38KHz


// IR library
Install the library from https://github.com/cyborg5/IRLib2
Uncomment the #define IR  and the #ifdef IRLib2 at the beginning of the karadioU8glib.ino file.
----------------------

The IR receiver pins:
From left to right (pin at bottom, sensor in front of you)
Gnd VCC Signal

The signal must be connected to
For mini #define PIN_IRRECV  2  or 3
For micro #define PIN_IRRECV  2  or 3 or 7


In karadioU8glig.ino:
//  Uncomment the following line to see the code of your remote control and report to the case the value
//        Serial.print("Protocol:");Serial.print(results.decode_type);Serial.print("  value:");Serial.println(results.value,HEX);
If you want to use another remote, you can see the code of the keys and modify the switch case for the needed function.
See IRremote.h  to add the protocol you need for the remote.

The tx of the pro mini must be connected to the rx of the esp12 but
Warning; the esp rx pin is not 5V tolerant, so if your pro mini is a 5v version we need to adapt the level.
-------
See
http://www.instructables.com/id/Pi-Cubed-How-to-connect-a-33V-Raspberry-Pi-to-a-5V/

The value of the resistors is not critical. Only the ration 1/3 2/3 must be respected 1k and 2k for example)

Enjoy.

  Are you sure? yes | no

Sergio wrote 01/23/2017 at 23:40 point

Hi JP, 

Autoplay dosn't work correctly, every time I turn the player on, I have to press the play button, to start the radio playing

  Are you sure? yes | no

Jean-Pierre Cocatrix wrote 01/24/2017 at 02:22 point

update please.

  Are you sure? yes | no

Sergio wrote 01/24/2017 at 11:00 point

With the last update, i don't have sound with any stations

  Are you sure? yes | no

Jean-Pierre Cocatrix wrote 01/24/2017 at 12:22 point

Do another ota update, and enter the command on uart:
sys.patch("0")
And reboot again.

I wonder why your prototype doesn't like the vs1053 patch.
Are you alone in the world? May be some other problem on wire can explain it?

  Are you sure? yes | no

Sergio wrote 01/24/2017 at 14:28 point

Till i'm update the player  to the last update works ok, the only problem was that the autoplay doesn´t work ok. No wire problems, i´ll try with the uart command that you said. 

  Are you sure? yes | no

Sergio wrote 01/25/2017 at 00:10 point

now works, on 2 players i have to entered the command on the uart

Thanks, may be a problem with the VS1053 patch

  Are you sure? yes | no

Jean-Pierre Cocatrix wrote 01/25/2017 at 09:16 point

The vs1053 patch is the official one. No problem with it. May be a spi error on transfert? The wires are longs between the esp and vs?

  Are you sure? yes | no

vis22 wrote 01/23/2017 at 17:45 point

May be. The power supply used DC-DC step-down module LM2596 powered by the voltage regulator +12 V boom-box.
ESP8266-12 randomly stopped communication with VS1053, assuming a fault ESP8266-12 replaced it ESP8266-7 effect it is not received, the modules behave as well. Only extra capacitors ensure their reliable operation.

  Are you sure? yes | no

Jean-Pierre Cocatrix wrote 01/23/2017 at 18:13 point

May be a high frequency filter with a few pf, and a 22µf on the 5 volts only?

  Are you sure? yes | no

vis22 wrote 01/22/2017 at 19:04 point

The recommended VS1053 module has to install additional capacitors 22 microfarads in parallel of C17 and C18 to the supply chains. Without them, the module sometimes freezes.

  Are you sure? yes | no

Jean-Pierre Cocatrix wrote 01/22/2017 at 19:25 point

Never seen on more than 10 prototypes. 

May be a power supply problem on your prototype before these regulators?

  Are you sure? yes | no

Paul wrote 03/14/2017 at 04:10 point

Hi, what caps do you recommend, just ceramic SMC's?

  Are you sure? yes | no

Jean-Pierre Cocatrix wrote 03/14/2017 at 18:07 point

I never experimented a freeeze of the vs1053.

  Are you sure? yes | no

archetix wrote 01/20/2017 at 06:07 point

HI T4SPAM,

exactly


amp would be activated only during playback
(It prevents clatter at start-up)
the rest suppresses  filter


Please excuse my bad English
(CZech > EN Google translate)  :-)

  Are you sure? yes | no

Thomas wrote 01/20/2017 at 08:00 point

Great. Pin D4(GPIO2) is already in use for LED on Button Interface.

But we can use Pin Playing 12 on LCD MCU as well.

Regards

Thomas

  Are you sure? yes | no

archetix wrote 01/20/2017 at 09:16 point

Pin D4 (GPIO2) is already in use for LED on Button Interface ...

I would therefore suggest a new feature firmware for ESP8266
configuration GPIO2

LED out

or
amp control

thus enabling control amplifier without display

Please excuse my bad English


(CZech > EN Google translate)  :-)

  Are you sure? yes | no

Jean-Pierre Cocatrix wrote 01/20/2017 at 10:27 point

Yes, I can also add a sys command to choose between the blinking default and the playing status on gpio2

  Are you sure? yes | no

archetix wrote 01/20/2017 at 12:47 point

HI jp cocatrix,

It would be great
Thank you in advance
Archetix

  Are you sure? yes | no

Jean-Pierre Cocatrix wrote 01/20/2017 at 16:38 point

No problem. in the next release

sys.led("x")  with x=0 default blink, x=1 led On when playing (state saved in eprom)

Ok?

  Are you sure? yes | no

archetix wrote 01/20/2017 at 17:58 point

OK
Thank you very much

  Are you sure? yes | no

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

Jean-Pierre 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

Jean-Pierre 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

Jean-Pierre Cocatrix wrote 01/15/2017 at 15:42 point

Yes, a bug in the websocket corrected.

  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