# hdb-studio/custom-5v3 architecture

> Architecture diagram of the GitHub repository hdb-studio/custom-5v3, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hdb-studio/custom-5v3
- Repository: https://github.com/hdb-studio/custom-5v3

## Overview

R35050 is ESP32 LED-strip firmware, accompanied by a Windows client that maps CPU load to color commands. The main workflow is serial or web color control, followed by master-to-device UDP synchronization and LED output. The README also documents WiFi provisioning, device discovery, synchronized blinking, administration, and persistent configuration. The tree contains two firmware sketches; the excerpts do not show their implementation details, so the capability links below follow README descriptions rather than inspected call sites.

Main entry points: [`R35050.ino`](https://github.com/hdb-studio/custom-5v3/blob/main/R35050.ino) (ESP32 firmware), [`R35050_ESP32C3.ino`](https://github.com/hdb-studio/custom-5v3/blob/main/R35050_ESP32C3.ino) (ESP32-C3 sketch), [`client/cpu_led_client.cpp`](https://github.com/hdb-studio/custom-5v3/blob/main/client/cpu_led_client.cpp) (CPU color client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["User Control"]
  node_firmware["ESP32 firmware<br/>[R35050.ino]"]
  node_c3firmware["ESP32-C3 sketch<br/>[R35050_ESP32C3.ino]"]
  node_webadmin["Web management<br/>[R35050.ino]"]
  node_provision["WiFi provisioning<br/>[R35050.ino]"]
  node_serial["Serial commands<br/>[R35050.ino]"]
end

subgraph group_network["Device Network"]
  node_discovery["Device discovery<br/>[R35050.ino]"]
  node_color["Color synchronization<br/>[R35050.ino]"]
  node_blink["Synchronized blinking<br/>[R35050.ino]"]
  node_udp(("UDP LAN"))
  node_wifi(("WiFi network"))
end

subgraph group_hardware["LEDs and State"]
  node_led["LED output<br/>[R35050.ino]"]
  node_nvs[("NVS configuration<br/>[R35050.ino]")]
end

subgraph group_desktop["Windows Client"]
  node_cpuclient["CPU color client<br/>[cpu_led_client.cpp]"]
  node_serialport(("Serial connection"))
end

node_user(("Administrator"))
node_browser(("Browser"))
node_pc(("PC user"))

node_user -->|"configures"| node_browser
node_browser -->|"submits WiFi"| node_provision
node_provision -->|"connects"| node_wifi
node_browser -->|"controls"| node_webadmin
node_webadmin -->|"updates settings"| node_firmware
node_firmware -->|"reads/writes"| node_nvs
node_firmware -->|"starts setup"| node_provision
node_firmware -->|"handles commands"| node_serial
node_serial -->|"sets color"| node_color
node_serial -->|"triggers"| node_blink
node_firmware -->|"runs discovery"| node_discovery
node_discovery -->|"broadcasts/responds"| node_udp
node_color -->|"broadcasts commands"| node_udp
node_blink -->|"sends timing commands"| node_udp
node_udp -->|"delivers commands"| node_color
node_udp -->|"delivers reports"| node_discovery
node_udp -->|"delivers timing"| node_blink
node_color -->|"applies color"| node_led
node_blink -->|"drives flashing"| node_led
node_webadmin -->|"controls LEDs"| node_led
node_firmware -->|"joins LAN"| node_wifi
node_pc -->|"starts/configures"| node_cpuclient
node_cpuclient -->|"opens and sends"| node_serialport
node_serialport -->|"delivers commands"| node_serial
node_c3firmware -->|"joins LAN"| node_wifi
node_c3firmware -->|"drives LEDs"| node_led

click node_firmware "https://github.com/hdb-studio/custom-5v3/blob/main/R35050.ino"
click node_c3firmware "https://github.com/hdb-studio/custom-5v3/blob/main/R35050_ESP32C3.ino"
click node_webadmin "https://github.com/hdb-studio/custom-5v3/blob/main/R35050.ino"
click node_provision "https://github.com/hdb-studio/custom-5v3/blob/main/R35050.ino"
click node_serial "https://github.com/hdb-studio/custom-5v3/blob/main/R35050.ino"
click node_discovery "https://github.com/hdb-studio/custom-5v3/blob/main/R35050.ino"
click node_color "https://github.com/hdb-studio/custom-5v3/blob/main/R35050.ino"
click node_blink "https://github.com/hdb-studio/custom-5v3/blob/main/R35050.ino"
click node_led "https://github.com/hdb-studio/custom-5v3/blob/main/R35050.ino"
click node_nvs "https://github.com/hdb-studio/custom-5v3/blob/main/R35050.ino"
click node_cpuclient "https://github.com/hdb-studio/custom-5v3/blob/main/client/cpu_led_client.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_firmware,node_c3firmware,node_webadmin,node_provision,node_serial,node_browser,node_pc toneBlue
class node_discovery,node_color,node_blink,node_udp,node_wifi toneAmber
class node_led,node_nvs toneMint
class node_cpuclient,node_serialport toneRose
class node_user toneIndigo
```

## Components

### User Control

- [ESP32 firmware](https://github.com/hdb-studio/custom-5v3/blob/main/R35050.ino): `R35050.ino`
- [ESP32-C3 sketch](https://github.com/hdb-studio/custom-5v3/blob/main/R35050_ESP32C3.ino): `R35050_ESP32C3.ino`
- [Web management](https://github.com/hdb-studio/custom-5v3/blob/main/R35050.ino): `R35050.ino`
- [WiFi provisioning](https://github.com/hdb-studio/custom-5v3/blob/main/R35050.ino): `R35050.ino`
- [Serial commands](https://github.com/hdb-studio/custom-5v3/blob/main/R35050.ino): `R35050.ino`

### Device Network

- [Device discovery](https://github.com/hdb-studio/custom-5v3/blob/main/R35050.ino): `R35050.ino`
- [Color synchronization](https://github.com/hdb-studio/custom-5v3/blob/main/R35050.ino): `R35050.ino`
- [Synchronized blinking](https://github.com/hdb-studio/custom-5v3/blob/main/R35050.ino): `R35050.ino`
- **UDP LAN**
- **WiFi network**

### LEDs and State

- [LED output](https://github.com/hdb-studio/custom-5v3/blob/main/R35050.ino): `R35050.ino`
- [NVS configuration](https://github.com/hdb-studio/custom-5v3/blob/main/R35050.ino): `R35050.ino`

### Windows Client

- [CPU color client](https://github.com/hdb-studio/custom-5v3/blob/main/client/cpu_led_client.cpp): `client/cpu_led_client.cpp`
- **Serial connection**

### Other components

- **Administrator**
- **Browser**
- **PC user**

## Connections

- Administrator → Browser: configures
- Browser → WiFi provisioning: submits WiFi
- WiFi provisioning → WiFi network: connects
- Browser → Web management: controls
- Web management → ESP32 firmware: updates settings
- ESP32 firmware → NVS configuration: reads/writes
- ESP32 firmware → WiFi provisioning: starts setup
- ESP32 firmware → Serial commands: handles commands
- Serial commands → Color synchronization: sets color
- Serial commands → Synchronized blinking: triggers
- ESP32 firmware → Device discovery: runs discovery
- Device discovery → UDP LAN: broadcasts/responds
- Color synchronization → UDP LAN: broadcasts commands
- Synchronized blinking → UDP LAN: sends timing commands
- UDP LAN → Color synchronization: delivers commands
- UDP LAN → Device discovery: delivers reports
- UDP LAN → Synchronized blinking: delivers timing
- Color synchronization → LED output: applies color
- Synchronized blinking → LED output: drives flashing
- Web management → LED output: controls LEDs
- ESP32 firmware → WiFi network: joins LAN
- PC user → CPU color client: starts/configures
- CPU color client → Serial connection: opens and sends
- Serial connection → Serial commands: delivers commands
- ESP32-C3 sketch → WiFi network: joins LAN
- ESP32-C3 sketch → LED output: drives LEDs
