WaveDisp
A 64 × 64 RGB LED matrix you control from any browser: clocks, animations, pixel art, QR codes and Spotify album art, rendered on a Raspberry Pi Zero 2 W.

Twelve Display Modes
Clock, stopwatch, matrix rain, Game of Life, Bad Apple, QR codes, a drawing canvas, Spotify album art and more, switched with a smooth fade.
Live Preview
The dashboard streams the panel’s framebuffer back as MJPEG, so you see exactly what the LEDs show from anywhere on the network.
Presets & Schedules
Ten named preset slots, recalled instantly or on a weekly schedule, such as a bright clock at 08:00 and lights out at 23:00.
Pixel-Art Canvas
Draw straight onto the matrix from a phone or laptop. Strokes are batched and streamed to the panel as you paint.
Built for a 512 MB Pi
Two processes, shared-memory hand-off and frame skipping keep a Pi Zero 2 W
cool and responsive, driving the panel through hzeller/rpi-rgb-led-matrix.
Safe by Default
Every setting is validated before it reaches the renderer, the Spotify secret never leaves the device, and cross-site requests can’t drive it.
Overview
WaveDisp turns a Waveshare P2.5 64 × 64 HUB75 panel
and a Raspberry Pi Zero 2 W into a network-connected display. A FastAPI backend
owns the configuration and drives the panel; a React dashboard, served by the
same backend, lets any device on the network change modes, tune colours and
layouts, draw pixel art, and manage presets. Everything is also available over
a small REST API, so the display can be scripted from Home Assistant or curl.
Display Modes
Every image below comes straight out of WaveDisp’s own renderer: the exact 64 × 64 frame it sends to the panel, drawn as an LED grid.










Rounding it out are Spotify (the album art of whatever is playing, fetched through the Spotify Web API with OAuth), a full-panel colour-cycling Alarm, and Off.
The Dashboard
The dashboard is a single-page React app with a bold, high-contrast look and fully themeable light and dark palettes. Each mode gets its own settings panel, and changes show up on the panel almost instantly.







How It Works

- Two processes, one writer. The FastAPI process owns all configuration.
The API, the scheduler and the Spotify poller all go through a single
StateStore, which validates each change, bumps a version number, and publishes a snapshot to the render process through shared memory. The renderer only ever reads, so it never waits on a lock or a network call. - Frame skipping. Every display mode reports a small frame key that changes only when its picture would. If neither the key nor the settings changed, the frame is skipped entirely; the LED driver’s own real-time thread keeps refreshing the panel. A plain clock redraws once per second instead of 120 times.
- Cached glyphs. Rendered text is cached as alpha masks and pasted, so a clock frame renders in about 0.4 ms on the Pi instead of 14 ms, with output verified pixel-identical to drawing the text directly.
- Fades that actually fade. The driver applies brightness as pixels are written, so mode transitions ramp brightness across real frames rather than adjusting a value the panel never sees.
- Supervised. A failing frame is logged and blanked instead of crashing the renderer. If the render process does die, the whole service exits so systemd restarts it. On shutdown, the panel is cleared.
Performance on a Pi Zero 2 W
Measured on the device, with the same configuration before and after the rendering pipeline rework:
| Metric | Before | After |
|---|---|---|
| Render thread CPU, clock mode | 75% | 0.8% |
| Clock frame render time | 13.8 ms | 0.42 ms |
| Full drawing canvas render time | 29 ms | 0.06 ms |
| Matrix rain render time | 4.9 ms | 1.5 ms |
| Python processes / memory (RSS) | 3 / 211 MB | 2 / 148 MB |
The LED driver’s refresh thread, which bit-bangs the panel and runs at real-time priority, is unaffected and still uses most of one core by design. Everything WaveDisp adds on top now sits near idle.
Reliability & Security
- Validated configuration. Every write is checked against a strict Pydantic
schema with ranges, enums and safe font file names. Invalid input is rejected
with a
422before it can reach the renderer, and a stale or hand-edited config file falls back to defaults key by key instead of failing to boot. - SD-card friendly. Saves are debounced and atomic (temp file,
fsync, rename), so a burst of slider changes becomes one write, and pulling the plug can’t corrupt the config. - No secrets over the wire. The Spotify client secret is stored on the device but never returned by the API.
- No drive-by control. Browser requests that change state are only accepted from the dashboard’s own origin, so a web page you happen to visit can’t drive the display. Scripts and Home Assistant are unaffected.
- Tested. A pytest suite covers config validation, presets, the API and the render loop (frame skipping, fades, error recovery) through a built-in hardware emulator, so it runs on any machine.
Technology Stack
Frontend
- Framework: React 19 / Vite 8
- Styling: Vanilla CSS with custom properties, with user-editable light and dark palettes.
- Icons:
lucide-react
Backend
- Server: FastAPI and Uvicorn
- Validation: Pydantic v2 (
backend/config.py) - Rendering: Pillow and NumPy, with a shared-memory hand-off to the render
process (
backend/channels.py) - Integrations: Spotipy (Spotify Web API), Segno (QR codes)
Hardware & Deployment
- Target: Raspberry Pi Zero 2 W, Waveshare P2.5 64 × 64 HUB75 panel, and an Adafruit RGB Matrix Bonnet or compatible wiring.
- Driver: hzeller/rpi-rgb-led-matrix Python bindings.
- Deployment:
deploy.shbuilds the dashboard, syncs it to the Pi over SSH and installs a systemd service, without ever overwriting the device’s own config or Spotify tokens. - HTTPS: Optional, via
WAVEDISP_USE_HTTPSand your own certificate.
Try It Without a Pi
The renderer can run against a built-in emulator, with the dashboard’s live preview standing in for the panel:
git clone https://github.com/nicx17/wavedisp && cd wavedisp
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
npm --prefix dashboard install && npm --prefix dashboard run build
WAVEDISP_EMULATE_MATRIX=true python backend/main.py
# then open http://localhost:5000
Project Links & Reference
- Repository: github.com/nicx17/wavedisp
- API Reference: docs/API.md
- Hardware Reference: Waveshare P2.5 64x64
- Underlying Driver: hzeller/rpi-rgb-led-matrix