Metadata-Version: 2.1
Name: dmx512-client
Version: 0.3
Summary: Consume DMX-512 feed over serial line (usualy over RS458 to RS232 converter)
Home-page: https://github.com/smarek/dmx-python-client
Author: Marek Sebera
Author-email: marek.sebera@gmail.com
License: Apache License, Version 2.0
Keywords: dmx dmx512
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Environment :: Console
Classifier: Operating System :: POSIX :: Linux
Classifier: Typing :: Typed
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.7
Requires-Python: ~=3.7
Description-Content-Type: text/markdown
License-File: LICENSE

# 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

