Skip to main content

Send and measure DMX frames & latency together with a compatible hardware tester

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lr_dmx_tester-0.1.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lr_dmx_tester-0.1.0-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file lr_dmx_tester-0.1.0.tar.gz.

File metadata

  • Download URL: lr_dmx_tester-0.1.0.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for lr_dmx_tester-0.1.0.tar.gz
Algorithm Hash digest
SHA256 da38fb401eb51d75f685bb499efbeaaaaa984dab5cac468cdd1551f77eca0c7e
MD5 902a67423b7f7efc232883b9dfe8cd8b
BLAKE2b-256 7c361c71d4c385439f6718ee10a87195d313b5df0ce8c48c78821e8c2c91707e

See more details on using hashes here.

File details

Details for the file lr_dmx_tester-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: lr_dmx_tester-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for lr_dmx_tester-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aa51501453dc5777ee1090f1732ddc1ddbfef00a14c6d6a2744ab003ac172594
MD5 4a54f39c844332202c24a1e06f370abe
BLAKE2b-256 f6dfa14f955254f62e8cc7f3ac77eccef01429bba99fb89611e963b6b722665a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page