Saturday, February 18, 2006

Linux Home Automation packages

I promised to do a blog entry on the available HA packages for Linux. This will probably evolve over time and I'll probably give it a home on my web pages but for now here it is. As far as I know there are 3 HA packages for Linux (there's a lot more software but not what I'd call software packages). There is PlutoHome (Commercial support & Open Source - GPL?), ECS (Proprietary license) and Mr. House (Open Source - GPL). I pulled the Pluto Home description from their web pages. ECS's came directly from Mark Gilmore (ECS author). I left his HTML mark-up on his description. And the Mr. House I made up from the Mr. House web pages. I'm not so good at marketing (hey, I are an engineer!).


ECS is an all-purpose object-oriented Windows/Linux automation program that is suitable for virtually any tasks (in commercial, industrial, and residential environments). Supporting a large variety of devices, ECS is elegantly simple, yet extremely powerful. Automated tasks may be implemented via simple time-based schedules (great for novices) and/or English-like scripts (which give power users the flexibility they demand). And anyone who can surf the web will be comfortable with ECS, as it supports a browser-based user-interface (accessible via the Internet or WAP-enabled phone/PDA).

Mr. House

MisterHouse is a powerful Perl base open source home automation program. It's an events based control and monitoring program that works on events based on time, date (from the web or other computers), socket, voice, serial data and other events. It currently runs on Windows 95 (or better, there's a joke in there somewhere) and on most Unix based platforms, including Linux and Mac OSX. Mr. House is a powerful, flexible automation solution for your home which works with a variety of control platforms such as iButton, X10, EIB, Insteon, UPB and hard wired (no that's not all of them :-). Its user interface is web-based, which enables control of the systems of your home from anywhere in the world. You can directly access Mr. House from your cell phone, via email, through the web interface, via IM or by direct telnet. It fires events based on time, web, socket, voice, and serial data. Because it's Open Source the user community has contributed a lot of extra scripts to do all sorts of things like interface to your PDA, create shopping lists, track your auto (I only picked out a few, there's a lot more!).

Pluto Home

Pluto is the only all-in-one solution for your home that seamlessly combines media & entertainment, home automation, security, telecom and computing. You can control your whole house with a mobile phone, a touch-screen tablet or a web-interface. A Pluto system is like an appliance - not a computer. It is self-configuring, maintaining and updating. No technical skills are required to use or install Pluto. Pluto is above all simple. The devices are all plug and play. Pluto is also an open platform, offering unlimited expansion potential, and requiring no special cabling.

My Opinion

Let me clearly state that I've only looked at ECS & PlutoHome so I can't comment on their use. I am using Mr. House and I do like it a lot. So much so that I've written an Insteon software interface and I'm helping another gentleman build the UPB software interface. I don't have UPB but I do have X10 and Insteon.

I am on the ECS mail lists and Mark Gilmore (ECS's author) keeps it updated and is very easy to work with. He's been supporting ECS for years and I expect that he'll continue to do so for years to come. ECS has a nice description of what hard device it support here. Because ECS is a commercial program you can expect support for what you pay for. So this is a more of a turn key system than the other 2 but it does have an API so that users can write programs to inter-operate with ECS. This is a good program for those who do not want to go through the steps of putting togther something as complicated as Pluto Home or Mr. House.

I don't really know a lot about PlutoHome. You can download the parts and use them on any Linux distribution but they supply a complete package based on the Debian distribution. I know it supports the CM11A X10 interface and that it can link/connect to other Open Source programs (Asterisk, Myth, etc). Since it's Open Source you can modify it. But I'm afraid I don't know much more than that.

Now, Mr. House I know a lot about but I'm no expert on it. That's why I'm on it's mail list. I know Mr. House has a steep learning curve. Most people get inundated with Mr. House can do and generally don't know where to start (hint, only try to do one thing at a time). It helps to know the Perl (do a perldoc perlintro on a machine with Perl) language and a little HTML (do a Google search for HTML intro) is also a good thing for when you start building web interfaces to some of the data and controls. The default scripts that come with Mr. House can do some amazing things but requires a little tweaking to suite your personal needs. There are a lot of examples of how to do things but if you get stuck just ask on the very active mail list usually can get you on your way. This program/package is really meant for those who don't mind DIY. You've got to be willing to learn and do some digging but you'll be reward with a program with can interface to just about anything.

Tuesday, February 14, 2006

Compiled at last, Hallelujah!

I've been fighting with the Fedora kernel compiles under Linux 2.6 for a couple of months now. For a while I had it, no problem! Then I didn't have it, big problem. Now I have it again. I think what happened is that I had a .rpmmacro file that messed things up. With it the kernel was put willy-nilly about the /usr/src subdirectories. Without it things went back where they belonged.

So how do you compile the kernel? Like this:

  • export VERSION=2.6.15
  • export EXTRA=1.1831_FC4
  • wget${VERSION}-${EXTRA}.src.rpm
  • rpm -ihv ~/kernel-${VERSION}-${EXTRA}.src.rpm
  • cd /usr/src/redhat/SPECS
  • rpmbuild -bp --target=i686 kernel-2.6.spec
  • cd ../BUILD/kernel-${VERSION}/linux-${VERSION}/
  • cp config/kernel-2.6.15-i686.config .config
  • make xconfig
  • make rpm
  • cd /usr/src/redhat/RPMS/i386/
  • rpm -ivh kernel-${VERSION}prep-1.i386.rpm
  • cd /boot
  • mkinitrd initrd-${VERSION}-prep.img ${VERSION}-prep

After that make sure that /boot/grub/grub.conf has an entry for your new kernel. Something like this:

title Fedora Core (2.6.15-1.1831_FC4 custom)
  root (hd0,0)
  kernel /vmlinuz-2.6.15-prep ro root=LABEL=/ rhgb quiet
  initrd /initrd-2.6.15-prep.img 

My machine has a Athlon 64 bit processor (but I'm using it in 32 bit mode for now) so that's why I selected the i686 target. I selected the correct bits for the xconfig such as the Moxa Serial Ports board. In addition, once the kernel compiled correctly I was able to properly compile the Lirc package. I can now send and receive IR with no problems (at least to my stereo system). I hope to add the controls for my VCR and TIVO to the mix. Things are looking up!

Sunday, February 12, 2006

Poof! Well almost ...

About 3 months ago I went through a server shuffle because of power problems. Well last night the power problems reared their ugly head! This time it wasn't so bad. I learned many important lessons from the last debacle. Unfortunately I was still in the middle of getting stuff to keep the problems at bay. What I had done was to take advantage of the dnsmasq that is on my Linksys. In case of emergencies it's my secondary DNS (I have the local machines statically define in a file). So last night after we took a power hit (lights on/off/on/off/kinda on/kinda off/on/off) my server's grub stage2 was corrupted (that's twice now). I decided to leave it until this morning and I pulled out the rescue disk to try to repair the damage. Well the rescue disk has nothing to repair grub! So I go to my machine 2 and whip up a grub boot CD (I had to load a bunch of stuff including k3b). I tried to create a grub boot floppy but the floppy drives are messed up (ARGH!). I guess I really don't use them much anymore. If your starting to see a pattern here so am I. I'm not really prepared for a disaster (though I'm getting better at it). One thing after another fails. Each time a disaster occurs I get better at it but I'm still not there. The last part I'm waiting on is the new batteries for my UPS. I have a very old UPS that takes 2 - 33 A/h batteries. It'll probably cost me $100 (US) for the batteries and about $50 (US) for delivery (I'm still trying to find them locally). They're on next months budget (really I've been working on that since January). I've also planned to add a micro-controller board to monitor the health of the batteries and AC. Either one of the ZX-24, BX-24 or one of the small controller boards I have and I have quite a few to choose from). This will allow me to figure out a bunch of stuff, including the quality of the AC we have. I have a suspicion that the power company isn't meeting it's requirements. I'll be measuring AC voltage (monitor 100 - 130V), DC voltage (10 - 15V?), AC frequency, AC present, inside/outside temperatures and fan speed. So I'll need a clock chip some analog ports and digital ports. I have a bunch of boards with serial ports and a couple with Ethernet ports (this may be a job for the Rabbit or the EZ-80, hmm).

Notes: Here are some of my notes from this morning for grub boot problems recovery:

Grub boot floppy

Under Linux:

  • cat stage1 stage2 > boot
  • cat boot >/dev/fd0

Under DOS:

  • copy /b stage1 + stage2 boot
  • rawrite boot a:

Grub boot CD

Under Linux:

  • mkdir -p iso/boot/grub
  • cp /usr/share/grub/i386-redhat/stage2_eltorito iso/boot/grub
  • mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o grub.iso iso
  • cdrecord -v dev=1,0,0 grub.iso

The locations of your stage file may differ but you get the jist of the commands. I wasn't able to get the cdrecord to actually work so I used k3b (very nice burner!). Sorry I don't know how to burn the software for Windows.

Boot from the grub prompt

I really like grub because it has saved my butt a number of times when something has gone wrong in the boot up process. Such as hosed up grub.conf parameters messed up boot sectors etc. ...

At the Grub prompt:

  • root (hd0,0)
  • kernel /vmlinuz-2.6.14-prep ro root=LABEL=/
  • initrd /initrd-2.6.14-prep.img

The names of the kernel and initrd may differ and the hd0,0 represents my /dev/hda1 (that's where I put the boot directory). My partitions are /boot (hda1), / (hda2 and swap (hda3). Yours may differ.

And the every helpful GRUB Tutorial

In case you're wondering why I posted this, it's because I just wanted the information kept somewhere other than on my machine or in my home. Yes I wrote this down but I like to use the internet as a backup. Just in case.

So my next project is to take one of my other computers and move Mr. House onto it. I think I'll use a flash card and no swap. I'll have to figure out what to do with the data it creates. I don't want it to write to flash. Meanwhile the batteries are on their way. Hopefully I'll figure out how to lower my total energy costs for my home in the process as I hear NJ is about to see a huge jump in energy costs. The energy companies are paying 50% more for their fuel and that snow ball in coming this way. Yikes!

Sunday, February 05, 2006

Do you check email while in the bathroom?

File this under misc. ramblings: The Type-A Bathroom by Jon Weinbach and Peggy Edersheim Kalb (Wall Street Journal Staff Reporters). Seems that there is no rest from work for some. A few high end (big buck$) smart homes have a lot of digital access in the bathroom too! TV's, computers, hey bring the Blackberry with you, that kind of thing. So how do you explain the rude noises while on your cell phone? :-P

Now I have to plead guilty to bringing the Nokia N770 Internet Tablet into the bathroom (when I can get it away from my wife) but it was an electronic substitute for 'bathroom reading' material (I can google for anything :-). While I could read my email and chat on IM I prefer not to. I've thought about it, even thought about bringing in the cordless phone. But the bathrooms acoustics tend to cause an odd kind of echo and someone is bound to ask where I am (oh, and I'm a lousy liar).

With today's businesses being very go-go-go, it may become necessary to have access to information 7x24 and at your finger tips. But somehow we need to perform a balancing act such that our personal lives have a chance. It's very tough to do and I'm not sure I've figured out a good way to handle it.

On another note, I'm still working on the book. I'm up to the Mr. House section. I'm really flying through that part. Tonight I will have complete 2 chapters for this week and I expect to have another 2 chapters by the end of next week. I'm still behind schedule and that will leave me with 1 more Mr. House chapter and 3 wireless chapters. The wireless chapters have been the greatest pain because of kernel considerations (I need to recompile the kernel). 2 of the wireless chapters are half written. Yes I feel like I'm not moving fast enough.