Hardware Reference
In-Depth Information
Our solution, as it has been throughout the topic, is to ignore the problem! There are two components to this.
In the first instance, you simplify the situation by creating only a minimum of local users on the Linux box, preferably
one, and add only the primary users to a group called homecontrol , for example. You can then apply permissions
for this group to each of your devices. When you allow control to this device through a web or SMS interface then,
naturally those daemons must also be added to the group so that they have access to the device.
N Remember that most daemons, like Apache, need to be restarted after any changes to group membership
are applied.
Note
The secondary part of the solution involves, as it always does, the knowledge that anyone in the house has both a
level of physical access and a level of social coercion that prevents users from abusing the system as others might do.
Both of these, in the given scenario, are acceptable tradeoffs between security and ease of use. After all, most
other family members are unlikely to be using the server directly and instead through an interface (such as a phone or
the Web) where security can be applied.
The Teakettle: An Example
When discussing my home automation system to people, one topic that always comes up is that of my online electric
teakettle. Its functionality includes the ability to initiate a boil from a web page or command line and have a fresh
cup ready the second that I get home from work. From a hardware level, this requires nothing more than a basic pair
of X10 modules—a CM11 from which the computer sends the message and an appliance module like the AM12 to
control power to the teakettle—but the subtleties are in the software and attention to detail.
N In all cases, the teakettle must be always switched on and plugged into the AM12. Furthermore, there must
always be water in the teakettle to stop it from boiling dry.
Note
Making a cuppa from the Web is the same as triggering one from the command line or anywhere else. Namely,
there is a basic trio of commands:
u
“Switch on”
u
“Wait”
u
“Switch off ”
Traditionally, you might implement a script for this like this:
heyu turn kettle on
sleep 215
heyu turn kettle off
And it works! This script can be triggered from anywhere, at any time, to provide the necessary function.
Naturally, if it is executed directly from a script on a web page, the page will take 215 seconds to return and will usually
have timed out, so it should be run in the background:
shell_exec("/usr/local/minerva/bin/kettle &");
 
Search WWH ::




Custom Search