queenskimo / PyOpenDmxUsb

Python-Client and C#-Server to easily controll an Enttec OPEN DMX USB interface

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PyOpenDmxUsb

PODU is an API for the Enttec OPEN DMX USB on Windows that lets your python programm easily controll any DMX device connected to it. It is build in two parts, a server and a client.

The Server is written in C# and connects to the USB interface to control the DMX devices. It is controlled by a python module over a named pipe.

Getting Started

The easiest way to use PODU is to run the DMXServer with the following command:


DMXServer -n PODU

this will start the DMXServer and attach it to a named pipe called 'PODU'.

In Python use DMXClient like in the following example:

from DMXClient import DMXClient

  

dmxClient = DMXClient("PODU")

dmxClient.connect()

dmxClient.write([16, 255, 17, 125])

dmxClient.write("DMX 18 90 19 40")

dmxClient.write({20:'30', '21': 243})

dmxClient.effect(["MyEffect", 12500, 22, 128])

dmxClient.effect("EFFECT AnotherOne 1500 23 176")

  

dmxClient.close()

As you can see, there are many different formats you can choose from.

Usage

After getting an DMXClient object the following functions can be called:

Connect to server

dmxClient.connect()

This will block until connected to the DMXServer

Set DMX values

dmxClient.write(str)

dmxClient.write(list)

dmxClient.write(dict)

These will send a command to the server setting the designated channels to the specified values

Faster method

As commands to the server are send as a string you may also use the following method to get a tiny performance boost:

dmxClient._write(str)

Close connection to the server

dmxClient.close()

This will close the connection to the DMXServer

Effects/Animations

PODU provides you with an easy way to animate your channel values. You can instruct the DMXServer to change the values of as many channels as you want to a specific one over x milliseconds(ms has to be divisible by the DMXServer´s tickspeed which is normally set to 100ms).

dmxClient.effect([name, time, channel, value...])
dmxClient.effect("EFFECT animation 12500 22 128")

Note that all channels used in the effect stay blocked until the whole effect is over. The name must only be specified once.

DMXServer Usage


Usage: DMXServer [OPTIONS]

DMXServer is the part of PODU that interfaces with the OPEN DMX USB.

  

Options:

-h Show this screen.

-n Name of named pipe (must be same as used by DMXClient).

-v Show verbose output.

-s Wait for another connection after a DMXClient disconnects.

Wiki

You may also look into the wiki hosted on GitHub

Installation

Prerequisites

pywin32 to enable communication between c# and python

Win D2XX Drivers downloaded directly from Enttec's website

Binarys

In order to use PODU you need the DMXClient(Python) and the DMXServer(C#), both of which can be downloaded on the release tab.

Sources

You can also compile the DMXServer from source, it is located under 'C#/DMXServer.cs'.

License

GNU General Public License v3.0

About

Python-Client and C#-Server to easily controll an Enttec OPEN DMX USB interface

License:GNU General Public License v3.0


Languages

Language:C# 81.9%Language:Python 18.1%