Page 1 of 3

Start a scen/show in a DMX Software from Indigo

PostPosted: Thu Dec 14, 2017 6:18 am
by Gusten
Hi

Here is a small tuturial on how to trigger/start a program/show/scene in Q Light Controller Plus

Q Light Controller Plus is a free Open Source software for DMX control, it can be run on Windows/MacOS/Linux and RasberryPi
http://www.qlcplus.org

I know there is a plugin to control a USB DMX dongel directly, but it didt fit my needs, so here is another way


You will need at least one DMX light and a DMX USB dongel or a Ethernet DMX device for this to work

1. Install Q Light Controller Plus and set up the system by adding your DMX lights and program your functions
(I used version 4.10.5b and installed it on the same mac as indigo, there is a newer version, but i got crash issues with that)
Now you can control your lights with Q Light and trigger the differnt scenes etc

2. In Q Light under Inputs/outputs check "input on OSC

3. Install pyOSC on the indigo machine
Code: Select all
pip install pyOSC


4. Save this script as a file on Indigo (You need to change the IP number if not using tha same machine as indigo)

Code: Select all
import OSC

def send(address, value=0):
   c = OSC.OSCClient()
   c.connect(('127.0.0.1', 7700))
   oscmsg = OSC.OSCMessage()
   oscmsg.setAddress(address)
   oscmsg.append(value)
   c.send(oscmsg)

send('indigo01',1.0)
send('indigo01',0.0)


5. Make a trigger or actiongroup in indigo to trigger the script as a file

6. If you like to make more then one trigger in Q light, make several of the script but change both indigo01 to indigo02. Or what ever you like, the important thing is that it sends a differnt datastring

7. In Q Light under Inputs/outputs, click on Profile, and make a new profile, name it and chose Type OSC. Then under channels, press the "wizard wand"
This means that Q Light is listening on incomming packets

8. Trigger all of the indigo scripts you made

9. In Q-Light Press the "wizard wand" again and save the Profile

10. In Q-Light open Virtual Console and make a button. Double click on the button and connect the button to the function you want in Q Light, then under "External Input" click Chose, then pick the indigo input you like to trigger this button for example indigo01

11. Now change Q Light from Design Mode to Operate Mode

Done

This means if you trigger the script, you will "Press" the button in Q Light and this will start any cool lightshow or scene you like.

I have just started testing this, and i am sure there are many other cool functions this setup can do, but i just tested this as a proof of concept, and i only have one DMX light right now,

I know that in Q Light you can make a "Show" and run it with music as well, so i think with this you can do realy cool Haloween pranks :-)

Re: Start a scen/show in a DMX Software from Indigo

PostPosted: Thu Dec 14, 2017 8:05 am
by Different Computers
Very cool! Time for DJ Indigo to hold a dance party!

Re: Start a scen/show in a DMX Software from Indigo

