All Projects
Design + Build StructureSense · 2024 Solo Build

LoRa DMX
Wireless Stage Lighting Control

A full-stack IoT solution enabling real-time control of DMX512 lighting fixtures over LoRaWAN networks. Bridging the gap between city-scale wireless infrastructure and professional stage lighting protocols.

C++ / PlatformIO Vue.js 3 Node.js PostgreSQL LoRaWAN Class C The Things Network

The Challenge

Range Limitation: Standard DMX512 is a wired protocol limited to ~1,200 meters. Wireless DMX (2.4GHz) solutions suffer from interference and short range.

Infrastructure Problem: Lighting a bridge, a distant tower, or a distributed festival ground usually requires miles of expensive data cabling or complex Wi-Fi bridges.

Latency Trade-off: LoRaWAN is designed for low-power sensor uplinks, not real-time lighting control downlinks. Standard Class A devices only listen for 1 second after sending data — unusable for live cues.

Project Goals

  • Enable miles of range without local internet or cables.
  • Achieve near real-time latency for lighting cues.
  • Support complex patterns without saturating the low-bandwidth network.
  • Secure, multi-user web dashboard for remote management.

System Architecture

graph LR subgraph "Frontend (Vue.js)" UI[Web Dashboard] Auth[Auth Service] end subgraph "Backend (Node.js)" API[Express API] Queue[Bull.js Queue] DB[(PostgreSQL)] MQTT[MQTT Bridge] end subgraph "LoRaWAN Network" TTN[The Things Network] GW[LoRaWAN Gateway] end subgraph "Edge Device (C++)" ESP[Heltec V3 ESP32] LoRa[SX1262 Radio] DMX[MAX485 Driver] Lights[DMX Fixtures] end UI -->|REST API| API API -->|Store State| DB API -->|Enqueue Command| Queue Queue -->|Process| MQTT MQTT -->|Downlink| TTN TTN -.->|Long Range RF| GW GW -.->|Long Range RF| LoRa LoRa -->|Interrupt| ESP ESP -->|RS-485| DMX DMX -->|DMX512 Signal| Lights

Firmware & Hardware

Built on the Heltec LoRa 32 V3. Operates in Class C mode, keeping the receive window open continuously for immediate command execution. Features a custom DMX engine that handles local pattern generation (Rainbow, Strobe) to reduce network traffic.

Async Command Queue

LoRaWAN is inherently asynchronous, so the backend uses Bull.js to manage command queues. This decouples the UI from network latency, providing immediate feedback ("Pending" → "Sent") while handling retries and network constraints in the background.

Security & Access

A Role-Based Access Control (RBAC) system lets device owners share control with operators or viewers. Security is enforced via JWTs, and device communication is secured via LoRaWAN's AES-128 encryption (AppSKey/NwkSKey).

JSON Command Protocol

To overcome LoRaWAN bandwidth limitations, the system uses a high-level JSON protocol. Instead of streaming raw DMX frames, the server sends compact commands that trigger complex, locally-generated effects on the edge device.

This moves the "intelligence" to the edge, enabling smooth animations like rainbows and strobes without saturating the network.

Downlink Payload Examples
// 1. Direct Control
{
  "lights": [
    { "address": 1, "channels": [255, 0, 128, 0] }
  ]
}

// 2. Rainbow Effect (Locally Generated)
{
  "test": {
    "pattern": "rainbow",
    "speed": 50,
    "cycles": 3
  }
}

Class C Operation

Standard LoRaWAN devices (Class A) sleep 99% of the time. Class C keeps the receive window permanently open, allowing the server to push a command at any time with near-instant latency — essential for live lighting cues.

The Control Interface

Dashboard Screenshot Device List & Color Picker
1

Device Registration

Users register devices using their DevEUI. The system validates ownership and sets up the MQTT bridge automatically.

2

Pattern Selection

Users select from presets (Static, Fade, Strobe) or create custom color sequences. The UI validates payload size before sending.

3

Real-time Status

The dashboard listens for uplink acknowledgments to confirm lights have changed, closing the feedback loop.