Distributed RGB LED Controller
A networked, event-driven lighting controller supporting synchronized LED effects across multiple devices with real-time audio and external integrations.
Functional Description
- Supports position-based LED effects streamed and synchronized across multiple networked devices
- Integrates with external event sources and reacts to music
- Provides an HTTP API for controlling effects, updating parameters, and managing device states
Networking
- mDNS used for automatic device discovery and network identification
- TCP socket for receiving external event data and synchronization messages
- UDP socket for high-throughput streaming of RGB frame data to endpoint devices
Web Server
The controller exposes a RESTful web interface built using the Axon web framework, allowing seamless integration with browsers and automation tools.
- Handles device registration, discovery, and pairing
- Provides endpoints for enabling or disabling connected devices
- Supports selection of lighting effects, parameter tuning, and playback control (pause/resume)
Multithreaded Architecture
The system is built around a concurrent design where each functional component runs independently, enabling smooth real-time updates and synchronization.
- Each device runs in its own thread, consuming a stream of RGB color frames to send to the hardware
- The effect thread manages the currently active effect — receiving events and computing the state used by the device manager
- The device manager calls a shader closure with the position of each LED, producing the color output streamed to device threads
- Event source threads feed events into the effect controller to influence animations or transitions in real time
Supported Endpoint Devices
- Nanoleaf Shapes: communicate through RESTful API calls and support UDP streaming
- NeoPixel LED strips: controlled by an ESP32 device programmed to take streamed color data through UDP