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

marcinmaster999 wrote 07/02/2016 at 16:08 point

Only LCD support need and project ended  because sooo perfect :D

  Are you sure? yes | no

Jean-Pierre Cocatrix wrote 07/02/2016 at 16:23 point

Thanks. It was a very big work to improve the Pietr original software, but i am very happy with the result.
The lcd will be on the new upcoming ESP32 because now we lack of ram and GPIO.
Notice that GPIO can be multiplexed with a SN74HC138n or MCP23017 but .... 

  Are you sure? yes | no

marcinmaster999 wrote 07/02/2016 at 16:30 point

i desolder gpio9 i 10 and freeing pins but slower transmission in dio and added ssd1306 worked nice.YES big work !!! and THANKS FOR THIS 

  Are you sure? yes | no

Jean-Pierre Cocatrix wrote 07/02/2016 at 16:37 point

I have read this before.
Cannot do that with my esp12 ;-)
I dont want to remove the metallic cover...
Great job.

  Are you sure? yes | no

marcinmaster999 wrote 07/02/2016 at 16:46 point

yes i now this is problematic.I tested only and soldered again ;) i try to make support for avr - good library.It may be useful for other people.sorry for my english

  Are you sure? yes | no

[deleted]

[this comment has been deleted]

Jean-Pierre Cocatrix wrote 07/02/2016 at 16:01 point

got it 
Thanks

  Are you sure? yes | no

marcinmaster999 wrote 07/02/2016 at 16:09 point

ach my gpio16 is different 

  Are you sure? yes | no

marcinmaster999 wrote 07/02/2016 at 15:43 point

Ir decode need 220 in task.I do not have as far to test this ram.Needed new pcb.

for now everything works fine only when you refresh the page

  Are you sure? yes | no

Jean-Pierre Cocatrix wrote 07/02/2016 at 15:45 point

So 220 * 4 bytes of stack.

  Are you sure? yes | no

marcinmaster999 wrote 07/02/2016 at 15:22 point

hehe update with remote control Awesome !! ;) i have 23k256 with 32kB will work?? 

GPIO5 ->GPIO2 without blinking led because my pcb designed long time ago.

  Are you sure? yes | no

Jean-Pierre Cocatrix wrote 07/02/2016 at 15:36 point

Yes.

Just change 

BUFFER_SIZE = 131072;
by
BUFFER_SIZE = 32768;
in buffer.c


  Are you sure? yes | no

Jean-Pierre Cocatrix wrote 07/02/2016 at 15:42 point

Ah ok, so you have removed the testtask in user_main.c.
Right?
Do you have a link for the code of the remote control?

  Are you sure? yes | no

marcinmaster999 wrote 07/02/2016 at 15:51 point

yes.espressif removed this?;/where can upload you?

  Are you sure? yes | no

marcinmaster999 wrote 07/02/2016 at 14:50 point

I also add nec ir decode in gpio 5 from bbs.expressif.worked but low memory reseting device 

  Are you sure? yes | no

Jean-Pierre Cocatrix wrote 07/02/2016 at 15:13 point

Using the new external ram will free 12960 bytes....
ICACHE_FLASH_ATTR void initBuffer()
{
     if (externram== false)
     {
         BUFFER_SIZE = 12960;
         buffer = malloc(BUFFER_SIZE);
     } else{
         BUFFER_SIZE = 131072;
     }         
}

Not yet tested because I havn't received it.

  Are you sure? yes | no

Jean-Pierre Cocatrix wrote 07/02/2016 at 15:19 point

GPIO5 is XDCS for the 1053.
It is not free. If you are not using the external ram, try to use the GPIO16.

  Are you sure? yes | no

marcinmaster999 wrote 07/02/2016 at 14:48 point

Ach yes !!! my upgrade.h is different.Big thx ;)

  Are you sure? yes | no

Jean-Pierre Cocatrix wrote 07/02/2016 at 14:26 point

Ka-Radio/ESP8266-Firmware/include/espressif/upgrade.h

  Are you sure? yes | no

Jean-Pierre Cocatrix wrote 07/02/2016 at 14:25 point

In upgrade.h:
struct upgrade_server_info {
    struct sockaddr_in sockaddrin;         ...

  Are you sure? yes | no

marcinmaster999 wrote 07/02/2016 at 14:17 point

Version 1.0.4 worked but new with ota doesnt :

ota.c: In function 'update_firmware':

ota.c:126:9: error: 'struct upgrade_server_info' has no member named 'sockaddrin'

   server->sockaddrin.sin_family = AF_INET;
         ^
ota.c:127:9: error: 'struct upgrade_server_info' has no member named 'sockaddrin'

   server->sockaddrin.sin_port   = htons(80);
         ^
ota.c:128:9: error: 'struct upgrade_server_info' has no member named 'sockaddrin'

   server->sockaddr.sin_addr.s_addr = inet_addr(inet_ntoa(*(struct in_addr*)(se
rv-> h_addr_list[0]))); // remote server ip
         ^

Precompiled worked perfectly.My pcb used different gpio.Finally great job !!!

  Are you sure? yes | no

marcinmaster999 wrote 06/05/2016 at 15:54 point

I would like to compile but i have errors:

eeprom.c: In function 'eeGetData':
eeprom.c:48:11: error: implicit declaration of function 'spi_flash_read' [-Werro
r=implicit-function-declaration]
  result = spi_flash_read(EEPROM_START + address, (uint32 *)buffer, size);
           ^
eeprom.c: In function 'eeSetData':
eeprom.c:61:3: error: implicit declaration of function 'spi_flash_erase_sector'
[-Werror=implicit-function-declaration]
   spi_flash_erase_sector(sector >> 12);
   ^
eeprom.c:69:12: error: implicit declaration of function 'spi_flash_write' [-Werr
or=implicit-function-declaration]
   result = spi_flash_write(sector, (uint32 *)eebuf, 4096);
            ^
eeprom.c: In function 'eeEraseStations':
eeprom.c:95:3: error: implicit declaration of function 'vTaskDelay' [-Werror=imp
licit-function-declaration]
   vTaskDelay(1); // avoid watchdog
   ^
eeprom.c: In function 'getStation':
eeprom.c:114:30: error: implicit declaration of function 'xPortGetFreeHeapSize'
[-Werror=implicit-function-declaration]
    printf ("Heap size: %d\n",xPortGetFreeHeapSize( ));

which library needed?

  Are you sure? yes | no

Jean-Pierre Cocatrix wrote 06/05/2016 at 16:27 point

Hi,

Did you compile with make.sh?

Strange because xPortGetFreeHeapSize is in freertos include.

https://github.com/pfalcon/esp-open-sdk installed?

On linux or windows?

  Are you sure? yes | no

marcinmaster999 wrote 06/05/2016 at 16:34 point

Yes tried with linux and windows only the same errors.Ok on eeprom include "spi_flash.h" but uart_div_modify error ;/

  Are you sure? yes | no

Jean-Pierre Cocatrix wrote 06/05/2016 at 16:54 point

It seems its a missing expressif include.

See https://github.com/mziwisky/esp8266-dev/blob/master/esphttpd/include/espmissingincludes.h

I suppose that https://github.com/pfalcon/esp-open-sdk install it for me in the compil chain.

I compile with xtensa, not gcc

  Are you sure? yes | no

marcinmaster999 wrote 06/05/2016 at 18:28 point

 Compile with peter tutorial and the same error http://piotrsperka.info/2015/08/programowanie-esp8266-pod-linuksem/

  Are you sure? yes | no

Jean-Pierre Cocatrix wrote 06/05/2016 at 19:47 point

Add 

void uart_div_modify(int no, unsigned int freq);

in the source.

  Are you sure? yes | no

alexander - yo2ldk wrote 05/23/2016 at 17:36 point

With what can I upload firmware to the esp?

  Are you sure? yes | no

Jean-Pierre Cocatrix wrote 05/08/2016 at 19:11 point

Thanks,

This is my source for stations: http://www.listenlive.eu/index.html

and https://www.internet-radio.com/

  Are you sure? yes | no

Kim Ditlevsen wrote 05/08/2016 at 18:38 point

Just got it up and running , sounds good 
tnx for you great support 
/Kim

  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