So how do you tie the following together? turning on non-dim set lights. Sending power to DMX controlled lights that can go in to “disco mode”. Controlling a few cues on a light console. Then Of Course….. make it easy for anyone to start and stop the system?
The answer is Automation.
This Blog Post will be touching on how I solved this problem off a “simple on/off switch” for this complex system.
Part One: What was the scope of this sub-project?
This system Must, make it where the end user can Start Up and Shutdown(safe) the lighting system. this control system shall be accessible from any network. To allow any device to start or safe it via a Website.
The website Must be secured. The only options shall, use two links. “OFF and ON”.
Part Two: Old Implementation
Back when I started work on this to be controlled by my PBX, with the 6602 extension. The end user would call the 6602 extension and press a option. then the following would happen. (when turning it on)
- The TCL Expect scripting language is used to tell the Network PDUs to turn on and off stuff.
- Hard coded DMX values being sent via OLA daemon over network to a DMXking eDMX4 to get the DMX to the lights to set the color.
The main issue I had with this setup, I could not dynamically control the system. Also you had to be on my PBX, or white listed to be redirected when you dial in to my home phone line.
Part Three: Current Implementation
With those known limitations, I decided to do something about it Implement the scope of work in Part on
Webserver to Austin VMs.
I have a hub and spoke VPN infrastructure all ready in place. Lets look at the Hub.
This Pfsense vm links using OpenVPN to a few sites. but most importantly it links to my apartment.
With that link I can remotely call commands over SSH to turn on and off the system, from the web server. then It is just a matter of calling a shell command to kick off a Shell script on the Austin utility VM.
$output = shell_exec("/usr/bin/ssh www-server@aus-netbox PROD-GO");<br>echo $output;<br>
Above is the PHP code for turning on the system. the off code is 99% the same. Its secured with a username and password. Looking at the aus-netbox host, the system is running a bunch of different Expect scripts.
- Turn on outlets on the PDUs
- Tell LightFactory to go to a standby cue. over its telnet connection.
Let us look at the integration via expect and and LightFactory
First we say log all output to the shell
the “set timeout 20” is Very Important. as it helps keep the telnet session from hanging. all it means is this, “If I don’t get input from the I//O stream bail out”
spawn says what we are running and redirecting I/O from.
Then its expect “foo” and send “bar”. its pretty simple
To touch on the Light Factory commands. sc31 is a shortcut macro (I created) to release all channels. and cue line calls the cue from the cue list serah #8888 .
Then it exits. Now Serah can then control the system via the LightFactory Myinterface app. As long as she is on the right WiFi Network.
Shutdown is similar to what was explained.