# ovionekenoby/esp32-wrover-internet-radio architecture

> Architecture diagram of the GitHub repository ovionekenoby/esp32-wrover-internet-radio, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ovionekenoby/esp32-wrover-internet-radio
- Repository: https://github.com/ovionekenoby/esp32-wrover-internet-radio

## Overview

This is ESP32 internet-radio and Bluetooth-sink firmware. The main user workflow is selecting or browsing a station, starting playback, and controlling it through physical controls or the local web manager; audio is streamed to the DAC and the display reflects device state. WiFi setup, persisted station lists, Radio Browser discovery, idle time display, diagnostics, and authenticated remote control are substantial supporting capabilities. The graph follows documented behavior and visible references; unsampled subsystem internals are represented at their exact source paths without assuming their internal call chains.

Main entry points: [`src/main.cpp`](https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/main.cpp) (Application state), [`src/rtcp_server.cpp`](https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/rtcp_server.cpp) (Authenticated RTCP server), [`src/web_portal.cpp`](https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/web_portal.cpp) (Local web manager), [`src/audio.cpp`](https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/audio.cpp) (Radio and Bluetooth audio)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Interaction and display"]
  node_application["Application state<br/>[main.cpp]"]
  node_controls["Buttons and encoder<br/>[input.cpp]"]
  node_epaper["E-paper display<br/>[display.cpp]"]
end

subgraph group_radio["Radio and stations"]
  node_audio["Radio and Bluetooth audio<br/>[audio.cpp]"]
  node_stream_sources["HTTP&#40;S&#41; stream sources"]
  node_station_lists[("Stations, Favorites, Recent<br/>[stations.cpp]")]
  node_radio_browser["Radio Browser discovery<br/>[browser.cpp]"]
  node_remote_browser["Remote station browsing<br/>[remote_browser.cpp]"]
end

subgraph group_connectivity["Connectivity and web"]
  node_wifi["WiFi management<br/>[net_manager.cpp]"]
  node_web_manager["Local web manager<br/>[web_portal.cpp]"]
end

subgraph group_remote["Remote control"]
  node_rtcp_server["Authenticated RTCP server<br/>[rtcp_server.cpp]"]
  node_rtcp_catalog["Remote catalog control<br/>[rtcp_catalog.cpp]"]
  node_rtcp_bluetooth["Remote Bluetooth control<br/>[rtcp_btx.cpp]"]
  node_rtcp_full_control["Remote source control"]
  node_rtcp_browser["Remote browser control<br/>[rtcp_browser.cpp]"]
end

subgraph group_services["Time and diagnostics"]
  node_clock["Timezone and NTP<br/>[time_service.cpp]"]
  node_health["Runtime diagnostics<br/>[system_info.cpp]"]
  node_audio_diagnostics["Audio memory diagnostics"]
end

node_listener(("Listener"))

node_listener -->|"operates"| node_controls
node_listener -->|"configures"| node_web_manager
node_controls -->|"provides input"| node_application
node_application -->|"updates display"| node_epaper
node_application -->|"controls playback"| node_audio
node_audio -->|"opens streams"| node_stream_sources
node_application -->|"manages stations"| node_station_lists
node_application -->|"requests listings"| node_radio_browser
node_application -->|"coordinates browsing"| node_remote_browser
node_application -->|"connects network"| node_wifi
node_application -->|"starts manager"| node_web_manager
node_web_manager -->|"adds stations"| node_station_lists
node_web_manager -->|"reads network state"| node_wifi
node_web_manager -->|"sets timezone"| node_clock
node_application -->|"updates time"| node_clock
node_application -->|"polls and publishes"| node_rtcp_server
node_rtcp_server -->|"dispatches controls"| node_audio
node_rtcp_server -->|"dispatches catalog"| node_rtcp_catalog
node_rtcp_server -->|"dispatches Bluetooth"| node_rtcp_bluetooth
node_rtcp_server -->|"dispatches source"| node_rtcp_full_control
node_rtcp_server -->|"dispatches browsing"| node_rtcp_browser
node_application -->|"logs boot info"| node_health
node_application -->|"initializes diagnostics"| node_audio_diagnostics

