DMX512 helpers for FT231XS-based RS-485 HIL setups
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lr_dmx-0.2.1.tar.gz.
File metadata
- Download URL: lr_dmx-0.2.1.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a309e34ae2364ec85da0c7d38d2aa4a7ef0f630a4f9beb3bcd75639f7afc3f93
|
|
| MD5 |
fc7fb72ec5353069ebc1b679aa1023ed
|
|
| BLAKE2b-256 |
0333402ad66110598159863cf1e88414639eda1190422b3ee749b19b2f696a1c
|
File details
Details for the file lr_dmx-0.2.1-py3-none-any.whl.
File metadata
- Download URL: lr_dmx-0.2.1-py3-none-any.whl
- Upload date:
- Size: 16.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9bace870a23efeeee790559dc8dee74d55edad2a899c730916c919ca8d7ce055
|
|
| MD5 |
f4efb19fbdc03aa9be9c508b6a588d74
|
|
| BLAKE2b-256 |
dfe270d55aaf8fa2fc30d7b63196ec51f7bfc1d0475a7cf591d918290918f9ce
|