Consume DMX-512 feed over serial line (usualy over RS458 to RS232 converter)
Project description
DMX-512 python serial client
Per limitation of pySerial this utility helps with properly setting the serial port on POSIX/LINUX and detecting SYNC/BREAK within the stream of data
Usage
from roh.dmx.client.dmx_client import DmxClient
from roh.dmx.client.dmx_client_callback import DmxClientCallback
from typing import Dict
# define callback, you can override even just one method, for example data_received
class MyDmxCallback(DmxClientCallback):
"""
Example implementation of all available callback methods
"""
def sync_lost(self) -> None:
print("SYNC LOST")
def sync_found(self) -> None:
print("SYNC FOUND")
def data_received(self, monitored_data: Dict[int, int]) -> None:
print("VALID MONITORED DATA: %s" % monitored_data)
def full_data_received(self, data: bytes) -> None:
pass
# use client with /dev/ttyUSB0 port and monitor dmx address no. 1 for values
c: DmxClient = DmxClient('/dev/ttyUSB0', [1], MyDmxCallback())
c.run()
References
- https://github.com/pyserial/pyserial/issues/539 - Issue about pySerial limitation when consuming DMX-512
- Using a Raspberry Pi as a PC-DMX interface (Florian Edelmann) - PDF
- https://man7.org/linux/man-pages/man3/termios.3.html - documentation of PARMRK, IGNBRK and BRKINT settings of virtual terminal
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
dmx512-client-0.3.tar.gz
(8.6 kB
view hashes)
Built Distributions
dmx512_client-0.3-py3.9.egg
(4.6 kB
view hashes)
Close
Hashes for dmx512_client-0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e2f4771b9773f8d47f246159a0434119bb19f370a8a93577881c0b36057d73c |
|
MD5 | 434e02a67f9640360f3d632af4daf4f8 |
|
BLAKE2b-256 | ccb840054c8eaed5958168d633780bc081a7a53d5a468ee680b544a62bc6bb5d |