Thursday, December 25, 2008

AMEX Wishlist Goodies

I scored a few goodies from the AMEX wishlist promotion that was running. One of them was a $150 statement credit for a purchase from BestBuy. That went to buying a new HDTV. I also got a 25% off Amazon coupon - apparently it's good until 1/15/09 and can be used until the maximum discount is reached. Among things I got is the Antenna Direct DB4 antenna. It works great indoors bringing in HD signals that are over 40 miles from our house. I am contemplating other purchases to take advantage of this - possibly the HDHomerun and some Sage stuff (software & extender). Finally, a friend of mine snagged the Squeezebox Boom for me. It's very cool.

Monday, December 15, 2008

Shelved xlobby Plugin

I stopped worked on my xlobby plugin. I was hoping I could just drop msscriptcontrol into it to create a scripting engine for my plugin, but it xlobby doesn't seem to like it. After a couple days of getting nowhere, I put it on the backburner...

Wednesday, December 10, 2008

Jabber Re-Integration

I've finally completed integration of Jabber functionality into my xPL sCU app. I had coded it up months ago, but was too lazy to fully integrate it since I've been using xAP Jabber. Last night, I finally cleaned up the code and added response handlers in the xPL sCU hosted script. It's up & running so I've turned off xAP Jabber. I used jabber-net to build in the Jabber functionality.

Friday, December 5, 2008

Plugin for xlobby

I've been playing around writing a plugin for xlobby. I've used it before with the xAP plugin, but it wasn't very stable. I've since removed a lot of my xAP stuff. I do like xlobby's lightweight client for touchscreen applications, so I started toying with a plugin. I've been able to integrate xPL and access to mySQL into a plugin. This allows me to create xlobby events to issue xPL commands, and I can grab the status of everything in my system as its all stored in mySQL. However, the more I think about it, the more I'm going to want to script the responses from the plugin as some of the database contents need to be interpreted. I'll need to add a scripting engine at some point.

Thursday, November 27, 2008

xPL Plugin for Event Ghost

I just threw together an xPL plugin for Event Ghost in a couple days. It allows you to add macros in EG that respond to xPL events and to send xPL messages in response to other events. I'm not a Python coder by any stretch, but I can hack my way through enough of it to be dangerous. Therefore, don't expect the code to be that great or readable.

Here's a couple of screenshots of it in action:



This one shows an event generated by the plugin. The format of the event is:
xPL.<message identifier>:<schema>:<source>:<target>:<xPL message body>

Obviously, you'll get billions of different events so that may make it more difficult to deal with on the EG side as there doesn't appear to be any wildcarding of events.



This screencap shows the configuration box to send an xPL message.

Download the plugin here. I don't have much time to support this, so good luck with it ;) You should understand xPL. If not, read and ask.


Sunday, November 23, 2008

Current Sensing the DVD Player

I grabbed several split core current sensors off eBay and have been gradually deploying them. This week, I added current sensors to the family room TV, amp and DVD player. Now, when the DVD player is turned on, the system checks if the TV is on. If it isn't, it sends IR to turn it on. Then, it turns the TV volume all the way down since audio will be piped through the amp. Next, it checks if the amp is on and powers that up if it needs to and sets its input to DVD.

Update: I have taken all these current sensors off their DS10A's and ran Cat-5 to the gameport controller I use as a contact closure device.

Friday, November 7, 2008

Touch Pro Finally!

The wife & I picked up our matching pair of Touch Pros last weekend from the Sprint store. What a great phone! A beautiful 640x480 screen, full QWERTY keyboard, GPS, WiFi & EVDO Rev A. It's taking some getting used to having a slider keyboard and the Touch Flo interface, but I've been using Voice Command a lot more now. The UI is a little laggy at times, but I have been doing some performance tweaks that I've read about in various forums. It's been only a week, but overall, I'm really liking this phone.

Wednesday, October 29, 2008

Wetness Sensors

I jumped in and picked up a bunch of wetness sensors mentioned here. I'll be using them under sinks, behind toilets, under the water heater and the AC drip pan. These will work great with the eternal DS10A deal.

Haven't had much time for automation the last few weeks. I am experiencing major X10 noise problems for the first time. Three different light switches upstairs are intermittently controllable and one turns on by itself. I spent an hour unplugging just about everything in the house, but no luck. I tried changing house and unit codes too. It's very odd as everything was working great 3 weeks ago but I haven't plugged in anything new. Sometimes, device power supplies will all of a sudden start spewing noise onto the powerline, but those have been easy to track down & put on a filter. I'm a little stumped right now and considered replacing them the light switches with UPB ones, but they are so expensive.

