8.5 KiB
ёRadio
Web-radio based on ESP32-audioI2S or/and ESP32-vs1053_ext library
- Hardware
- Connection tables
- Software dependencies
- Hardware setup
- Quick start
- More features
- Version history
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
- ST7735 1.8' or 1.44' https://aliexpress.com/item/1005002822797745.html
- or SSD1306 0.96' I2C https://aliexpress.com/item/1005001621806398.html
- or Nokia5110 84x48 SPI https://aliexpress.com/item/1005001621837569.htmlz
Controls
- Three tact buttons https://www.aliexpress.com/item/32907144687.html
- Encoder https://www.aliexpress.com/item/32873198060.html
- IR Control https://www.aliexpress.com/item/32562721229.html
https://www.aliexpress.com/item/33009687492.html
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 |
| 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 | ESP-32 | options.h |
|---|---|---|
| GND | GND | - |
| PIN | * | ENC_BTNx, BTN_xxx, LED_BUILTIN, IR_PIN |
* Any free pin, configured in options.h
** GPIOs 34-39 don't have software pullup/down functions. For encoder/buttons use an external pullup resistor, 10 kOhm works here
Dependencies
Libraries:
Library Manager: Adafruit_GFX, Adafruit_ST7735*, Adafruit_SSD1306*, Adafruit_PCD8544*, (* depending on display model), ESP32Encoder, OneButton, IRremoteESP8266
Github: ESPAsyncWebServer, AsyncTCP
Tool:
Hardware setup
Hardware is connected in the options.h file.
so that the settings are not overwritten when updating git, you need to put the file myoptions.h (exsample) in the root of the project and make settings in it \
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:
/* DISPLAY MODEL
* 0 - DUMMY
* 1 - ST7735
* 2 - SSD1306
* 3 - NOKIA5110
*/
#define DSP_MODEL 1
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
- In ArduinoIDE - upload sketch data via Tools→ESP32 Sketch Data Upload (it's here)
- Upload the sketch to the board (example of the board settings)
- 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 - After successful connection go to http://<yoipaddress>/ , add stations to playlist (or import WebStations.txt from KaRadio)
- Well done!
Localization: Если Adafruit_GFX ещё не русифицирована, русифицировать её, заменив файл Arduino/libraries/Adafruit_GFX_Library/glcdfont.c файлом yoRadio/fonts/glcdfont.c
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
Version history
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.
