Tuesday, June 30, 2009

Somewhat Quiet Last Few Months

I've been a little preoccupied with other things, but I have been working on some small projects here & there. I just haven't felt like writing about them. I'll try to summarize what I've been doing for the past several weeks/months.

Last night, I hardwired the sensor that detects when our alarm is armed. Originally, it was a CDS cell covering the armed LED on one of the alarm keypads. The sensor was then connected to the CDS input of an X10 Hawkeye. It worked well 99% of the time, but once in a while, it would a miss detecting a change due to some RF collision. Not a major problem as the alarm is completely separate from the HA system, but annoying for automating events. So, I ran a pair of wires from the CDS cell at the keypad to the wiring closet. I terminated it on the X-Axis of the third gameport controller I've deployed. It works perfectly now.

I've gotten fairly adept at fishing wire with no special tools. For the CDS wire, I routed it from eyelevel where the keypad is to just above the baseboard. I used a string with bolts tied on and dropped it into the wall from an eyelevel hole. I drilled a small hole above the baseboard and used a vacuum to suck the string out. I then fished the wire through by taping the string to it.

I also added a 2nd HDHomerun (which also involved fishing wires - some Cat-5E and RG6.) I have it currently connected to an HD antenna in the attic.

I've been slowly deploying more of the UPB modules I got on clearance from Fry's. As my UPB network got bigger, I started to notice some limitations in my handling of it. I wrote my own code to handle UPB since my old TimeCommander+ does not have the capability. It resides in my xPL starCOMUltra bridge as described here. It's actually just a generic serial interface in the bridge. All of the actual code handling UPB is in the hosted JScript.

To make a long story short, I was having problems with retries and sending commands to the UPB PIM too fast. I solved this by adding JScript code to build a command queue and beef up the retry/busy/NAK logic. It uses the built in Queue structure, similar to JavaScript and described here.

I also bought a couple more HP thin clients off of eBay. I am now planning on installing .NET on them, so I've also purchased these 512MB flash disks so I have enough room for it (.NET needs about 150MB free on the C: drive). I also found some cheap 512MB RAM upgrades as well. One will be deployed at our other house for more minor automation projects and the second one will replace the current T5700, which functions as a networked contact closure device. I want to test out & phase in the new one before taking the existing one offline to upgrade and move elsewhere in the house.

Tuesday, June 9, 2009

Impressed With Our ISP Speeds

I haven't run a speed test since years ago when we first got Comcast HSI. Back then it must have peaked around 2 Mbps down and maybe 384 Kbps up. I just ran a test and I'm seeing 15 Mbps down and 9 Mbps up! Very nice!



EventGhost xPL Plugin Version 0.2

I made some suggested changes to the plugin to make it play better in EG. Get it here.

Edit: bumped to 0.2.1 download link updated

Monday, June 8, 2009

Deadbolt Monitoring

With a couple little kids going in & out of the house, they often forget to lock the doors when they come back in. So, I've been looking into ways to monitor the status of the deadbolts (and the sliding door lock). I have some limited options as I'm not putting in any new door frames, so the walls won't be open.

I looked at using plunger switches drilled into the door frames that would get pressed when the deadbolt was locked. I didn't really want to drill into the door frame to install it and have to figure out what to do with the wire on the other side of the door frame.

I opted for the typical magnetic reed switch solution. Fortunately, a couple doors had deadbolt holes deep enough to fit mini reed switches without interfering with the deadbolt. I was easily able to glue them into the deadbolt hole and route the wire to the bottom of the door frame and out to where I needed it to go. For the magnet end of things, I got some 10mm x 1mm rare earth magnet discs from eBay. I superglued these to the end of the deadbolt, so that when the deadbolt closed, the magnet would be close enough to cause the reed switch to close.

One deadbolt hole wasn't deep enough and I didn't feel like drilling deeper into the doorframe. Instead, I found some subminiature reed switches at a local electronics surplus store. They're very tiny with a glass casing, so you need to be careful installing them as they're easy to break. I etched out a place in the deadbolt hole so I could glue the reed switch in, making sure it was far enough away to not get crushed when the deadbolt closed.