Saturday, October 11, 2008

Current Sensing the Dryer

I got a few of the current sensors mentioned in this thread to monitor if certain devices are powered on. The first one I used on the dryer. I opened up the small access panel where the plug is terminated (as mentioned here), disconnected a leg, peeled it apart from the rest of the power cable and inserted it through the current sensor. I turned on the dryer to test it out (it was on the 'air dry' setting), but the sensor didn't activate because the heater wasn't on. If I switched it to a heated cycle, the sensor triggered. So I had to move the current sensor to the other leg, which is active whenever the dryer is on. After putting everything back together, I attached the sensor output to a DS10A so that it can send the dryer's power status wirelessly. Now, whenever the dryer turns on, the laundry room exhaust fan turns on and when the dryer is done, the laundry fan turns off 2 minutes later.

Thursday, October 9, 2008

Camera Server Efficiencies

Our CCTV system has been hacked and pieced together over the last 10 years and became more convoluted than necessary. Now that the Avermedia setup is running, I've been able to simplify things quite a bit. Our system previously used an IR controllable 4-1 composite video switcher to select an active camera based on user input or motion sensors. The automation server would use this feed to take snapshots of the activity. Each camera was also modulated so we could view them on our TVs or Slingbox. Now, the Avermedia records all 4 cameras based on its software motion detection. Also, the software is running full screen as a quad viewer. Since the server is headless, I've connected a VGA to composite video converter and modulated that output. This allows me to remove 3 modulators and the video switcher while still allowing the automation server access to all 4 cameras (albeit smaller views). Finally, an old series 1 TiVo was recording the camera feed continuously and that too got turned off along with its modulator.

Tuesday, October 7, 2008

Mediasonic HD9-U2LA NAS

I bought a few things off of eBay of late, taking advantage of the 30% cashback from live.com. One of those things is Mediasonic HD9-U2LA NAS. It's a very simple NAS device that takes an IDE drive up to 1TB and has both a 100 Mbps ethernet connection and USB 2.0. Performance is not great - it looks like it sinks about 15-20 Mbps, but that's OK for my needs. Another annoyance is it uses FAT32 so file sizes are limited to 4GB. On the plus side it's fanless and quiet, relying on its aluminum casing to dissipate heat. Unlike a lot of cheap NAS cases, this one features a configurable idle period before the hard drive is powered down. For me, this is a key as the NAS is just for weekly backups run in the middle of the night. I suppose I could put it on an appliance module and power it on and off when I need it. I'll measure its power consumption later today.

Update: It uses 4 watts with the drive powered down and 11 watts with it active.

Monday, October 6, 2008

Airave Update

We've had the Airave a few weeks now and it works nicely. We've now got a solid signal for our Sprint phones and the quality is very good. Dialing out takes about 1-2 seconds longer, but incoming calls are seamless as is the transition to regular cell towers when we leave home.

Tuesday, September 30, 2008

X10 Web Interface Added Slug

Last night, I installed the lighttpd web server and BlueLava CGI interface on the Slug. Now, we can web control the lighting at our other place. It's a bit sluggish as the CPU seems to get bogged down a bit after issuing a command, but it does the job.

Thursday, September 25, 2008

Camera Server Update

I had time yesterday to connect up 2 more cameras to the system. Oddly enough, the CPU utilization went down! It went from 26% with 1 camera to an astonishingly low 10% with 3 cameras and motion detection on each. I thought since it was dark out by the time I got the cameras connected, there wasn't much CPU used for motion detection on mostly black cameras. But it's bright outside now and the CPU is still low. Maybe with 1 camera, it does motion detection at 30 FPS, but dials it way down with more cameras? Who knows. I was thinking that I would have to reduce the resolution from 640x480 when I added more cameras, but it looks like I'll be able to leave it like that. I also put the server case on its side so the CPU heatsink would have better airflow (it's right under the power supply, which has no fan). That combined with the lower CPU utilization has the CPU temp down to 55°C from 66°C.

Wednesday, September 24, 2008

D201GLY2 Camera Server Testing

I received the Avermedia NV3000 Monday and I've had some cycles to play around with it. I've only hooked up one camera so far, but I've got it set up for motion detection and remote access. It works well so far, but I can't stand that it requires IE to view its web interface. Stupid ActiveX components. With the 1 camera running, I'm using about 26% of the CPU and it's getting quite hot - about 66°C, but from what I've read, that's typically how hot they run under load. I was hoping to get away with minimal cooling but it appears I'll have to add another fan to the case. There's already a 120mm Antec Tricool in the rear of the case. I'm looking at adding an 80mm on the side panel to exhaust directly over the CPU. Hopefully, by this weekend I'll have 2 more cameras online.

