mark :: blog :: ha
A couple of months ago I was playing with bluetooth - It actually was pretty easy to add a new accessory menu and a perl state engine to allow me to do cool things like dim the lights and get the temperatures and send short messages to the tv via tivo. I kind of lost interest in it and so whilst it works perfectly it doesn't detect you arriving or leaving with the phone, and leaving bluetooth on all the time tends to drain the battery. A few folks asked me how I got bluetooth working with Red Hat Linux 9 (the answer is to cheat and use the bluez packages out of rawhide)
Our new bathroom finally got installed and I couldn't resist adding in extra cables in the new ducts between rooms - so now behind a panel in the bathroom we have various cables and power - quite fancy doing some network streamed audio in there and putting some marine speakers in the ceiling, low quality but the noise of the whirlpool and extractor fan will drown out the imperfections anyway.
3 CAT5 cables to most rooms in the house. Fortunately the
builder ran some extra cables through the house for me before it was
too late and the final fix happened. I found some cunning 3-outlet
sockets from BKA which look good and
blend into a domestic environment.
Wireless network (802.11g) that reaches through most of
the house, but on an untrusted part of the internal network. This
generally gets used by web tablets as the coverage isn't great.
Satellite-grade coax to most rooms. This allows the cable
modem and cable tv box to all be in separate rooms and away from their
entry point. Some of the internal cameras use these connections.
UPS for all the important bits, highly necessary since the house
voltage is regularly over 250 volts and a little tempremental sometimes.
Various networking stuff: transparent firewall, second firewall+NAT,
one of those D-Link multi-protocol print servers serving a laser and inkjet
Home automation server. In early 2005 my old 400MHz PC finally
gave up. It was running Red Hat Enterprise Linux 2.1 (it was running
Red Hat Linux even before I started working for Red Hat). Machine was
replaced with a dual-AMD machine. This machine runs the Jabber server and the various HA bots.
A central 19" patch panel for the CAT5, coax,
and 10/100 16 port switch (bought from ebay).
See photo (Mar 2002).
19" Wall bracket from Minitran
Cable internet and TV from Telewest. The Telewest termination
point is in the garage, see photo (Feb 2002).
The cable goes to the central patch panel where it's split to the
cable modem and runs back to the living room where the decoder lives at
- How we chose our lighting switches and settled on the Intelliswitch.
A german LW11G X10 dimmer switch controlling 10 25W recessed
lights in the main room, the switch *just* fits in the drywall backbox.
I spent many hours working out where to put the computer control unit,
a CM12U, so that it managed to send signals to reach all the rooms
in the house - nearly everywhere I put it there was a blackspot where
things wouldn't work. Anyway having the CAT5 meant it doesn't matter
where the CM12U is as the CAT5 provides a serial link back to node0.
An AD10 and LW10 finish off the X10 stuff, controlling two sets of
Christmas lights right now. X10 stuff from Laser
Control of the central heating system (it had a 240v switched input
which we control with a relay from a 1-wire switch.
A set of one-wire temperature sensors from Maxim together with a
1-wire usb interface to allow logging of temperature from around
the house. We recently added a 1-wire hub so we could use a star
network of more than a couple of sensors.
Anyway the raw data goes into rrdtool and the
output graphs get uploaded via DAV here.
Control of a plasma screen
Five Fujitsu Point 1600 webpads mounted on
the wall to control everything.
Caller ID unit that logs incoming and outgoing calls. This is
hooked to a Linux box with a bit of C software to decode the
Caller ID displayed on the TiVo by using the jabber system
Alarm system. The communicator outputs are also wired to
a Linux box which triggers various events based on the state of
SMS alerts. The main linux box is hooked to a dedicated mobile
phone used to send alerts from the UPS, alarm etc.
(and allow remote control of various things). Since phone
cables here are above ground they're too easy to cut!
Plans (as time and money permits)
Control the external lighting and curtains (I installed pull-cord
curtains already to make this easier)
Work out a system for distributed TV. At the moment the TiVo's
RF output feeds up to a distribution amplified in the loft, need to
work out how to watch DVD's (RGB out only) and work on an IR
distribution system (currently a single 'One For All' remote extender)
Maybe move the TiVo and cable box to the node0 and send the
signal up to the lounge over CAT5
This month I decided to play with bluetooth for fun. I bought one of the MCI class-1 USB bluetooth dongles and spent a little time getting the bluetooth utilities supplied with Red Hat Linux 9 working. It certainly has potential, using AT commands I can remotely create menus on my phone, capture key presses, capture and send sms, monitor call progress and much more.
So the plan is that when I enter the house I'll get a new menu on my phone letting me control the lights and stuff, with incoming calls and SMS displayed on the tv/mp3 player and so on. I couldn't find anyone who has interfaced a jabber client to a t68i so I'll have to write that bit first. The other problem is that the bluetooth stuff works fine when it works, but take the phone out of range and nothing notices - so it'll need a bit more effort to get it reliably detecting phones coming into and out of range.... anyway it'll be a fun month.
My paper on
"Security Response and Vendor Accountability for Open Source Software" was accepted for Linux World 2003 in San Francisco and I'm giving a similar talk at
Linux for Business in London on the 10th June. The role of the open source vendor is often neglected when folks talk about the security of open source software.
House modifications are coming along well, with updates to the Home Automation security software (a few suprises for any intruder), and some large black marble balls on a rockery out the front. Tracy has been spending a few days pressure-washing the driveway which is fun apart from the occasional lump of sand that gets blasted at random parts of your body. Sand in your nose is quite annoying.
Back to work on Monday, but this holiday I've managed to avoid getting into doing real work by playing with the home automation system. I've now finished the conversion of all the components to Jabber bots, written a control client, and got all the one-wire Dallas switches and sensors up and running. some screenshots are available
A hope Google extends the shopping idea to the UK; I've wasted too many days this holiday looking for stuff for the house - just trying to find the right table for our kitchen took two days - I just want to search for a round glass 90-110cm table plus four chairs for under 400 pounds and click on 'buy me'.
Had a cold today so didn't get anything done on my presentation this evening, instead did something that required little work and hacked more Perl for the home automation system. There are now four jabber bots online, a common thread is that you can message them and get some status information, or send information to them to do, also if you've got them listed in your roster they'll send you an update with their status every minute.
At the moment the UPS bot tells you interesting status reports and notifies you of emergency things. The adsl bot tells you about the cable modem link signal strength and so on. The tivo bot is rather cool, it tells you what it's currently watching and a few status indicators, and in return you can pop up a message on the screen or send a message to be viewed in the message centre. The final X10 bot lets you control X10 things in the house, just some lights at the moment. It doesn't yet report the status, that seems not to work.
I'm having problems getting Perl to deal with the parallel ports correctly so I can't get the alarm, SMS or heating controls to work yet. Also these bots are complete hacks and return the information in psuedo-xml (random made up DTD) and I've not thought about messages vs groupchats vs iq oob for the data. Anyway much fun being able to message the living room lights to turn to 30% brightness
So I've been spending some time trying to work out what to do with the home automation components - they're a mess of C and Perl that have no real way of communicating with each other. I found this thing called xAP which is designed for home automation components to talk to each other, but it's based mainly on UDP broadcast datagrams - not something I'd trust to make sure things happened when my alarm was triggered. Plus some of the components already written are under a non-GPL, non-BSD license that prohibits commercial use, yuk.
Anyway the idea was to look for something that would use standard components, where frameworks existed in Perl and C for me to write simple code, and to work on the principle of messaging - the UPS for example would respond to status requests and give you things like the temperature and voltage; with a heartbeat notification with the status included every minute; but with urgent alarms to anyone who registers an interest in getting them. Whats the solution? Jabber! In about an hour I had a jabber server running and a test Perl client doing just that; this thing will rock :)
Several hours later and I manage to find out the extended
commands for the LW11G dimmer unit. Can't find these
anywhere else mentioned on the web, so for future generations:
# Extended X10 control of LW11G dimmer
# Unlike other L*11* modules the LW11G
# seems to only respond to code 53. Set the data to
# 0 = immediate off
# 255 = immediate on
# 1-254 = slowly dim or bright to that level, turns on if
Whilst replacing yet another set of lightbulbs that had
blown after only a week I thought I'd look at the supply
voltage into the house. My UPS logs the voltage so this was
easy. 253 volts.
The UK used to be 240 volts (+/-10%) but quite a few years
ago the nominal voltage was changed to be 230 volts (half
way between the UK 240 and the European 220). In practise I
read that this meant very little, they just continued to
supply 240v which was within the tolerance. 253 volts is
also just within the tolerance, but annoyingly causes my UPS
to alert me every few hours. I also read that in 2002 the
tolerances are going to be adjusted to +/-6%.
Armed with all this information I called the electricity
company who actually said 253 volts was an emergency
situation and someone will be with me shortly.
Played around with the Linux IBM ViaVoice SDK so my UPS can
speak. "Help, the voltage is too high, I'm frying,l arrrrgh"
Played around with the alarm system (well the 'tamper' system
works) but need some opto-isolation before I dare connect it
up to the gateway. Got the gateway to SMS me when there is
a power failure, which is semi-useful but really freaks out
guests when I switch off the master power and my phone beeps
a few seconds later. Took a few pics of the setup so far
I'm trying to stay away from coding for work for a month or
two, just to see if it can be done. I've found it hard the
last few years as I moved away from doing coding on a day to
day basis; you tend to judge your week by how much code
you've achieved. This of course doesn't scale when you get
to be a manager and the temptation is to try to do a bit of
coding for work every week in order to feel you have
'achieved something'. Last week I couldn't resist and ended
up recoding some pages and scripts that were in PHP to work
with AxKit. Doh.
Hi! I'm Mark Cox. This blog gives my
thoughts and opinions on my security
work, open source, fedora, home automation,
and other topics.
pics from my twitter:
red hat summit,