The sliding door has a different locking mechanism so I had to be a little creative monitoring that. Again, I used a subminiature reed switch and mounted it on the door frame. I used half of a rare earth magnet and glued that to the lock latch. It took a few iterations to get the right position of the reed switch and some careful wire placement to run the wire, but I was able to get it monitored.

I have everything run to the gameport adapters that I used for contact closure monitoring. I'll post some pictures when I get the chance.

Thursday, June 4, 2009

Hibernating Sage Server & Waking Up HD Theaters

I've finally gotten around to optimizing the powered on time of the media server. To get started, I have Sage export its recording schedule to a network drive by setting this option in sage.properties: scheduler_export_file=. I just specify the path to the file I want it to dump to. It creates a tab delimited file containing the recording schedule for the coming week. I parse this file daily at 1AM and keep track of the earliest start time and latest end time for the day.

The server gets shut down sometime after we've gone to bed and after the last recording. It actually gets hibernated remotely from the HA server using psshutdown. I use the command psshutdown -h \\machine-name to initiate hibernate.

The problem with hibernate is that wake on lan will not work to bring the machine up, but it will work when the machine is shut down or in standby. I opted for hibernate since the machine comes up faster than from power off and uses less power than standby. I needed a way to automatically push the power button to turn on the server. I wired this relay to the power button, connected it to a 12v wall wart plugged into a UPB appliance module. Now, my HA server sends a UPB command to turn on the wall wart & then turn it off. This causes the relay to close and activate the power switch before the relay opens again.

Once Sage is awake, I have EventGhost macros that check to see if the server just came on or came out of hibernate. Those macros then kick off a python script that telnets to the HD Theaters and reboots them so they are powered up and waiting on the sage menu.



import telnetlib

tn = telnetlib.Telnet("192.168.1.2")

tn.read_until("login: ")
tn.write("root\n")

tn.write("reboot\n")


Wednesday, May 27, 2009

Homebrew Network Controllable PT Webcam

I received my USB Missile Launchers from Woot the other day. I ziptied a webcam to the top of the launcher and then started looking at how to control it. Fortunately, I found some open source software called SharpLauncher. It's coded in C# using #SharpDevelop and opened without a problem in Visual Studio 2005. It didn't take long for me to hack the code to add xPL support to support panning, tilting and firing the missiles. It works great, but since I used the developmental version of code, there's lots of crashes using the GUI - but I don't need it using xPL.

Thursday, May 21, 2009

Taking the Plunge on Magic Jack

I saw Radio Shack was having a one day sale yesterday and they had the Magic Jack for $29.99 instead of the regular $39.99. Having recently cut the landline, I decided to give it a try (in spite of the horror stories). $29.99 covers the device and the first year of service, with each additional year costing $20 ($60 for 5 years in advance). For $29.99, I could pay for only 2 months of my AT&T landline service - and that was the bare minimum plan. (Half of the $15 monthly bill was the service and the other half was taxes!)

Installation was a breeze. I installed it on the Sage server, which runs Server 2003. It seems to work OK for the most part. However, I've run into a problem a couple times where I call someone and they pick up, but I never heard the phone ring nor them talking. I hang up and call back and it gets connected OK. Sound quality seems fine on both ends.

One annoyance is the MJ software is always foregrounding itself when you make a call or you get a call. I set up an EventGhost macro to automatically minimize the MJ window whenever it's activated:



Since it now comes with caller ID, I decided to turn HAL back on. I had to do this fix to get the caller ID working consistently. HAL's telephone VR works with MJ the same as with a landline.

I've got a little more playing around to do with MJ, but it's usable. It's definitely going to get used more than the landline did since long distance is free.

Monday, May 18, 2009

Not Much To Update

I spent Saturday morning fishing some wire between to adjacent rooms while my 6 year old daughter was running around with a Clone Trooper helmet shooting me with a dartgun. I pulled 3 runs of Cat-5e and now wonder if I should have pulled some RG-6 while I was at it. I also spent some time thinking about how to implement deadbolt sensors as the kids never lock the doors when they come in the house.

Since we just cut the cord to our landline, this article caught my eye. Having watched the financial meltdown before the cracks really appeared (thanks to the early heads up by Minyanville), I can see a telco bailout coming.