The NSLU2 and CM11A have been deployed at our other house. The Airlink IP cam is also there. I've been monitoring the system and everything is working fine. I'll need to do some tweaking to the lighting schedule in the future and add a few more lights to the system at some point.

Saturday, September 20, 2008

Slug Doesn't Mix with Edgeport

The 2nd NSLU2 arrived and I started hacking it. I installed SlugOS, moved it to a 2GB flash drive and then installed gcc. Next, I installed HeyU, compiled the source right on the Slug. Then I installed the Edgeport driver ( kernel-module-io-edgeport ) and put the Edgeport/2 on one USB port. It was recognized according to the syslog messages in /var/log/messages, but I couldn't get HeyU to recognize CM11A connected to the Edgeport. I tried a whole bunch of things - reflashing SlugOS, recompiling Heyu, reinstalling the drivers, installing Misterhouse, trying a W800 on it, etc. In the end, it appears the Edgeport driver doesn't work on the NSLU2.

I headed over to Fry's and picked up an Airlink USB to Serial adapter. It has the PL2303 chipset that is known to work on the Slug. I installed the kernel-module-pl2303 driver and presto, everything worked. I'll need to add a USB hub later since this, unlike the Edpgeport/2, only supports 1 serial port. Now, I need to work on a HeyU lighting schedule.

Wednesday, September 17, 2008

Planning & Waiting

I have a couple projects waiting in the wings - upgrading our security camera system and doing basic automation at our other place. I've been spending the last couple weeks figuring out what and how to go about things and I've finally got my plan together.

For cameras, I'm looking at upgrading to some day/night bullets. I still need to find specific cameras, but in the meantime, I can use what I have. I have re-purposed the D201GLY2 based kitchen PC to be a lower power camera server. I moved it from its slimline desktop case to a tower so I can fit more hard drives and an Avermedia NV3000 capture card. It has 4 video inputs and can capture at 30 FPS total, which shouldn't be a problem. I only have a couple cameras I want to monitor so this should be sufficient. I also moved the Sparkle Power SPI180LE high efficiency power supply into the tower, but since it's a low profile supply, I had to create a mount to use it. I ended up hollowing out an old AT power supply, snipping some parts off and drilling some holes so I could mount the SPI180LE inside it. Then I was able to install the unit into the tower. It looks pretty good. Now, I'm just waiting for the NV3000 and some BNC to Cat-5 baluns to arrive.

The remote home automation project will be starting shortly as well. I picked up another NSLU2 to use as the automation server. I will be installing OpenSlug on it and implementing very basic control with HeyU and a CM11A. The CM11A will be connected to the Slug via an Edgeport USB to Serial adapter. I may also pick up a W800 X10 RF receiver so I can put some sensors (like moisture/leak detectors) on DS10As. HeyU conveniently supports the W800. Finally, I got an Airlink wired IP camera to test out. It works nicely (and has a Java interface in addition to an ActiveX interface) so I will probably put it over there as well. I'm waiting for the Slug to come and then I can start working on this.

Monday, September 8, 2008

Comcast 250GB Cap Goes Live October 1

For all you Comcast users out there, Comcast has decided to cap your previously unlimited Internet service at 250GB per month. That number is the total of your download AND upload usage. Comcast won't provide their customers with any tool to measure their usage and could care less how you figure it out.

So how can you measure the usage of all your devices??? It's easy if you have a Linksys WRT54GL router (or some versions of the WRT54G and WRT54GS) and the Tomato replacement firmware. It has a great built-in bandwidth monitor and graphs for various time periods (daily, weekly, monthly) so you know exactly how much bandwidth all the devices behind your router are using.



Sunday, September 7, 2008

Sprint Airave Coming

I just got off the phone with Sprint, our cell provider for almost 2 years. They're going to send us their Airave femtocell, which has been widely released last month. We live in an area which has marginal Sprint coverage, which has been the only negative about our service. This device is like a cell phone repeater, except it will route your voice over your internet connection - so it's like a cell phone VOIP adapter. The Airave costs $99 and $4.99/month but Sprint hooked us up for free with free FedEx shipping. Now, we'll get 4 bars at home to go along with our SERO plan (unlimited EVDO, unlimited SMS, 500 minutes/month and nights & weekends 7-7) for just $30/month.

