lr-dmx
Lightweight DMX512 helper tailored for FTDI-based hardware-in-the-loop setups with explicit BREAK / Mark-After-Break control. The package provides both a CLI (lr-dmx) and Python APIs for streaming frames or inspecting a live universe.
Features
- Deterministic transmitter with configurable BREAK/MAB timings and FPS throttling
- Receiver that aligns to PARMRK BREAK markers for robust resynchronisation
- Pure-Python helpers that can be embedded into bespoke hardware-in-the-loop test harnesses
- CLI wrappers utilities for quick experiments, scripting, and test automation
Installation
python -m pip install lr-dmx
For development work inside this repository, install in editable mode together with the extra tooling:
python -m pip install -e python/lr_dmx[dev]
CLI usage
Send constant or patched scenes
lr-dmx send --port /dev/ttyUSB1 --fps 41 --value 64 --set 0=255 --set 5=0
Flags such as --frames, --duration, --break-us, and --mab-us allow you to bound a test run or fine-tune the waveform. Use the LR_DMX_PORT environment variable to set a default adapter path.
Receive with BREAK lock
lr-dmx receive --port /dev/ttyUSB0 --show 32 --stats --stats-interval 10
Each frame is tagged as OK (BREAK-synchronised) or BEST (length-only) so you can judge whether the receiver is coasting between marker hiccups.
Python API
from lr_dmx import DMXTransmitter, DMXReceiver, build_constant_frame
frame = build_constant_frame(0x80)
with DMXTransmitter("/dev/ttyUSB1") as tx:
tx.stream(frame, fps=30.0, frame_count=300)
with DMXReceiver("/dev/ttyUSB0") as rx:
for idx, frame in enumerate(rx.frames()):
print(idx, frame.start_code, list(frame.slots[:8]))
if idx >= 10:
break
License
Released under the MIT License. Copyright (c) 2026 Jonas Estberger.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Release files for lr-dmx 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| lr_dmx-0.2.3.tar.gz | 11.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lr_dmx-0.2.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.8 kB
Release files / lr_dmx-0.2.3.tar.gz
| Download URL | lr_dmx-0.2.3.tar.gz |
|---|---|
| Size | 11.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
70f37ecbc5a5aa57087af9c2488357a9f478c3a0c50222e619438215442a7f4b
|
|
BLAKE2b-256 checksum How to use checksums |
7cd180affa901810b07bbdde7be4b87e3276a6d0d9b8577ae72dea4b5e475f02
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / lr_dmx-0.2.3-py3-none-any.whl
| Download URL | lr_dmx-0.2.3-py3-none-any.whl |
|---|---|
| Size | 16.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1f595cdf3656f14e2a307ff4616a31f30308dbd706ac1e6c01817023aedad777
|
|
BLAKE2b-256 checksum How to use checksums |
70503224c9a093b82a9727e4d8d303338f91e4c405dbb1718021e73e16b7fa5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|