Colossus – The Raspberry Pi Aquarium Controller uses custom software by RBA Marketing. Since we are using Raspberry Pi SBCs, it only made sense to write the software in Python.
The Colossus Control Software was developed using the DietPi OS. DietPi makes installing common apps easy and has a very small footprint when booting. Hand’s down, this is our favorite operating system for the Raspberry Pi. The software will run on any Raspberry Pi operating system available.
Colossus Control Software Features
This python scripts handles the all of the relay switching, event logging, temperature monitoring, and system notifications.
The following system applications are required for the Colossus Control Software to operate.
- RPi.GPIO – GPIO Interface Library
- WiringPi – GPIO Interface Library
- I2c – I2c Support
- LAMP Webserver Stack – Apache2/MySQL/PHP
- phpMyAdmin – Php Mysql Manager
- Python – Python Programming Language
- mySQL Python Connector
You can find out how to install the above applications with easy google searches for your particular OS. One of the reasons we use DietPi is that installing these applications is a part of the initial install process. Once again, DietPi is highly recommended.
Espeak – Voice Program
Get The Software
This software was designed to be used with three (3) MCP23017 I2C Expansion Chips. If you use less than three, you will have to modify the source code.
You can check out and download our software by visiting our GIT repository at Bitbucket. Follow the quick setup steps below after downloading the code.
Quick Setup Guide
- Create mysql database for the software using phpMyAdmin.
- Import config/colossus.sql into database.
- Edit config/colossus.confEnter your mysql information into the appropriate sectionsChange any other appropriate config options.
- Edit colossuscontrol.py and change the following informationChange channel list to assign your own commands to a particular pin numberChange the expansionaddr[1-3] variables under #Global Placeholders.
You can pass an optional on/off setting for the command if you like. This is helpful for initialization and shutdown scripts. If on or off is not specified, the software will flip the bit from 0 to 1 if off, or 1 to 0 if on. Simple bit flipping with no current status checks. If you need to know for sure that a relay is on or off, use the optional on/off
Sample Command Syntax
python colossuscontrol.py Light1
python colossuscontrol.py Light1 on
python colossuscontrol.py Light1 off
Getting the Temperature
python colossuscontrol.py temp
This command will read all DS18B20 probes defined in the config/colossus.conf file.
python colossuscontrol.py halt – Turn all i2c expanders to their “off” positions determined by the halt() routine located in the script.
python colossuscontrol.py help – List all commands and pin numbers
python colossuscontrol.py status [html] – Displays the current status of the relays. Use the optional html to return the output as html instead of plain text.
python colossuscontrol.py webstatus – Returns a single line of output as a comma seperated list contain relay name, pin number, and status. This is used for the Colossus WordPress Plugin.
python colossuscontrol.py phtest x.xx – Log result of manual pH testing into the database.
python colossuscontrol.py waterchange xx -Log number of gallons of water changed into the database.
python colossuscontrol.py log sensor data – Command line input feature to record miscellaneous sensor data to eventlog.