Thursday, August 28, 2008

Slug and Syslog Server

One thing I miss about having the web server on the Slug, is having logfiles. Since it's running on a USB flash drive, I've turned off logging for everything so I don't kill the flash. I finally got around to setting it up to use a syslog server and pointed it at my HA box.

To do this, I edited /etc/syslog.conf on the Slug, setting DESTINATION to "remote" and REMOTE pointing to the HA server.

DESTINATION="remote" # log destinations (buffer file remote)
MARKINT=60 # interval between --mark-- entries [min]
REDUCE=no # reduced-size logging
BUFFERSIZE=64 # buffer: size of circular buffer [kByte]
LOGFILE= # file: where to log
REMOTE=aaa.bbb.ccc.ddd:514 # remote: where to log
FOREGROUND=no # run in foreground (don't use!)

In /etc/lighttpd.conf, I set up some conditionals for access logging:

$HTTP["url"] !~ "(\.css|\.js$)" {
$HTTP["remoteip"] != "aaa.bbb.ccc.0/24" {
accesslog.use-syslog = "enable"
}
}

Anything other than .css and .js files viewed from anywhere but my LAN will get logged. Cool.

Finally, I played around with few free syslog servers. None of them did what I wanted so I wrote my own in Perl. It's very simple so far and not very efficient with the logfile handling, but it works for now:

use warnings;

use IO::Socket;
use IO::Select;
use Sys::Hostname;

$port = 514;

$socket = IO::Socket::INET->new(
Proto => 'udp',
LocalPort => $port,
);
die "Could not create socket: $!\n" unless $socket;

print "syslog server\n";

while (defined($socket)) {
recv($socket,$msg,1500,0);
@msg=split(' ',$msg);

if ($msg[11] ne "") {
print "$msg[1] $msg[2] $msg[3] $msg[4] $msg[7] $msg[11]\n";
}
open(SYSLOG,">>./syslog.txt");
print SYSLOG "$msg\n";
close(SYSLOG);
}

close($socket);

Thursday, August 21, 2008

Slug Online

I ended up ditching Unslung for OpenSlug, mainly because OpenSlug has drivers for the EdgePort USB to serial adapter. (I'm planning on getting another Slug to use as a minimal HA controller for monitoring our other house.) I also dropped Apache for the lighttpd which has a smaller memory footprint. I dropped the idea of Squid as I ended up using my home router as a SOCKS proxy over SSH. I've got my Slug running off a 1GB flash drive and it uses a meager 4-5 watts! I had tested it running an 40GB USB hard drive and together, it used about 13 watts. The 466 MHz Celeron that has run the webserver for years uses about 35-40 watts, but that will get shutdown when I iron out a few remote access issues. The Celeron box currently is instrumental in accessing the home network and I hope to move that functionality to the firewall. It is no longer a webserver, as the Slug is doing that as of today.

Tuesday, August 19, 2008

Playing With The Slug

I received the NSLU2 yesterday and had a few cycles to play around with it. I flashed it with the latest Unslung firmware. That was pretty easy. I checked out a what packages are available to see what I could put on it. I installed OpenSSH, my public key. I also installed Apache as I'm pondering replacing my public webserver (running on a 466 MHz Celeron) with this. Finally, I did the overclocking mod to boost the Slug's CPU frequency from 133MHz to 266Mhz. Apparently, the unit I got was an older rev. I'm also looking into installing Squid as a proxy, not a cache, since I use my current webserver to proxy web traffic from work inside an SSH tunnel. I'm not sure if this will have the power to proxy better than the Celeron box.

Friday, August 15, 2008

Slug On The Way

I bought a Linksys NSLU2 (aka Slug) off eBay the other day. I took advantage of the Microsoft Live 25% Cashback promotion and saved a little extra. I'm not sure what I'm going to do with it, but I'm going to play around with Unslung and build a cheap, low power server out of it.

Monday, August 11, 2008

HA Burnout

I haven't been up to much with HA the last few weeks. I did a year's worth of projects in 1.5 months, and I've run out of ideas for projects I want to do. I did finish up xPL Gameport, but I haven't bundled it up for download yet. Not sure if I'll be doing much in the next couple months as we're contemplating some other much more costly home projects...

Thursday, July 24, 2008

DNS Exploit Loose - Check Your DNS Server

To the 2 or 3 people that read my blog, make sure your DNS is secure. There is an exploit in the wild that can poison DNS settings (steering you to a malicious site instead of your banking site for example). Read this article for more details. There is a link to a DNS checker or better yet, just switch to OpenDNS. I've been using OpenDNS for years now. You should also look into using NoScript if you're running Firefox. It's an addon that only allows Javascript to run from sites on your whitelist. It's a pain in the ass at first because you have to whitelist everything you usually use, but it's one of the best ways to secure yourself from malicious websites (although if your DNS is poisoned, you're out of luck).

