Growing up as a kid, I was obsessed with all things space. TV shows like Battlestar Galactica, Buck Rogers , Space 1999, and others just helped to fuel that obsession. As a kid, I knew that stuff I saw on TV wasn’t real. For the real stuff you needed to pay attention to NASA.
Rockets and spacewalks are cool, but the earliest impression of NASA that I have is Mission Control. The rows of consoles with the CRT screens and status panels filled with blinking lights really stuck with me. As such, I’ve always enjoyed a good control panel.
My original idea for Colossus was to have a section of the canopy to display relay status in this fashion. One of the MCP23017 I2C chips is reserved for driving an LED status panel. Since we expanded Colossus and added a second Raspberry Pi (Guardian), we decided to do a virtual control panel instead.
Following the design inspirations of NASA, we created the following Relay Power Status Panel.
This relay status panel displays highlighted status for powered on devices along with a spinning gear icon. Relays that are off are not highlighted and display a power button icon. Clicking a relay status will run the colossuscontrol.py script and toggle the relay state off and on. We are still working on the final color scheme. On our wish list is replacing one of the 17″ LCD displays with a touchscreen. We can dream.
How it works
This shortcode works by calling the colossuscontrol.py script with the webstatus option. The webstatus option returns a single line of status output in a comma separated key/value list. Key value pairs consist of command name, and relay power status. Example output is listed below.
The shortcode reads this output, sorts the key/values alphabetically and generates the status panel display. There is no hard coding of commands or relay names in the plug. All commands are passed to the shortcode from the colossuscontrol.py. Changes to channel command or gpio pin numbers will not affect the functionality of this shortcode.
This script uses PHP’s exec and system functions to run the colossuscontrol.py script. Certain aspects of the colossus control script require it to be run as root. In order to function properly, Apache must have root privileges. This creates MAJOR security holes. Our aquarium is not publicly accessible from the internet, otherwise we would not have done it. WE DO NOT ADVISE RUNNING APACHE AS ROOT! DO SO AT YOUR OWN RISK!