GitXplorerGitXplorer
Y

PyDMX

public
16 stars
5 forks
3 issues

Commits

List of commits on branch master.
Verified
1f18fb59f8dbb43229aa8d107e8d3fb5e05ee1c0

Update PyDMX.py

YYoshiRi committed 3 years ago
Unverified
5b5ae97ff4b2432ca1551c5ba207b7e7674d5b72

fix resetting command

YYoshiRi committed 3 years ago
Unverified
5a21047de374ff5ba4a9d81ffee905347ef183d3

update to hold past data via txt file

YYoshiRi committed 3 years ago
Unverified
c8701cb44e193491e60febab574b232fb5b7b9ff

add channel_number options and Update README

YYoshiRi committed 3 years ago
Unverified
8cce327569f7725fdd374767a14f537b2335b8a3

Update for release

YYoshiRi committed 6 years ago
Unverified
1985c19ca8e853093b1b13796743b7d6bbabee9e

Buf fixes

YYoshiRi committed 6 years ago

README

The README file for this repository.

PyDMX

Python based DMX control demo program.

Requirement

  • USB-RS485 Converter
  • PySerial
  • wxPython (only for fader)

I used DTECH USB-RS485 Converter.

to instal pyserial, try

pip install pyserial

for the GUI fader, wxPython is used.

pip install wxPython

How to use

PyDMX.py

PyDMX.py contains simple DMX control class.

For the instance create the connection like below:

from PyDMX.py import *

dmx = PyDMX('COM3') # for Linux use '/dev/ttyUSB0' or something

then, you can set '255' value in the address '1' as following:

dmx.set_data(1,255)

Finally use send() function to send dmx signals.

dmx.send()

Communication option

Here shows option in the constructor.

  • Option Name (Default Value)
    • COM (COM8): Comport device name. Check it on your device manager.
    • Cnumber (512): DMX channels number. DMX512 protocol uses 512 channel.
    • Brate (250000): Baudrate. Usually do not need change.
    • Bsize (8): Bite size decided by DMX512 protocol.
    • StopB (2): Stop bit number decided by DMX512 protocol.

You can add these options like a following example.

mydmx = PyDMX('/dev/ttyUSB0',Cnumber=1,Brate=9600)

save and load past data

To save and load past DMX data, you can try following option.

  • Option Name (Default Value)
    • use_prev_data (False): Set True if you want to preserve and load past DMX data.
    • preserve_data_name ("preserved_data.txt"): saved data file name.

PyDMX_fader.py

PyDMX_fader.py contains the GUI fader class named Controller().

You can just run this program as a fader.

python PyDMX_fader.py <fader channel number>

The default fader channel number is 4.

You may see following window after putting the COM port.

Program flow

DMX is a kind of serial communication. See Japanese explanation here.

You need,

  • 250kbps baudrate, 1 startbit, 2 stopbit
  • Break(LOW) Longer than 88us
  • MAB(High) Longer than 8us
  • startcode before data

For Debugging

DMX Break length and MAB length are not rigidly defined. You'll need to change these parameter depends on your devices.