Tuesday, July 22, 2008

A Busy Month and a Half!

Wow. I just looked back at my archives and I've been busy the last 1.5 months! What I've done:

- Kicked off the addition of UPB by installing a UPB coupler
- Updated my xPL sCU bridge into a full xPL/xAP/sCU bridge, making this my xPL/xAP scripting engine and phasing out xAP floorplan
- Wrote an xPL app to send TTS to 3Com Audreys
- Put a full scripting engine into xPLHALi
- Wrote a HALi client/server app that passes VR from client HAL machine to server HAL machine and passes responses back down, which can be spoken in client HAL voice or SAPI voice.
- Deployed several UPB modules and integrated UPB functionality into sCU and xPL sCU by writing code to communicate with a UPB serial interface. Integration with X10 is seamless.
- Wrote xPL gameport app as a poorman's method of getting contact closures into the system (and learned some DirectX)
- Installed USB Cat-5 extender to connect HA server to gameport in the garage
- Deployed 8 1Wire sensors and converted system over from using LM34s
- Wrote 1Wire VB.net app using TMEX API to poll sensors and dump values into a mySQL table

That was fun! Now I'm wondering what else I'm going to work on next...

Saturday, July 19, 2008

1Wire Serial Adapter Hates EdgePort

Since I've had the 1Wire network running, I've encountered a few fatal system errors that caused an immediate reboot of my HA server. Digging in the Event Viewer, I found messages like this:

Error code 00000044, parameter1 89422548, parameter2 00000d63, parameter3 00000000, parameter4 00000000.

I Googled a bit and found that error code corresponds to a memory problem or a driver issue. I stumbled upon a thread that told about how to read minidump files created by crashes. The dump file pointed to the EdgePort and the most likely culprit was a Java application. That points to the 1Wire stuff since its OWAPI is based on Java and the DS9097U adapter is plugged into the EdgePort.

Rather than take the easy way and move the 1Wire to the motherboard's built in serial port, I decided to write a VB.net app to talk to 1Wire adapter using the TMEX API. This way, I could avoid using all of the convoluted Java/J# crap. The problem with this path is there wasn't a VB example to get the temps, but there was a Delphi example. Ugh. Finally, I managed to cobble the Delphi and VB sample code into one VB.net program to connect to the 1Wire network and read the temperatures. About 7 hours after deploying that, I got another fatal pointing to the EdgePort. Guess it's not the Java part of the 1Wire after all.

So I connected the DS9097U to the onboard serial port and moved the TC+ to the EdgePort. It's been 12 hours without a fatal reboot. Hopefully, this solves the problem.

Update: It's been over 3 days since I moved the DS9097U and there have been no crashes since. Yay!

Thursday, July 17, 2008

Noisy 1Wire Readings

Of the 8 sensors I installed, the last one on the chain fluctuates a little between readings. It's not bad, just not as accurate as the other 7 sensors. What's different about this one?

It's at the end of the 1Wire line - could there be signal issues? I originally wanted to create my 1Wire network in a star pattern as that would be the easiest to wire from the patch panel, but the 1Wire docs advised against it. So I ran the network as 1 giant wire with each sensor as a stub. I actually used 4 wires to run them (voltage and ground since I decided against powering them parasitically and a wire for network in and network out). I chose this method to control the length of the stubs - otherwise the stub length would be the wire distance from the patch panel to wherever the sensor is located, which would vary for each location as each Cat-5 run is some different, unknown length. This, of course, increases the network length, but should be well within the 700 meter limit.

The sensor is also the only one outside. It's installed sticking out of the wall of our enclosed porch. It was exposed, but after seeing the fluctuations, I covered it up with electrical tape. It still fluctuates. I tucked it behind the porch speaker. It still fluctuates. I'm not sure what else to try at this point. Maybe that's the way it is outside?



Here's an RRD graph of the master bedroom temperature vs. the outside temperature. Starting Wednesday evening, after I got all the graphing and data gathering correctly set up, you can see the very smooth curve for the master bedroom sensor. The outdoor sensor, however, has fluctuations, on the order of a degree or more at times. The readings are accurate - they just don't make for a pretty picture.

