RPC client helpers for DMX tester firmware
Project description
lr-dmx-tester
Python CLI and API for communicating with DMX tester firmware over the RPC serial interface.
Install
Install from PyPI:
python -m pip install lr-dmx-tester
Or install from this repository:
python -m venv .venv
source .venv/bin/activate
python -m pip install -e .
CLI usage
The package provides the dmx_tester command:
dmx_tester --help
The first argument is a serial target, either:
- A tty path, for example /dev/ttyACM1
- A board serial number, for example 1050266122
Examples:
dmx_tester /dev/ttyACM1 send --data-val 0x55 --data-len 24
dmx_tester 1050266122 send-baud 250000 --data-val 0x12 --data-len 24
dmx_tester 1050266122 send-many 100 --data-val 0x7f --data-len 24
dmx_tester 1050266122 receive
dmx_tester 1050266122 latency --data-len 128 --n-reports 3
dmx_tester 1050266122 reset
Common options:
- --timeout: Per-line serial timeout in seconds
- --log-level: DEBUG, INFO, WARNING, or ERROR
- --no-reset-before: Skip reset before the selected command
- --no-reset-after: Skip reset after the selected command
The CLI prints JSON output to stdout.
Python API
Primary classes:
- RpcClient: Low-level RPC transport and request/response handling
- DmxCommands: High-level DMX command wrappers
Example:
from dmx_tester.rpc_client import RpcClient
from dmx_tester.cmd_dmx import DmxCommands
client = RpcClient("/dev/ttyACM1", timeout=10.0)
client.open()
try:
commands = DmxCommands(client)
commands.cmd_reset_wait_for_restart(timeout=2.0, retries=3)
commands.cmd_dmx_send(
break_time=92.0,
mark_time=12.0,
data_val=0x55,
data_len=24,
)
finally:
client.rpc_stop()
Latency reports API example:
from dmx_tester.rpc_client import RpcClient
from dmx_tester.cmd_dmx import DmxCommands
client = RpcClient("1050266122", timeout=10.0)
client.open()
try:
commands = DmxCommands(client)
reports = commands.cmd_dmx_latency(data_len=128, n_reports=3)
for report in reports:
print(report)
finally:
client.rpc_stop()
Notes
- Data length is validated to DMX limits.
- Data value must be in range 0x00..0xFF.
- Some commands reset the board by design.
License
This package is licensed under the MIT License. See LICENSE.
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_tester-0.0.4.tar.gz.
File metadata
- Download URL: lr_dmx_tester-0.0.4.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5042c9d7e372e5e3e45afe1148dabc232a318afd8cb823892a183b56bbe36f6f
|
|
| MD5 |
603eab7e15452f13d188f409cca8ba69
|
|
| BLAKE2b-256 |
ea7c47deba0370fb0d3f5443c3d9126f836dc4965757fe84dc6b7987c9283c8d
|
File details
Details for the file lr_dmx_tester-0.0.4-py3-none-any.whl.
File metadata
- Download URL: lr_dmx_tester-0.0.4-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b3abb89fdc107c51421737d1c53d4253a03e0d15a4fa128dac38df3e4bcd76a
|
|
| MD5 |
1c6bc603d048063f6161e69183da10c3
|
|
| BLAKE2b-256 |
d7a512e668c3dc69b28c4641426ef101afefcebc2221a2c5c1bbd9e3fcad6df4
|