Python control of the Enttec DMX USB Pro
Project description
DMXEnttecPro
Control the Enttec DMX USB Pro with Python3
Installation
This package solely depends on pyserial
. You can install a recent release on
PyPI:
pip install DMXEnttecPro
or by getting the repository from GitHub and doing something along the lines of:
git clone git@github.com:SavinaRoja/DMXEnttecPro.git
cd DMXEnttecPro
pip install .
Getting Started
If you don't know the serial address of the DMX controller yet, you can do the following to identify it:
python -m DMXEnttecPro.utils
which will give you some detailed information on all COM ports like this:
COM4
name: None
description: USB Serial Port (COM4)
hwid: USB VID:PID=0403:6001 SER=EN055555A
vid: 1027
pid: 24577
serial_number: EN055555A
location: None
manufacturer: FTDI
product: None
interface: None
Once you know your serial address, setting up a connection to your Enttec DMX USB Pro is simple:
from DMXEnttecPro import Controller
#dmx = Controller('COM4') # Typical of Windows
dmx = Controller('/dev/ttyUSB0') # Typical of Linux
Then you can set channel values easily (DMX Channels are 1-indexed, and
Controller
maintains that convention for you.) with:
dmx.set_channel(1, 255) # Sets DMX channel 1 to max 255
dmx.submit() # Sends the update to the controller
In some environments where you may not be assured of the precise string of your
COM port, I recommend using a uniquely identifying mark like the serial number
or product ID. Some helpers exist in DMXEnttecPro.utils
:
from DMXEnttecPro import Controller
from DMXEnttecPro.utils import get_port_by_serial_number, get_port_by_product_id
my_port = get_port_by_serial_number('EN055555A')
my_port = get_port_by_product_id(24577)
dmx = Controller(my_port)
Additional Features
There are three main additional features that this package offers: auto-submission of changes and configurable size of DMX universe.
Auto-submission
You may supply auto_submit=True
to instantiation of Controller
to tell it
to automatically submit changes on any action changing channel values:
dmx = Controller('/dev/ttyUSB0', auto_submit=True)
The argument submit_after=<bool>
can be provided to any action changing
channel values and it will take precedence over the configured auto_submit
value of the Controller
.
DMX Size Configuration
The size of the DMX universe defaults to 512 channels. There are apparently
occasions where finer timescales can be achieved in DMX by constraining this.
dmx_size=<int>
may be supplied to instantiation of Controller
.
dmx = Controller('/dev/ttyUSB0', dmx_size=256) # use only 256 channels
Acknowledgments
DMXEnttecPro evolved from my re-write of pysimpledmx for compatibility with Python3.
pyenttec is another good package.
Developing
So far I have only utilized features with which I am personally familiar and have wanted. Please submit any issues or feature requests along with usage needs and I would be happy to evaluate them.
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
File details
Details for the file DMXEnttecPro-0.4.tar.gz
.
File metadata
- Download URL: DMXEnttecPro-0.4.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ee7659d9e96fe427f31808f4527ba45a2e28a8d5a44a20cdc767166fb7eafe7 |
|
MD5 | 496e7ede6e0d2de8d53adf9ef592eaff |
|
BLAKE2b-256 | 78492ec902d63aeb014a674fb048da556139064f6314eb38ce96ae3d95132209 |