Wednesday, July 16, 2008

1Wire Installation Completed

I put in the final four sensors Monday night and started trying to integrate things into the system. I decided to have the temps dumped into mySQL and all other applications can get the temps for there. For now, I've modified the GetTemps.js jscript sample from the 1Wire SDK to poll the sensors, update their values in mySQL and then sleep for 5 minutes.

My next step is getting the temps into the TimeCommander+ since it controls HVAC. The TC+ previously relied on the LM34 sensors connected directly to its analog inputs, so it directly knew the temperatures around the house. With 1Wire, I had to create variables in the TC+ for the temperatures it needs and have starCOMUltra periodically update them.

Finally, I had to update my RRD scripts for graphing temps. Since the 1Wire temps are digital values, there's no need to do any smoothing or error checking that I occasionally had to do with the analog LM34s. Once I had the RRD scripts up and running, I was able to see how nice 0.1 degree accuracy looks. I happened to have 2 DS18B20s, while the others were different flavors of DS18S20s. The rooms with the more accurate DS18B20s had much smoother curves compared to the DS18S20s with their 0.5 degree accuracy. I discovered, though, that you can calculate more accurate values using extra data bits stored in the device. I just added that code to my script and set it off running.

Monday, July 14, 2008

1Wire Deployment

The last few days, I started deploying 1Wire temperature sensors around the house. I've had the serial port interface and a bunch of DS18S20 sensors lying around for a while but I never got around to installing them. Our current system uses LM34 sensors hooked to the analog inputs of the JDS TimeCommander+, but they only have 2 degree accuracy and I've lived with that for 10+ years. Since I've been on my automation surge of late, I figured it was time to install the 1Wire stuff.

I tried putting the serial interface on an EdgePort at the end of the extended USB run in the garage, but for whatever reasons, the PC was unable to communicate consistently with it. It ended up back in the office, near the HA server. I decided I was going to gradually phase them in, which meant leaving the LM34s wired and running, while I tested out 1Wire. This made me clear out more wires in the wiring closet, at least temporarily, until I can shut down the LM34s. While I was cleaning that up, I decided to map out every wire in each of the 15 Cat-5 cables connected to the patch panel. (When we bought the house in 1999, 15 runs of Cat-5 seemed plenty. Now, I know better... *sigh*). I was able to free up some extra wires everywhere I needed them.

After the cleaning and mapping was done, I had time to solder and wire up 4 sensors - the living room, the master bedroom, the office and our daughter's room. There's still our son's room, the family room, the garage and outside left to do. If there's extra sensors, and I'm feeling adventurous drilling holes and running wire, I may try putting one in the attic.

Installing the 1Wire software wasn't as easy as the wiring. The 1Wire API, OWAPI, is some Java stuff and it relied on the Microsoft JVM, which they are no longer allowed to distribute. Anyway, after digging around the 'Net and iterating on the install process, I was able to get OWAPI operational. I had planned to integrate this all into starCOMUltra, but there's so much lag polling the sensors, I'm probably going to write a separate app to poll the sensors. I'm leaning toward making it directly interface it to sCU instead of using xPL as an intermediate step.

Thursday, July 10, 2008

New USB Cat-5 Extender

I grabbed a couple USB extenders ( called Remote KVM USB Extender up to 300 FT CAT5 ) from this seller on eBay and they arrived yesterday. I was going to test connecting the gameport in the garage to the HA server in the office. I already have 3 runs of Cat-5 in the garage, but they are all used for various things. The guest room is adjacent to the garage and I pulled wires from its closet into the garage before. Luckily I had one full Cat-5 cable left and that was used to connect the gameport in the garage to my homemade USB extension over the Cat-5 cable into the guestroom.

In the office, I connected one end of the new USB extender to my HA server and the other to a Cat-5 cable, connected that to the patch panel that led to an unused jack in the nook area. From the nook wall plate, I rolled my own Cat-5 cable (stripped off the wire casing) and ran it under the rug to the guestroom closet. I terminated that end and connected it into the receiver of the USB extender. Finally, I plugged in a powered USB hub and connected the gameport to it. While I was doing that, I also moved the bluetooth adapter into the closet and plugged that into the USB hub.

Everything showed up in the device manager and I started up the bluetooth and gameport apps. It's running great so my next project may be to put an EdgePort USB to Serial device on the hub and move the RFID reader here (or into the garage if I put a hub in there). I am also looking at using 1Wire instead of the LM34s I use for temperatures - and may end up putting a 1Wire serial adapter on the EdgePort as well.