PostPosted: Thu Dec 14, 2017 5:43 pm
by colinpartridge
It would be nice to get OSC support built into ID natively. I use indigo to trigger Qlab( for some audio playback and video playback. Its always good to read about someone else utilising OSC for Home Automation.
Colin

Re: Start a scen/show in a DMX Software from Indigo

PostPosted: Fri May 17, 2019 2:53 pm
by mwoodage
Hi Gusten,
I know you posted this a couple of years ago, but i've been trying to get it working this evening and running into problems.
i've followed your suggestions for setting up Q-light but can't get the script file below to work - are you able to help?

Code: Select all
import OSC

def send(address, value=0):
   c = OSC.OSCClient()
   c.connect(('127.0.0.1', 7700))
   oscmsg = OSC.OSCMessage()
   oscmsg.setAddress(address)
   oscmsg.append(value)
   c.send(oscmsg)

send('indigo01',1.0)
send('indigo01',0.0)



I've currently set up Q-light and have DMX lights working via the software - I've also managed to set up a trigger in Indigo and can execute that, but i'm not getting any communication in Q-Light.
I have the file saved as a .scpt file, is that correct?

Any help would be appreciated,

Thanks
Martin

Re: Start a scen/show in a DMX Software from Indigo

PostPosted: Fri May 17, 2019 3:39 pm
by howartp
Martin

Just an aside before Gustin gets here.

Can you edit your post and put the code snippet inside a set of [ code ] [/ code ] blocks (without spaces) so it formats correctly.

Peter


Sent from my iPad using Tapatalk Pro

Re: Start a scen/show in a DMX Software from Indigo

PostPosted: Sat May 18, 2019 12:10 am
by colinpartridge
mwoodage wrote:
I've currently set up Q-light and have DMX lights working via the software - I've also managed to set up a trigger in Indigo and can execute that, but i'm not getting any communication in Q-Light.
I have the file saved as a .scpt file, is that correct?


I'm also not Gusten but I think the file should be saved as .py not .scpt

Colin

Re: Start a scen/show in a DMX Software from Indigo

PostPosted: Sat May 18, 2019 12:33 am
by Gusten
Hi
Colin is correct, it should be .py file

I ended up never using this, but it worked when I tried it, I know I had issues with q light version when testing

/Gusten

Re: Start a scen/show in a DMX Software from Indigo

PostPosted: Sat May 18, 2019 2:26 am
by mwoodage
Hi Guys, thanks for your reply this morning :D

I've now changed the file to a .PY and run the trigger again, however in the log i get the following error

Script Error Indigo DMX.py: invalid syntax
Script Error around line 5 - "   c = OSC.OSCClient()"

Any ideas?

Thanks
Martin

Peter - changing the snippet now :wink:

Re: Start a scen/show in a DMX Software from Indigo

PostPosted: Sat May 18, 2019 5:17 am
by DaveL17
If your script is identical to the one above, make sure that each line is indented with the same thing (either spaces or tabs but not both). If that doesn't fix it, please post your entire script as the problem is likely on the line above the one cited in the error message.

Re: Start a scen/show in a DMX Software from Indigo

PostPosted: Sun May 19, 2019 3:46 am
by mwoodage
Hi Dave, thanks for the help
I've checked the file this morning and taken out any spaces - it now looks like the screen shot below,

But when i run the trigger i get this error in my error log:-

Any other suggestions - i'm sure its just something i'm doing wrong somewhere,

Cheers
Martin

Re: Start a scen/show in a DMX Software from Indigo

PostPosted: Sun May 19, 2019 3:57 am
by DaveL17
mwoodage wrote:
Hi Dave, thanks for the help
I've checked the file this morning and taken out any spaces - it now looks like the screen shot below,

But when i run the trigger i get this error in my error log:-

Any other suggestions - i'm sure its just something i'm doing wrong somewhere,

Cheers
Martin

Removing all the tabs and spaces isn't going to work as indentation in Python files is super important. It should look like the version from earlier in this thread. This is indented with four spaces:

Code: Select all
import OSC

def send(address, value=0):
    c = OSC.OSCClient()
    c.connect(('127.0.0.1', 7700))
    oscmsg = OSC.OSCMessage()
    oscmsg.setAddress(address)
    oscmsg.append(value)
    c.send(oscmsg)

send('indigo01',1.0)
send('indigo01',0.0)

Re: Start a scen/show in a DMX Software from Indigo

PostPosted: Sun May 19, 2019 6:13 am
by mwoodage
Thanks Dave,
I've now saved the file as shown below and run it again but still get the error, please see the attachments.


Thanks
Martin

Re: Start a scen/show in a DMX Software from Indigo

PostPosted: Sun May 19, 2019 6:24 am
by DaveL17
Make sure that you're saving the file as a plain text file. If there's any other encoding it the file, you'll run into trouble.

Re: Start a scen/show in a DMX Software from Indigo

PostPosted: Sun May 19, 2019 6:27 am
by colinpartridge
Is that Textedit you are writing your code in? you need to have your python files as plain text. I don't think Textedit can save to plaintext. If you write your code in something like Textwrangler or similar then save as plain text then those errors should go away.

Colin

Re: Start a scen/show in a DMX Software from Indigo

PostPosted: Wed May 22, 2019 10:51 am
by mwoodage
Hello, just thought I'd try this again as I had no joy last week!

I've tried all the suggestions, I even thought there was something wrong with my Python install so I've tried it on a back up machine but its still doing the same thing.

I just get the error below........
It seams to be saying that I've not got the OSC module installed, but I've checked this and it's installed (see below)

    Last login: Wed May 22 17:32:13 on ttys000
    Martins-Mini:~ martin$ pip install pyOSC
    DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
    Requirement already satisfied: pyOSC in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (0.3.5b5294)
    Martins-Mini:~ martin$


Don't worry to much about it, but if someones got the time to figure it out that would be great.

Thanks
Martin