Programming DMX512 in Python or other languges

Re: Programming DMX512 in Python or other languges

Hey, that's pretty awesome. I'm not the person to write the python class either, but I'm wondering if you have tried multiple universes?

With 2 of those usb breakout dongles, it seems you would just have:
Code:
#set serial bus addresses
universe1=serial.Serial(3)
universe2=serial.Serial(4)

#this writes the initialization codes to the DMX
universe1.write( DMXOPEN+DMXINIT1+DMXCLOSE)
universe1.write( DMXOPEN+DMXINIT2+DMXCLOSE)
universe2.write( DMXOPEN+DMXINIT1+DMXCLOSE)
universe2.write( DMXOPEN+DMXINIT2+DMXCLOSE)

#etc. . .
Right? Going by the sample code on your blog. (Tried to reply there, but it wouldn't take my comment.)
 
Re: Programming DMX512 in Python or other languges

Yes, there's no reason that wouldn't work. 1024 channels of DMX! I don't know what the limit to the number of DMXKing transmitters you can hook up, I'm guessing seven dmx dongles could be hung with a usb hub. I don't know if you can go beyond eight virtual serial ports.

And you can call videos, images and music. With pygame you can easily move sprites and combine animation and lighting controls.

[waldo] Casey Williams;40761 said:
Hey, that's pretty awesome. I'm not the person to write the python class either, but I'm wondering if you have tried multiple universes?

With 2 of those usb breakout dongles, it seems you would just have:
Code:
#set serial bus addresses
universe1=serial.Serial(3)
universe2=serial.Serial(4)

#this writes the initialization codes to the DMX
universe1.write( DMXOPEN+DMXINIT1+DMXCLOSE)
universe1.write( DMXOPEN+DMXINIT2+DMXCLOSE)
universe2.write( DMXOPEN+DMXINIT1+DMXCLOSE)
universe2.write( DMXOPEN+DMXINIT2+DMXCLOSE)

#etc. . .
Right? Going by the sample code on your blog. (Tried to reply there, but it wouldn't take my comment.)
 
Re: Programming DMX512 in Python or other languges

Also, you can use
#likewise, char 10 requests the serial number of the unit. I'm not receiving it or using it
#but the other softwares I tested did. You might want to.
DMXINIT2= chr(10)+chr(02)+chr(0)+chr(0)+chr(0)

to identify the serial number of each dongle so you'd always know which universe was the correct one.
 
Re: Programming DMX512 in Python or other languges

Right, and the sensible thing to do would be to make a function that would take that serial-number detection string and automatically assign the universes correctly at launch.

Anyway, I just ordered one of those usb breakout dongles, as it seems like the cheapest price point to date for that ftdi chipset device. (I have a pretty decent rig going with chamsys, but my breakout boxes are all ethernet.) I also have a few raspberry pi devices that I've been playing with, and just got python and apache talking to each other.

So once that usb->dmx device arrives from NZ, I'll have all the puzzle pieces in place to make a tiny web-based dmx control scheme. (Which has been a little dream in the back of my head for a while.) I'll let you know what I come up with.

best,

waldo
 
Re: Programming DMX512 in Python or other languges

Cool. I had a day in the van where I wasn't driving and got some programming done. This is now a class. I'm also adding an execution queue, a universe identification, a file save and import and some other things. I'll post it on the blog and let you know when it's up.
 
Re: Programming DMX512 in Python or other languges

A few years ago I wrote a Python program to control my band’s DMX rig with my Roland V-Drums. As a GAS suffering weekend warrior, I got to the point where I was the drummer, roady, owner of way too much equipment (PA and lights), sound engineer, studio owner, producer, catering company, lighting director and husband of the (female) lead singer.

The Python program simplified my life a little bit by following drum midi events, detecting rhythm patterns and driving the lighting rig through DMX. My Python program was actually the only band member that listened to me (the others were too busy putting an "I" in band somewhere). After going through a number of band changes, I slowed down a little but kept all the stuff (and yes, I’m still married to the lead singer).

This thread was very timely since I dusted off my code a few weeks ago after seeing Python code that runs on an iPad. Right now I’m updating and porting my old stuff to the IPad and MacOS.

Attached is my DMX module that was originally written for OpenDMX running on Windows XP. I later added support for DMX Pro (using virtual serial drivers on Windows and a direct USB interface on MacOS). Right now I’m porting it to Art-Net but until my Enttec ODE arrives this week, I can’t be sure that code actually works. All the scripting for the previous interfaces is still in the module which is configured using a text file (like the rest of my App).

If anybody is interested in the whole App, I’ll gladly put it on Github so you can see what I’m doing. I’ve attached my new Kivy-based GUI as a teaser.
 

Attachments

  • dmx.txt
    6.5 KB · Views: 6
  • Conductor.png
    Conductor.png
    708.1 KB · Views: 2
Re: Programming DMX512 in Python or other languges

Funny, I was just starting a Kivy product to teach programming to my kids. It's cool that you can write it on your computer and port it to your android devices. I'd like to use it to create a mixer interface to a ilive. Anyone with an IDR-16 they don't need anymore? :lol:
 
Re: Programming DMX512 in Python or other languges

I'll be writing a C# app for using ArtNet here pretty soon. It should allow the Ethernet port to control more than a single universe (I'm getting more equipment and need an easier way to control my movers and don't want to buy a desk)
 
Re: Programming DMX512 in Python or other languges

Hey, a lot of interesting things happening over here:

https://groups.google.com/forum/#!members/open-lighting

All involving OLA, open lighting architecture, which seemed to be moribund last time I checked, but lots going on now.

I haven't had any time to do real coding, but I pulled a distro down there, and was able to bang out some really stupid christmas lights with my raspberry pi, just thru shell scripts. Python, PHP all ready to go with a little config.

There's also a pretty full-fledged PHP interface here, ready to burn to live CD:

Lighting

happy holidaze!

waldo