click node_application "https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/main.cpp"
click node_controls "https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/input.cpp"
click node_epaper "https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/display.cpp"
click node_audio "https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/audio.cpp"
click node_stream_sources "https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/AudioFileSourceICYSStream.cpp"
click node_station_lists "https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/stations.cpp"
click node_radio_browser "https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/browser.cpp"
click node_remote_browser "https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/remote_browser.cpp"
click node_wifi "https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/net_manager.cpp"
click node_web_manager "https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/web_portal.cpp"
click node_rtcp_server "https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/rtcp_server.cpp"
click node_rtcp_catalog "https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/rtcp_catalog.cpp"
click node_rtcp_bluetooth "https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/rtcp_btx.cpp"
click node_rtcp_full_control "https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/rtcp_full_control.cpp"
click node_rtcp_browser "https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/rtcp_browser.cpp"
click node_clock "https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/time_service.cpp"
click node_health "https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/system_info.cpp"
click node_audio_diagnostics "https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/mp3_memory_diagnostics.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_application,node_controls,node_epaper toneBlue
class node_audio,node_stream_sources,node_station_lists,node_radio_browser,node_remote_browser toneAmber
class node_wifi,node_web_manager toneMint
class node_rtcp_server,node_rtcp_catalog,node_rtcp_bluetooth,node_rtcp_full_control,node_rtcp_browser toneRose
class node_clock,node_health,node_audio_diagnostics,node_listener toneIndigo
```

## Components

### Interaction and display

- [Application state](https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/main.cpp): `src/main.cpp`
- [Buttons and encoder](https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/input.cpp): `src/input.cpp`
- [E-paper display](https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/display.cpp): `src/display.cpp`

### Radio and stations

- [Radio and Bluetooth audio](https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/audio.cpp): `src/audio.cpp`
- [HTTP(S) stream sources](https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/AudioFileSourceICYSStream.cpp): `src/AudioFileSourceICYSStream.cpp`
- [Stations, Favorites, Recent](https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/stations.cpp): `src/stations.cpp`
- [Radio Browser discovery](https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/browser.cpp): `src/browser.cpp`
- [Remote station browsing](https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/remote_browser.cpp): `src/remote_browser.cpp`

### Connectivity and web

- [WiFi management](https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/net_manager.cpp): `src/net_manager.cpp`
- [Local web manager](https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/web_portal.cpp): `src/web_portal.cpp`

### Remote control

- [Authenticated RTCP server](https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/rtcp_server.cpp): `src/rtcp_server.cpp`
- [Remote catalog control](https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/rtcp_catalog.cpp): `src/rtcp_catalog.cpp`
- [Remote Bluetooth control](https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/rtcp_btx.cpp): `src/rtcp_btx.cpp`
- [Remote source control](https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/rtcp_full_control.cpp): `src/rtcp_full_control.cpp`
- [Remote browser control](https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/rtcp_browser.cpp): `src/rtcp_browser.cpp`

### Time and diagnostics

- [Timezone and NTP](https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/time_service.cpp): `src/time_service.cpp`
- [Runtime diagnostics](https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/system_info.cpp): `src/system_info.cpp`
- [Audio memory diagnostics](https://github.com/ovionekenoby/esp32-wrover-internet-radio/blob/main/src/mp3_memory_diagnostics.cpp): `src/mp3_memory_diagnostics.cpp`

### Other components

- **Listener**

## Connections

- Listener → Buttons and encoder: operates (evidence: `README.md`)
- Listener → Local web manager: configures (evidence: `README.md`)
- Buttons and encoder → Application state: provides input (evidence: `src/main.cpp`)
- Application state → E-paper display: updates display (evidence: `src/main.cpp`)
- Application state → Radio and Bluetooth audio: controls playback (evidence: `src/main.cpp`)
- Radio and Bluetooth audio → HTTP(S) stream sources: opens streams (evidence: `src/audio.cpp`)
- Application state → Stations, Favorites, Recent: manages stations (evidence: `src/main.cpp`)
- Application state → Radio Browser discovery: requests listings (evidence: `src/main.cpp`)
- Application state → Remote station browsing: coordinates browsing (evidence: `src/main.cpp`)
- Application state → WiFi management: connects network (evidence: `src/main.cpp`)
- Application state → Local web manager: starts manager (evidence: `src/main.cpp`)
- Local web manager → Stations, Favorites, Recent: adds stations (evidence: `src/web_portal.cpp`)
- Local web manager → WiFi management: reads network state (evidence: `src/web_portal.cpp`)
- Local web manager → Timezone and NTP: sets timezone (evidence: `src/web_portal.cpp`)
- Application state → Timezone and NTP: updates time (evidence: `src/main.cpp`)
- Application state → Authenticated RTCP server: polls and publishes (evidence: `src/main.cpp`)
- Authenticated RTCP server → Radio and Bluetooth audio: dispatches controls (evidence: `src/rtcp_server.cpp`)
- Authenticated RTCP server → Remote catalog control: dispatches catalog (evidence: `src/rtcp_server.cpp`)
- Authenticated RTCP server → Remote Bluetooth control: dispatches Bluetooth (evidence: `src/rtcp_server.cpp`)
- Authenticated RTCP server → Remote source control: dispatches source (evidence: `src/rtcp_server.cpp`)
- Authenticated RTCP server → Remote browser control: dispatches browsing (evidence: `src/rtcp_server.cpp`)
- Application state → Runtime diagnostics: logs boot info (evidence: `src/main.cpp`)
- Application state → Audio memory diagnostics: initializes diagnostics (evidence: `src/main.cpp`)
