DMX512 helpers for FT231XS-based UART<->RS-485 development setups
Project description
lr-dmx
DMX512 helpers that reuse the same FT231XS-based hardware but operate the port at 250000-8N2 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
- CLI-compatible wrappers for the legacy
tests/send-dmx.pyandtests/receive-dmx.pyutilities - Pure-Python helpers that can be embedded into bespoke hardware-in-the-loop harnesses
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
These modules follow the same license as the parent repository. See the root LICENSE file for details.
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.0.tar.gz.
File metadata
- Download URL: lr_dmx-0.2.0.tar.gz
- Upload date:
- Size: 11.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b10c063d2b1c20bdfa4d32ab514a2c0fc9c5c729ad3d628856b771a8b39ee1de
|
|
| MD5 |
183727dd4bb5e15a5f51a6c18257321d
|
|
| BLAKE2b-256 |
e9aa5f22d0f7db8964f83608f32325b780118362a9fee14d6b35c0f7c7835b39
|
File details
Details for the file lr_dmx-0.2.0-py3-none-any.whl.
File metadata
- Download URL: lr_dmx-0.2.0-py3-none-any.whl
- Upload date:
- Size: 15.4 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 |
13c431c7987a740fba02e3d0219972a31e9f3e84303a664be7994d9430afa69d
|
|
| MD5 |
b0b657e173125e9468d6a5e5a7710625
|
|
| BLAKE2b-256 |
9708503825620a7d23e2c0f54e7ed41b5958668bc171199a9a7a9269afdf6280
|