Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/smarek/dmx-python-client
Library for consuming DMX-512 over serial port (typically RS485 to RS232 converter) and detecting valid DMX frames
https://github.com/smarek/dmx-python-client
dmx dmx512 pyserial python rs232 rs485
Last synced: 25 days ago
JSON representation
Library for consuming DMX-512 over serial port (typically RS485 to RS232 converter) and detecting valid DMX frames
- Host: GitHub
- URL: https://github.com/smarek/dmx-python-client
- Owner: smarek
- License: apache-2.0
- Created: 2022-01-12T15:32:36.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-04-13T21:38:23.000Z (over 2 years ago)
- Last Synced: 2024-09-21T13:52:55.919Z (about 2 months ago)
- Topics: dmx, dmx512, pyserial, python, rs232, rs485
- Language: Python
- Homepage:
- Size: 23.4 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```python
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://www.mnm-team.org/pub/Fopras/edel17/PDF-Version/edel17.pdf)
- https://man7.org/linux/man-pages/man3/termios.3.html - documentation of PARMRK, IGNBRK and BRKINT settings of virtual terminal