Monday, May 11, 2009

Ubuntu or Windows 2000?

This weekend, I was re-purposing an old PC (a Celeron 2600, a former automation server) as a PC for the kids. It has a gig of RAM, 160 GB hard drive and an ancient GeForce2 GTS based video card. I had a few choices of OS - Vista, some flavor of Linux or Windows 2000. Vista would be too much for this hardware, but Linux should be good, right? Wrong. I tried the latest Ubuntu, but it felt like I installed Vista on it. The machine was so bogged down. Even browsing was slow. The graphics were laggy and xorg used a lot of CPU. I downloaded and installed the latest Nvidia drivers (at least I think I installed them correctly), but everything felt slow-mo. I tried Xubuntu since it has a lighter window manager, but not much better. Puppy Linux was peppier but I really needed Shockwave for the kids. I took out the trusty Win2k disk, loaded it up and scrounged up all the drivers off the net. I disabled a bunch of extra services. Very snappy. Even the graphics were smooth. I forgot how light Win2k is. I think this will do just fine for the kids.

Wednesday, May 6, 2009

Canceled Landline

I canceled our landline today. I should have done it a while ago, but was lazy. Ever since we got the Sprint AirRave, our cell coverage is perfect so we've used the landline even less. It's ridiculous that the lowest priced service is almost $8 and the taxes and fees nearly doubles the bill! I don't think I'll miss it much. I got tired of the dumba** carpet cleaning morons violating the do not call list with the automated dialers and recorded messages. I have been contemplating Ooma, but I'm just going to wait a bit.

Monday, May 4, 2009

XP SP3 RDP Crashes

Finally got around to installing SP3 on my automation server and was rudely greeted by a crash and reboot when I tried to RDP onto the machine. Reading the minidump confirmed RDP was somehow to blame. A quick Google revealed there's some incompatibility with some ATI (and Nvidia) graphics drivers and SP3's remote desktop. I installed the latest ATI drivers from AMD's site. We'll see what happens.

Update 5/5/09: Nope that didn't fix it. It still crashes when I RDP to it.
Update 6/9/09: It appears to have something to do with RDP color depth. 15 bits will cause a fatal, but keeping it 16 bits or higher doesn't.

Sunday, May 3, 2009

Thin Client Deployed

After many trials and failures, I've got the T5700 running the way I want. The hardest part is installing what I wanted with only 256MB of flash disk while running 256MB RAM.

The first thing I needed to do was wipe the flash disk and reinstall XPe. I followed this guide here to do that, remove unneeded apps and get admin access.

Installing Perl was an adventure. I used the zip version (not MSI) of ActivePerl to install it. That way I could go step by step through the installer.bat file and figure out what broke. One problem I kept having was running out of RAM while the installer ran. I killed pretty much every unnecessary process I could even explorer.exe until I ran into an error that said "Can't open nul: No such file or directory." After some Googling, I found out the XPe install doesn't have a NULL driver. I stumbled onto this old post that seemed to address my issue, but like the poster, I couldn't get the registry script to run. Eventually, I figured out it was a permission problem. Once I got that squared away, I was able to get ActivePerl installed. I ran PPM to install the Win32::MultiMedia package, copied my gameport script over, ran it but it didn't work. It still couldn't see the gameport.

After trying a number of different things, including accessing winmm.dll from Perl, I was about to give up. Then I read this post that mentioned installing DirectX on the T5700. Turns out there was compact DirectX 9.0C install for the T5700. Read the install instructions, changed the TMP and TEMP environment variables and it installed perfectly. Fired up the script and it worked!

However, it didn't appear that the XPe supports DCOM, so I had to come up with a different way of getting the data back to the server. I went back to xPL, using the command line xPL sender and calling that from my Perl script whenever an input changed. Good enough.

Next I tried to install a webcam on it, but the Logitech drivers just didn't seem to work right. I have a QuickCam Express and a QuickCam Messenger and neither would come up. So I scrapped that until I can try some different cameras.

So finally it's deployed - my little digital input over IP project. It only has 3 contact closure inputs connected to the Super JoyBox 8 (which can have up to 16). Now, I can relax and figure out what other things I can monitor with it.