{"id":16239182,"url":"https://github.com/xtrinch/esp-internet-radio","last_synced_at":"2025-03-19T16:31:16.748Z","repository":{"id":54511613,"uuid":"337126891","full_name":"xtrinch/ESP-internet-radio","owner":"xtrinch","description":"Internet radio station using an ESP32, VS1053 module, a TFT ILI9341 screen and an IR sensor.","archived":false,"fork":false,"pushed_at":"2021-03-07T08:38:18.000Z","size":2066,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-17T09:05:32.486Z","etag":null,"topics":["esp","esp32","internet-radio","radio","radio-player","vs1053"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xtrinch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-08T15:50:51.000Z","updated_at":"2024-05-19T13:12:38.000Z","dependencies_parsed_at":"2022-08-13T18:10:59.293Z","dependency_job_id":null,"html_url":"https://github.com/xtrinch/ESP-internet-radio","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtrinch%2FESP-internet-radio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtrinch%2FESP-internet-radio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtrinch%2FESP-internet-radio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtrinch%2FESP-internet-radio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xtrinch","download_url":"https://codeload.github.com/xtrinch/ESP-internet-radio/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244463727,"owners_count":20456934,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["esp","esp32","internet-radio","radio","radio-player","vs1053"],"created_at":"2024-10-10T13:42:36.581Z","updated_at":"2025-03-19T16:31:16.311Z","avatar_url":"https://github.com/xtrinch.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ESP32-internet-radio\r\n\r\nInternet radio station using an `ESP32` and a `VS1053` module.\r\n\r\nComponents:\r\n\r\n- `ESP32` dev board\r\n- `VS1053` module\r\n- `TFT ILI9341` screen\r\n- `XPT2046` touch controller (can be on the display module)\r\n- `IR1838` sensor\r\n\r\nBased on https://github.com/Edzelf/Esp-radio but heavily modified.\r\n\r\nAll configuration, including station presets are hardcoded (although they can optionally be configured via MQTT).\r\nYou can change default values in `config.cpp`.\r\n\r\nInteraction with the radio happens via the buttons on the `ILI9341`'s touch screen and the IR remote. \r\nYou should be able to use any remote, as long as you configure the right keys. \r\n\r\nControls support starting, stopping, going to next or previous station.\r\n\r\nLibrary assumes an external amplifier (you can get cheap PC speakers for 10$), so the volume is fixed at 90% and the volume control happens at the external amplifier.\r\nShould you require internal volume control, it should be easy enough to add it.\r\n\r\nSee http://www.internet-radio.com for suitable stations.\r\n\r\nThe following libraries are used to make this work:\r\n\r\n  - `bodmer/TFT_eSPI`\r\n  - `PaulStoffregen/XPT2046_Touchscreen`\r\n  - `z3t0/IRremote`\r\n  - `marvinroger/async-mqtt-client`\r\n  - `bblanchon/ArduinoJson`\r\n  - `TridentTD/TridentTD_ESP32NVS`\r\n\r\nSPI bus is shared by the `TFT LCD`, the touch controller and the the `VS1053`.\r\n\r\nBuilt with `platform.io`. \r\nWant to use it with the arduino IDE? You should be able to with slight modifications to the file structure, but you should really just use platform.io, it's far superior ;) \r\n\r\n## Usage\r\n\r\nTo get started, copy `import_env.example.py` to `import_env.py` and fill in your pin configuration.\r\n\r\nUpload the `/data` folder where the fonts reside to the ESP before flashing. You can do that with `pio run --target uploadfs` or just use the platformio addon for vscode and click on `Upload Filesystem Image`.\r\n\r\nCalibrate your screen - you will find the calibrate function within `tft-ili9341.cpp` file. Paste the calibration values as instructed.\r\n\r\n### Wiring\r\n\r\nPins are fully configurable via `import_env.py`. \r\nNote that the SPI bus is shared, so your wiring has to reflect that.\r\n\r\nExample wiring:\r\n\r\n| ESP32    | Signal | Wired to LCD                     | Wired to VS1053     | Wired to the rest          |\r\n| -------- | ------ | -------------------------------- | ------------------- | ---------------            |\r\n| GPIO32   |        | -                                | pin 1 XDCS          |  -                         |\r\n| GPIO22   |        | -                                | pin 2 XCS           |  -                         |\r\n| GPIO4    |        | -                                | pin 4 DREQ          |  -                         |\r\n| GPIO2    |        | pin 10 D/C or A0                 | -                   |  -                         |\r\n| GPIO18   | SCK    | pin 5 T_CLK (SCK) \u0026 pin 8 SCK    | pin 5 SCK           |  -                         |\r\n| GPIO19   | MISO   | pin 6 SDO (MISO) \u0026 pin 2 T_OUT   | pin 7 MISO          |  -                         |\r\n| GPIO23   | MOSI   | pin 9 SDI (MOSI) \u0026 pin 3 T_DIN   | pin 6 MOSI          |  -                         |\r\n| GPIO15   |        | pin 2 CS                         | -                   |  -                         |\r\n| GPIO27   |        | pin 4 T_CS                       | -                   |  -                         |\r\n| GPIO25   | -      | -                                | -                   |  Infrared receiver VS1838B |\r\n| -------  | ------ | -------------------------------- | ------------------- |  ----------------          |\r\n| GND      | -      | pin 8 GND                        | pin 8 GND           |  Power supply GND          |\r\n| VCC 5 V  | -      | pin 7 BL                         | -                   |  Power supply              |\r\n| VCC 5 V  | -      | pin 6 VCC                        | pin 9 5V            |  Power supply              |\r\n| EN       | -      | pin 1 RST                        | pin 3 XRST          |  -                         |\r\n\r\n![Image](https://github.com/xtrinch/ESP-internet-radio/blob/master/images/wiring.jpg)\r\n\r\n## Optional MQTT support\r\n\r\nMQTT support is optionally implemented and can be enabled via `MQTT_ENABLE` switch (see `import-env.example.py`).\r\nOne upstream and one downstream topic is required. \r\nESP will periodically ping the upstream server to let it know it is available.\r\n\r\nCommunication is focused around saving configuration, not realtime control. \r\nRealtime control is left to the touch controls and the IR remote.\r\n\r\n### Downstream\r\n\r\nServer can send commands downstream in the following format:\r\n\r\n```\r\n{\r\n  data: {\r\n    type: 'config' | 'config-request',\r\n    payload: { // optional\r\n      presets: [\r\n        \"preset1.com\",\r\n        \"preset2.com\"\r\n      ]\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nCommand types:\r\n- `config-request`: server requests config\r\n- `config`: server sends config in payload\r\n\r\n### Upstream\r\n\r\nESP responds upstream with the same format:\r\n\r\n```\r\n{\r\n  data: {\r\n    type: 'config' | 'ping',\r\n    payload: { // optional\r\n      presets: [\r\n        \"preset1.com\",\r\n        \"preset2.com\"\r\n      ]\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nTypes:\r\n- `config`: ESP sends config upstream\r\n- `ping`: ESP sends a ping","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxtrinch%2Fesp-internet-radio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxtrinch%2Fesp-internet-radio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxtrinch%2Fesp-internet-radio/lists"}