Wednesday, July 9, 2008

xPL GamePort Deployed

Yesterday, I picked up some DB15 cables to cut up and plug into the gameport box to test out multiple joysticks with my gameport app. It found the extra joysticks nicely so I was able to start installing. The first place I'm putting a gameport module is in the garage where I have a few things monitored by DS10As - like the garage door, the doorbell, etc. I connected the gameport in the garage via the cheap cat-5 USB extension I wrote about before and plugged that into a test machine. I terminated one end of a gameport cable to a terminal strip to allow for easy wiring. Finally, I ran some cat-5 to one set of reed switches on a door to try it out and that worked great. Hopefully, I'll have some time today after work to connect a few more things. The doorbell never really worked with a DS10A - maybe it toggles too fast for the DS10A to see it. In any case, that'll be my next thing to wire up. I also have to decide if I'm going to leave this connected to a new machine or try to connect it all the way up to the HA server. I'm going to need a better method than my cheap cat-5 USB extender because it will not work this far.

Monday, July 7, 2008

xPL Gameport is Alive

The gameport app is up and running tonight after some technical difficulties - I discovered that I have to install the DirectX redistributable on whatever machine the app gets installed in. That's the pain of using DirectX but it made writing the app much easier. I added in xPL so the app will issue sensor.basic messages in response to button presses. I also added in a configuration file where you specify nice names for each button, like "GarageDoor", "Doorbell", etc., and those will be the device names in the xPL messages. One thing left to do is try using more than 1 gameport. I'll need to pick up some extra joystick extension cables to connect to the other 3 ports. I also need to add a selectable polling interval, probably something I'll add to the GUI.

Go Buy Those Gadgets...Now! It's Good For You!

Apparently, splurging is good for your health. So what are you waiting for? Go buy that new HDTV or whatever you've been pining for. I just picked up some Edgeport USB to serial adapters off of eBay - hardly a luxury so I guess this doesn't count. I have been resisting the call of the HDTV mainly because I'm trying to keep our electricity usage under the 300% of baseline threshold, at which the rates increase significantly. We're not that far under it and an HDTV would push us over for sure.

Sunday, July 6, 2008

Gameport Project

I started development on a new project to use the gameport as a source of contact closure inputs. This is something that has been done by others before, but their apps were never anything I could use. So I decided write one myself. All my other VB projects were done in Visual Basic 2008 Express making them usable only in Windows XP and later, but this one I really wanted to run on an old Windows 2000 machine. Luckily, I've got Visual Basic 2003 lying around.

On to coding...or so I thought. It turns out I need the DirectX SDK to access the gameports, but after some time digging around Microsoft's site, I was able to find a version of the DirectX 9.0C SDK compatible with Win2k. I'll be writing my app to connect to a "Super Joy Box 8" USB game port adapter, which has 4 gameports on it, but I assume it should work with others as well. Each gameport will provide up to 4 contact closure inputs for a total of 16 inputs for the device.

Wednesday, July 2, 2008

Bluetooth Antenna Hack



Even with the Cat-5 extension, the bluetooth adapter wasn't picking up our phones consistently. I ran across this site where the author soldered a wifi antenna onto the bluetooth dongle. My adapter is different - it has a trace on the pc board as the antenna - so i soldered the center wire of the antenna cable to that trace and soldered the shield to ground. I went one step further and put on a Windsurfer wifi antenna booster. Now, coverage is really good.

Monday, June 23, 2008

UPB Functionality Moved

I'm having some issues with multiple serial ports interacting in starCOMUltra and Bill is taking a look at it. Basically, what I have is a WGL800 attached to one serial port and the UPB PIM on another. I was trying to send a UPB command out one serial port after it receives a wireless X10 signal from the WGL800, but for some reason it locks sCU. While Bill is investigating this problem, I added a serial port to my xPL sCU app and moved the PIM there. It was a very smooth transition as I just had to copy the jscript I was developing on sCU to xPL sCU. Now, UPB functionality in the system is controlled by xPL. This adds another layer of communication to get UPB going, but it's transparent to the user and UPB is much faster than X10 so it's not noticeable. When the sCU issue is resolved, I can just copy everything back to the sCU script and be up and running in no time.

