The House Computing System at 5 Fran Court
Introduction
Since about 2000, there has been a "house computer" at 5 Fran
Court, controlling various home mechanisms automatically. These
mechanisms are largely confined to watering and heating systems,
but other functionalities have been, are, or will be operational
as well.
Early in Jan 2015, while we were out of the country, there was
a catastrophic failure of the system. Details of exactly what
went wrong are not clear, but I came home to an exploded laptop
battery (in the relay driver system, ringwood), and a dead CF
card (inside the data logging system, garedelyon). Attempts to
rebuild and restart these systems were not very successful, and
the decision was made to replace them both (and some other
miscellaneous functions) with a new BeagleBone Black (BBB) system,
given to me as a Christmas present by my son Nathan (who wrote
the original system).
Several issues have arisen as a consequence:
- The data logging devices are old, and have only RS232
interfaces. The new BBB system has only USB inputs.
- The BBB has only one server USB connection. A powered
hub is necessary to serve all the data devices.
- The BBB does not come with a general purpose web server,
nor an Arduino development interface. Both of these have had to
be developed. In the case of the web server, the decision to
migrate to a Flask-based system was also taken.
It is intended that as the new BBB system has all the
attributes necessary to support fully the entire house computer
system, it will be used to host all house computer
functionality, and will replace 3 existing systems. These
include (see also
the house computer documentation
):
- A web server to provide user functionality to control
the house system.
- A system to monitor the house temperature, and to turn
the house heating on and off to control this temperature.
- A data logging system for the rainwater tanks to measure
and record the water levels over time.
- A data logging system for the solar panels to measure
and record solar energy input to the house UPS.
- An Arduino interface to drive all the relays controlling
the various house functions.
- The relay control subsystem, allowing turning on and off
the various house devices, and to run them for a preset time.
- A generalized RPC interface to access all the above functionality.
Progress to date (4 Apr 2015):
- The BBB now supports an Apache2 web server, serving all
these personal pages (attribute 1 above).
- It is also running a Flask web server, developed mainly
to take over the house computer web page (attribute 1 above).
- The powered hub is installed and operational (parts of
attributes 2,3,4 above).
- The Arduino susbsystem is operational (attribute 5 above).
- The relay control subsystem is operational (attribute 6 above).
- The RPC interface is operational (attribute 7 above).
dimboola
- cron jobs
- Every 5 minutes a dimboola cron job under account
ajh runs the program
/Users/ajh/bin/updatePlots.sh, which in turn runs the
jobs:
- updateTempPlot.sh
- updateTankPlot.sh
- updateSolarPlot.sh
See below for further details on these jobs.
- temperature
- The log of house temperatures is maintained in a file
/circuit-dir/temp.log kept on central.
A cron job runs the program
/Users/ajh/bin/updateTempPlot.sh, which
- rsyncs the temp.log file to
dimboola, and then
- runs
/Users/ajh/Personal/Home/Heating/tempplot.py, which
creates a new tempplot.png file, which is
- (re)linked to the web file
/Users/ajh/Sites/personal/tempplot.png
This latter file is accessed and displayed by various web pages.
central
- water tank level
- Every day at midnight, a cron job on central
under account ajh runs the program
/home/ajh/bin/woo2plasFill.py 10, which turns on the
wootank to plastank valve for 10 minutes (the parameter
10). Currently this is disabled (commented
out). Revision: it has been re-enabled, with a slightly
different cron job schedule.
garedelyon
garedelyon is a low-power microcomputer running Linux.
It is intended to take over the operations of central,
since it is low power and noiseless. However, restrictions on
hardware have seen this migration process stall somewhat, and it
needs a concerted effort to restart the migration. To date,
only weather station data and water tank logging have been migrated.
- weather station
- This function reads the TRS80 WX200 weather station device
on demand. It is accessible by running the program
/usr/bin/wx200py, which can also be called
remotely.
- water logging
- The water logging relies upon an RS232 port,
/dev/ttyUSB0, which must be initialised with XON/XOFF
flow control. (See the script /ttydumper.sh). This is
locally developed circuit uses a capacitance bridge that is
sensitive to the water level, and transmits every minute a new
reading. The reading must be calibrated to give water level
in appropriate units, and this is done by some user level
software. Data is logged to the file /water.log
Restarting
If for any reason garedelyon must be restarted, you
will need to restart the weather daemon
(/usr/sbin/wx200d), as well as the water logging
subsystem. This latter has a script /ttydumper.sh to
shut down and restart the water logging in an orderly way.