This script requires pyserial.
pip install --user pyserial
Install from pip:
pip install --user dmx485
Install from source:
python setup.py install
This should work with any FTDI RS485 dongle or any of the similar knock-offs.
FTDI to RS485 cheap dongle:
https://stevenbreuls.com/2013/05/diy-usb-dmx-dongle-interface-for-under-10/
First create an instance of dmx.DMX_Serial(), then start the background thread. Once that is running the dongle will begin sending a full DMX universe. To change the value of a channel use set_data(). This function takes a bytes() object with 512 bytes, each representing a single DMX channel. It will be sent on the next DMX refresh.
I tweked this module a bit to work on other OS's (i use mac) and to use a queue based show thread which allows you to set the timing for how long each fram will actusally get displayed without allowing the lights to time out
import dmx
sender = DMX_Serial("/dev/tty.usbserial-AD0JKV8Z")
sender.start()
for i in range(200):
sender.set_data(bytes((255,0,255,255) * 64))