Once I got the basic communication established, I was able to work more on integrating UPB. As we are running both X10 and UPB, and sCU and the TimeCommander+ have no UPB support, I had to implement a method to maintain state of non-X10 devices. We already have state mirrored in mySQL and the database is accessible in jscript, sCU and our web interfaces, so this was the logical place to dump UPB device state. After I got all that worked out, I implemented register reads and writes from/to the PIM, UPB device queries and handling of status responses. I also added code to handle status reports from devices when local control turns on the device. I threw in some error handling to retry commands for PIM busy and device NAK conditions. Finally, I coded a function to parse the UPStart export file so that both sCU and xPL sCU have the most updated list of UPB devices. All this achieves the basic level of UPB functionality I initially set out to do. I have some kinks to work out as some things aren't quite working perfectly yet, but when that's done, I'm going to park the UPB stuff for a while and work on other projects. In the future, I want to take a look at other UPB features, like links, etc.

Sunday, June 22, 2008

RFID Battery Mod Follow Up

It's been almost 6 months since I did the battery mod for the RFID receivers. All 3 transmitters are going strong. This is what I was looking for in terms of battery life, especially since the form factor with the battery pack isn't an issue. I did extend the antenna on the receiver some time ago. The range is pretty decent and I'm able to pick up the cars before they reach the driveway.

Thursday, June 19, 2008

UPB Integration

I finally got around to working on integrating UPB with our system. I picked up an HAI Serial UPB PIM and started building support for it into starCOMUltra using its serial port feature. I wrote a lot of miscellaneous functions in the sCU hosted script in order to create the UPB packets. I had to build a couple more tasks to take care of mapping devices to their proper control tasks since we will be running a mixed UPB and X10 environment. There's still further integration needed, such as using the device names as defined in WinEVM, but designating which are UPB. This will make it easy to keep the ASP pages working without too many changes. Then I need to pull in the data from the UPStart file to map the device names to UPB address. So much to do and so many other projects going...

Tuesday, June 17, 2008

Client-Server with HAL

With my xPL issues out of the way, I was able to get to testing my new app. I'm not quite sure what to call it. It started out as a way to make HAL talk via SAPI instead of HAL Voices or its default voices, as I have a 2nd copy of HAL Deluxe. However, I'm not really interested in forking out $30 again for HAL Voices, which are just repackaged AT&T Natural Voices and I already own that.

I finished up a first pass last night & learned more about GUI stuff using VB 2008 Express Edition. Here's a look at the app:



One copy of the app runs on the server, where the HAL master resides. Other copies can run on other machines, or clients. You configure it with the GUI. The client interfaces with the VR on the local machine and sends the recognized phrase, over xPL, to the server copy of this application. The server copy then pushes that into the master HAL copy, which performs whatever action is requested, and sends a TTS response back out over xPL to the client. The client will then play the TTS response using either SAPI or a HAL voice, depending on what's configured.

Here's a short video of it in action. The client is on the left, the master is on the right in an RDP session. The next thing to do will be to figure out how to push the VR phrases from the master HAL to the client so it's aware of all the added phrases in the master.

Monday, June 16, 2008

xPL Network Problem Resolved!

I've been having problems with an xPL install on one of our laptops. It has both ethernet and wireless networking, with one shutting off when the other is active. There is an xPL network setting, specifying which addresses to listen to for xPL messages. (It can be set using xPLHAL.) By default, it is configured to use "ALL" interfaces, but for whatever reason it is not working on my laptop. I changed the Listen To setting to the ethernet IP address (which is what it's connected to the most), and voila - we have xPL working! However, I can't use xPL wirelessly unless I change the Listen To address. Sounds like that'd be a good xPL app to switch that when networking changes - at least until that's fixed with the hub. Still, the xPL hub needs to be restarted when you change network adapters. That's not very convenient.

I have a feeling this will resolve the problem I was having with xPL dying after installing the bluetooth adapter on another machine. The bluetooth adapter also creates a network device and is probably confusing xPL the same way the wireless adapter was.

Thursday, June 12, 2008

xPLAudreyTTS released

I have released the first version of xPLAudreyTTS here.

Dusting off xPLHALi

It's been a while since I worked on xPLHALi. I made just a small change to it, making the xPL portion of the script engine more generic - meaning it can see all xPL messages (other than config and heartbeats) - so there's no need for an external scripting engine. It's more a feature for other users since I already have my xPL/xAP scripting engine. I plan on adding an option to disable this feature if desired. I may add support for xAP messages to the scripting engine and am thinking about a bridge to connect 2 instances of HAL over xPL.

I've finished up the config stuff for xPLAudreyTTS. I have a dropdown box to choose the default voice. I just need to create instructions and zip everything together. The rest of the config will be from a text file. It's a simple interface: