Giter Site home page Giter Site logo

yoradio's Introduction

ёRadio

Web-radio based on ESP32-audioI2S or/and ESP32-vs1053_ext library


More images in Images.md

Hardware

Required:

ESP32 board: https://aliexpress.com/item/32847027609.html
I2S DAC, roughly like this one: https://aliexpress.com/item/1005001993192815.html
https://aliexpress.com/item/1005002011542576.html
or VS1053b module : https://aliexpress.com/item/32893187079.html
https://aliexpress.com/item/32838958284.html
https://aliexpress.com/item/32965676064.html

Optional:

Displays
Controls

Connection tables

SPI Display ESP-32 options.h
GND GND -
VCC +5v -
SCL 18 -
SDA 23 -
CSL 5* TFT_CS
RSTL 15* TFT_RST
DCL 4* TFT_DC
NOKIA5110 ESP-32 options.h
RST 15* TFT_RST
CE 5* TFT_CS
DC 4* TFT_DC
DIN 23 -
CLK 18 -
VCC +3v3 -
GND GND -
I2C Display ESP-32 options.h
GND GND -
VCC +5v -
SDA 13* I2C_SDA
SCL 14* I2C_SCL
LCD 1602 ESP-32 options.h
GND GND -
VCC +5v -
RS any* LCD_RS
E any* LCD_E
D4 any* LCD_D4
D5 any* LCD_D5
D6 any* LCD_D6
D7 any* LCD_D7
Touchscreen ESP-32 options.h
GND GND -
VCC +3.3v -
CLK 18 -
DIN 23 -
DO 19 -
IRQ N/C -
CS any* TS_CS
I2S DAC ESP-32 options.h
GND GND -
VIN +5v -
DOUT(DIN) 27* I2S_DOUT
BCLK 26* I2S_BCLK
LRC(WSEL) 25* I2S_LRC
VS1053 ESP-32 options.h
XDCS 25* VS1053_DCS
XCS 27* VS1053_CS
XRST EN* VS1053_RST
DERQ 26* VS1053_DREQ
SCK 18 -
MOSI 23 -
MISO 19 -
5V +5V -
DGND GND -

## Important! You must choose between I2S DAC and VS1053 by disabling the second module in the settings (see below)

Buttons, Encoder, LED, IR, Joystick ESP-32 options.h
GND GND -
PIN any* ENC_BTNx, BTN_xxx, LED_BUILTIN, IR_PIN

* Any free pin, configured in myoptions.h
** GPIOs 34-39 don't have software pullup/down functions. For encoder/buttons use an external pullup resistor, 10 kOhm works here.
** GPIO 16 and 17 are used by PSRAM on the WROVER modules.


Dependencies

Libraries:

Library Manager: Adafruit_GFX, Adafruit_ST7735*, Adafruit_SSD1306*, Adafruit_PCD8544*, Adafruit_SH110X*, Adafruit_SSD1327*, Adafruit_ILI9341*, Adafruit_SSD1305*, TFT_22_ILI9225* (* depending on display model), OneButton, IRremoteESP8266, XPT2046_Touchscreen
Github: ESPAsyncWebServer, AsyncTCP, async-mqtt-client*
* if you need MQTT support

Tool:

ESP32 Filesystem Uploader


Hardware setup

Dont edit the options.h!
Hardware is adjustment in the myoptions.h file.

Important! You must choose between I2S DAC and VS1053 by disabling the second module in the settings:

// If I2S DAC used:
#define I2S_DOUT      27
#define VS1053_CS     255
// If VS1053 used:
#define I2S_DOUT      255
#define VS1053_CS     27

Define display model:

#define DSP_MODEL  DSP_ST7735 /*  default - DSP_DUMMY  */

The ST7735 display submodel:

#define DTYPE INITR_BLACKTAB // 1.8' https://aliexpress.ru/item/1005002822797745.html
//#define DTYPE INITR_144GREENTAB // 1.44' https://aliexpress.ru/item/1005002822797745.html

Rotation of the display:

#define TFT_ROTATE 3 // 270 degrees
Note: If INITR_BLACKTAB dsp have a noisy line on one side of the screen, then in Adafruit_ST7735.cpp:
  // Black tab, change MADCTL color filter
  if ((options == INITR_BLACKTAB) || (options == INITR_MINI160x80)) {
    uint8_t data = 0xC0;
    sendCommand(ST77XX_MADCTL, &data, 1);
    _colstart = 2; // ← add this line
    _rowstart = 1; // ← add this line
  }

Quick start


  1. Arduino core for the ESP32 v2.0.0 or higgest is required!
  2. In ArduinoIDE - upload sketch data via Tools→ESP32 Sketch Data Upload (it's here)
  3. Upload the sketch to the board
  4. Connect to yoRadioAP acces point with password 12345987, go to http://192.168.4.1/ configure and wifi connections.
    *this step can be skipped if you add WiFiSSID WiFiPassword pairs to the yoRadio/data/data/wifi.csv file (tab-separated values, one line per access point) before uploading the sketch data in step 1
  5. After successful connection go to http://<yoipaddress>/ , add stations to playlist (or import WebStations.txt from KaRadio)
  6. Well done!

Localization: Если Adafruit_GFX ещё не русифицирована, русифицировать её, заменив файл Arduino/libraries/Adafruit_GFX_Library/glcdfont.c файлом yoRadio/fonts/glcdfont.c


Update

  1. Backup your settings:
    download http://<yoradioip>/data/playlist.csv and http://<yoradioip>/data/wifi.csv and place them in the yoRadio/data/data/ folder
  2. In ArduinoIDE - upload sketch data via Tools→ESP32 Sketch Data Upload
  3. Upload the sketch to the board
  4. Go to page http://<yoradioip>/ in the browser and press Ctrl+F5 to update the scripts.
  5. Well done!

Update over web-interface

  1. Backup your settings:
    download http://<yoradioip>/data/playlist.csv and http://<yoradioip>/data/wifi.csv and place them in the yoRadio/data/data/ folder
  2. Get firmware binary: Sketch → Export compiled binary
  3. Get SPIFFS binary: disconnect ESP32 from your computer, click on ESP32 Data Sketch Upload.
    You will get an error and file path

  1. Go to page http://<yoradioip>/update and upload yoRadio.ino.esp32.bin and yoRadio.spiffs.bin in turn, checking the appropriate upload options.
  2. Well done!

MQTT

  1. Copy file exsamples/mqttoptions.h to yoRadio/ directory
  2. In the mqttoptions.h file, change the options to the ones you need
  3. Well done!

Home Assistant


  1. Requires MQTT integration
  2. Copy directory HA/custom_components/yoradio to .homeassistant/custom_components/
  3. Add yoRadio entity into .homeassistant/configuration.yaml (see exsample)
  4. Restart Home Assistant
  5. Add Lovelace Media Player card to UI (or mini-media-player card)
  6. Well done!

More features

  • Сan add up to 65535 stations to a playlist. Supports and imports KaRadio playlists (WebStations.txt)

  • Telnet with KaRadio format output
    Commands:
    cli.prev (or simply prev) - previous station
    cli.next or next - next station
    cli.toggle or toggle - start/stop
    cli.stop or stop - stop
    cli.start or start or cli.play or play - start playing
    cli.play("x") or play(x) or play x - play station x
    cli.vol or vol - display the current value of volume (0-254)
    cli.vol("x") or vol(x) or vol x - set volume (0-254)
    cli.audioinfo or audioinfo - display the current value of debug (0-1)
    cli.audioinfo("x") or audioinfo(x) or audioinfo x - debug on/off (0-1)
    cli.smartstart or smartstart - display the current value of smart start
    cli.smartstart("x") or smartstart(x) or smartstart x - smart start: 2-off, 0-1 - start playing on boot, if the radio was playing before the reboot
    cli.list or list - display playlist
    cli.info or info - display current state
    sys.boot or boot or reboot - reboot
    sys.date - sync date/time and display it
    sys.tzo or tzo - display the timezone offset
    sys.tzo("h:m") or tzo(h:m) or tzo h:m - set timezone offset
    sys.tzo("h") or tzo(h) or tzo h - set timezone offset in hours only

  • MQTT support
    Topics:
    MQTT_ROOT_TOPIC/command - Commands
    MQTT_ROOT_TOPIC/status - Player status
    MQTT_ROOT_TOPIC/playlist - Playlist URL
    MQTT_ROOT_TOPIC/volume - Current volume
    Commands:
    prev - prev station
    next - next station
    toggle - start/stop playing
    stop - stop playing
    start, play - start playing
    boot, reboot - reboot
    volm - step vol down
    volp - step vol up
    vol x - set volume
    play x - play station x

  • Home Assistant support


Plugins

At the moment, you can display additional information on the display by writing a few additional functions. There is no documentation yet, you will have to deal with the example, which is in file exsamples/plugins/displayhandlers.ino.
Work is in progress...


Version history

v0.6.530

  • adding VU meter for displays ST7735 160x80, GC9106 160x80, ILI9225 220x176, ST7789 240x240
  • TFT_22_ILI9225 library is integrated into the project

v0.6.494

  • adding VU meter for displays ST7735 160x128, ST7735 128x128, ILI9341 320x240, ST7789 320x240
    option ENABLE_VU_METER (see myoptions.h for exsample)
    !!! Important !!!
    if you enable this feathure on the esp32 wroom, due to lack of memory, you must modify the file Arduino/libraries/AsyncTCP/src/AsyncTCP.cpp
    replace the line 221
    xTaskCreateUniversal(_async_service_task, "async_tcp", 8192 * 2, NULL, 3, &_async_service_task_handle, CONFIG_ASYNC_TCP_RUNNING_CORE);
    with
    xTaskCreateUniversal(_async_service_task, "async_tcp", 8192 / 2, NULL, 3, &_async_service_task_handle, CONFIG_ASYNC_TCP_RUNNING_CORE);

v0.6.450

!!! a full update with Sketch data upload is required. After updating please press CTRL+F5 in browser !!!

  • adding an IR remote control has been moved to the web-interface (more info in Controls.md)
  • fixed broken internal DAC on esp32 core 2.0.3 and highest

v0.6.400

  • fixed compilation errors with esp32 core 2.0.4

v0.6.380

!!! a full update with Sketch data upload is required. After updating please press CTRL+F5 in browser !!!

  • fixed a bug when saving a playlist with special characters in the name and url
  • fixed a bug when saving wifi settings with special characters in the name and password
  • fixed css bugs

v0.6.357

  • remove ZERO WIDTH NO-BREAK SPACE (BOM, ZWNBSP) from stream title

v0.6.355

v0.6.348

  • fixed display bugs in the rssibitrate plugin
  • fixed some compilation warnings

v0.6.345

  • fix compilation error in rssibitrate plugin with ILI9225 display

v0.6.344

v0.6.320

  • fixed ILI9225 display bug when used with VS1053B module
  • fixed ILI9225 plugin support

v0.6.313

  • added support for ILI9225 220x176 SPI displays
  • added support for I2S internal DAC, option I2S_INTERNAL (see myoptions.h for exsample)
    (this option worked only with esp32 core version==2.0.0)
  • new option SOFT_AP_REBOOT_DELAY (see myoptions.h for exsample)
  • fixed MQTT connection when WiFi reconnected
  • fixed date display for ILI9341 displays
  • fixed garbage on volume control with displays ILI9341

v0.6.290

  • fixed interface blocking error when synchronizing time
  • time sync optimization
  • new option SNTP_SERVER, to set your custom server for synchronization (see myoptions.h for exsample)

v0.6.278

  • added support for LCD2004 displays
  • added support for SSD1305/SSD1309 I2C displays
  • fixed rotation of SH1106 display

v0.6.263

  • fixed encoder internal pullup

v0.6.262

  • change encoder library to ai-esp32-rotary-encoder (injected to project)
  • added new option VOL_ACCELERATION - volume adjustment acceleration by encoder (see myoptions.h for exsample)
  • fixed connection error with http-stations on esp32-core v2.0.3
  • fixed css errors (a full update is required)

v0.6.250

  • added update via web-interface
    Attention! Full firmware with chip re-partitioning is required! see board setup example
  • fixed choppy when switching stations via Home Assistant

v0.6.220

  • new option PLAYER_FORCE_MONO (with i2S DAC only)
  • change default scroll speed in DSP_NOKIA5110
  • improved reconnect to WiFi on connection loss

v0.6.210

  • fixed choppy playback on DSP_ST7735 displays used with VS1053
  • new option PL_WITH_NUMBERS (show the number of station in the playlist)
  • fixed compiling error with DSP_DUMMY option
  • correction of displays GC9106 and SSD1305

v0.6.202

  • fixed errors in the operation of the second encoder
  • rewrote plugin example
  • fixed compilation errors on macOS #2

v0.6.200

  • please backup your playlist and wifi settings before updating (export)
  • accelerated displays up to ~30fps (everything except LCD)
  • corrections/additions in the WEB interface (a full update is required)
  • rewrote plugin example
  • fixed compilation errors on macOS
  • changed the logic of the second encoder (switching to the volume control mode by double click)
  • optimization, bug fixes
  • probably some other things that I forgot about %)

v0.6.120

  • added support for GC9106 160x80 SPI displays
  • fixed compiling error with DSP_DUMMY option
  • fixed compiling error with DSP_1602I2C / DSP_1602 option

v0.6.110

  • the logic of division by cores has been changed
  • fixed choppy playback (again)
  • improvements in the stability of the web interface
  • increased smoothness of the encoder
  • bug fixes
  • bug fixes

v0.6.012

  • fixed choppy playback

v0.6.010

  • added displays SSD1327, ILI9341, SSD1305/SSD1309, SH1107, 1602
  • added touchscreen support
  • tasks are divided into cores, now the sound is not interrupted when selecting stations / volume
  • increased speed of some displays
  • optimization of algorithms, bugs fixes

v0.5.070

  • added something similar to plugins

v0.5.035

  • added two buttons BTN_UP, BTN_DOWN
  • added the pins for the second encoder ENC2_BTNL, ENC2_BTNB, ENC2_BTNR
  • fixed display of playlist with SSD1306 configuration
  • improvements in the displays work
  • bugs fixes, some improvements

v0.5.020

  • added support for SSD1306 128x32 I2C displays

v0.5.010

  • added support for ST7789 320x240 SPI displays
  • added support for SH1106 I2C displays
  • added support for 1602 16x2 I2C displays
  • a little modified control logic
  • added buttons long press feature
  • small changes in options.h, check the correctness of your myoptions.h file
  • bugs fixes

v0.4.323

v0.4.322

  • fixed garbage in MQTT payload

v0.4.320

  • MQTT support

v0.4.315

  • added support for digital buttons for the IR control
    (num keys - enter number of station, ok - play, hash - cancel)
  • added buttons for exporting settings from the web interface
  • added MUTE_PIN to be able to control the audio output
  • fixed js/html bugs (a full update is required)

v0.4.298

  • fixed playlist scrollbar in Chrome (a full update is required)

v0.4.297

  • fix "Could not decode a text frame as UTF-8" websocket error //Thanks for Verholazila
  • fix display of non-latin characters in the web interface
  • fix css in Chrome (a full update is required)

v0.4.293

  • IR repeat fix

v0.4.292

  • added support for IR control
  • new options in options.h (ENC_INTERNALPULLUP, ENC_HALFQUARD, BTN_INTERNALPULLUP, VOL_STEP) //Thanks for Buska1968
  • сompilation error for module SSD1306 with arduino-esp32 version newest than 2.0.0
  • fix compiler warnings in options.h
  • fix some compiler warnings

v0.4.260

  • added control of balance and equalizer for VS1053
  • TFT_ROTATE and st7735 DTYPE moved to myoptions.h

v0.4.251

  • fixed compilation error bug when using VS1053 together with ST7735

v0.4.249

  • fix VS1003/1053 reseting
  • fix css in Firefox
  • fix font in NOKIA5110 display

v0.4.248

  • added support for VS1053 module in testing mode

v0.4.210

  • added timezone config by telnet
  • fix telnet output
  • some separation apples and oranges

v0.4.199

  • excluded required installation of all libraries for displays

v0.4.197

  • added support for Nokia 5110 SPI displays
  • some bugs fixes

v0.4.183

  • ovol reading bug

v0.4.182

  • display connection algorithm changed
  • added support for myoptions.h file for custom settings

v0.4.180

  • vol steps 0..256 (in ESP32-audioI2S)

v0.4.177

  • added support for SSD1306 I2C displays
  • fixed broken buttons.

yoradio's People

Contributors

e2002 avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.