Are you Home? The project takes shape…

Wow.

For a Long Time(tm) I’ve wanted some way to add “occupant awareness” to my fledgling home automation system.  There are some really cool things that you can do if you’ve got the hardware and software: announce missed calls and playback voicemails on your networked phone system; turn on the TV and list the shows that have been recorded; turn on the audio system and start some background mood music.

And so on and so forth.  Personally I’m not sure that I want that level of personalization, but one thing I’d really love to make occupant-aware is the networked surveillance system.

Currently the system has two macro states: Home and  Away.  There are various micro settings that can be configured; which cammies have audio monitoring enabled, the size of the detection field, the sensitivity of the detection field… but for the most part the system will switch between a set of Home micro settings and Away micro settings.  Those macro states also dictate how the system determines which events should trigger an alert.

The system currently changes states based on a hard-coded schedule.  It also considers sunset/sunrise, but again that only serves to change some micro settings.

The problem with a schedule is that we don’t always adhere to it, especially on weekends.  I’m pretty diligent about sending commands from my phone to change the state of the surveillance system, but I can’t expect the wifey to do so as well.

Soooo… I started looking at automated solutions, and those solutions would most certainly involve phones.  For the most part it’s a safe bet that we carry our phones with us when we leave the house so it would be great if we could use the phone locations to determine if we’re Home or Away.

I started off looking at some way to have the phones updated their location to the home system.  This can be done using some custom programming and tying into the GPS coordinates, but GPS is a power hog.  Okay, then we can use the cell towers to get an approximate fix, then turn on GPS when the phone is on the “home” cell tower.  That may work, but it’s still troublesome.

So I went back to Bluetooth.  “Back”, because I had done some reading about a year ago and thought it looked promising but had no clue how to write a solution.  The idea is simple – the phones have Bluetooth turned on 24/7 and a computer on the home network simply polls the Bluetooth radios to see who’s around and who isn’t.  Both myself and the wife leave Bluetooth turned on so that our phones can connect to our cars automatically.

So the hurdle then was to see if I could code a simple program that could detect when a Bluetooth is in range.  Any by George, I could!  It’s  a proof of concept, but it’s remarkably small and simple.  In my testing it takes 2-3 seconds to determine that a device is *not* in range.  I make an attempt to connect to the OBEX Push Service, since pretty much every phone supports this Bluetooth profile.

So the next step will be to install this program on a laptop and see what kind of detection range we can get.

Looking good!

Misc network goings-on

Howdy!

Just a quick update to keep the masses apprised of some developments.  Not that they’re particularly interesting to the masses, and not like there are really any masses to speak of…. but whatever…

So for a Long Time(tm) I’ve been running Wireless-B at home.  Yes, laughable.  Truthfully I never really had a compelling need to opt for the higher throughput of Wireless-G and above.  That, and my Cisco Aironet access point offered some nice SNMP stats that may not have been available in consumer-level AP’s.  Being able to glance at graphs of client associations and wireless throughput turned out to be a great way of making sure that the network was being utilized as intended.

However… I was never comfortable with the fact that wireless isn’t as inherently secure as a wired network.  Best practices dictate that you should segment your wired and wireless networks.  There have been advances in wireless security – WPA, WPA2 – which make this less of a requirement relative to WEP, but the fact is that I didn’t have any WPA-capable hardware and I didn’t have a good way of segmenting my LAN to adequately isolate wireless clients.

Sooo… a couple of things happened.  One, is that I’m now running a Cisco router with DMZ capability.  Two, is that I’ve now got a Cisco Wireless-G router with WPA2 support.  Great – the Wireless-G AP was dropped in in place of the Wireless-B AP and now I’m sporting higher speeds and, more importantly, the latest in wireless security.

Unfortunately I’ve got some older devices that only support Wireless-B and WEP.  Mostly PDAs that are serving as music streaming clients on the Whole Home Audio system.  Those devices would have to run on a different wireless network, as I didn’t want B clients degrading the speed of my G network nor did I want to run a broken security technology on my main network.

And finally, given that WEP can be cracked, I surely didn’t want to bridge the Wireless-B network off of my main LAN, thereby exposing my entire network to a determined hacker – or lucky script kiddie.

So the old Wireless-B AP is hanging off the DMZ port on the router, and a very limited number of ports are allowed to come in from that DMZ.  Perfect – a firewall seperating my trusted wired/wireless-G network from my less-trusted Wireless-B network.  I can also use the Wireless-B network for guest devices, like work laptops, since I’ve granted Internet access to that network.  There’s still MAC authorization and the WEP key to enter, so it’s not a wide-open free-for-all.  And if there was some amount of unusual activity on that network it would be easy enough to spot since – as I said above – I can graph client associations and wireless throughput.

So that’s that.

In actual fact I’ve got three network technologies running: wired, wireless and powerline.  The powerline stuff was put in to support my multifunction printer, which I wanted to be able to put upstairs somewhere where it would be most useful.

Well, powerline worked great for a while, but the past two months or so it’s been unusable.  Why?  Dunno – I don’t recall plugging in any new applianaces that may have introduced noise on my little power grid.  Perhaps the neighbours did, perhaps one of the powerline bridges melted a resistor, no clue.  But it was no longer a viable solution.

So, I recently acquired a Linksys wireless bridge to full in for the powerline adapter’s intended role.  Cool – another Wireless-G client with WPA2.  It works, although it’s running at 2.0Mbps… I’ll play with antenna orientation and what-not at some later date.

So what else now… oh yes, something else that has been misbehaving of late is the Whole Home Audio system itself.  Specifically, it’s Girder’s HTTP server that decides to go off in la-la land for seconds or minutes at a time.  This may not be such an issue if it weren’t for 1) linked lists, and (2) near-realtime zone info in the frontend.

Right – linked lists need working communication from the player (WinAMP) to the main HTTP RPC instance on the home server, to the RPC calls off the home audio HTTP instance, then back to the HTTP server off Girder.  This is the case because, in essence, the player tells the system that it’s done playing a track and the system tells the player to play the next track – which is in contrast to loading a list into the player and telling it to play the whole thing (ie, the list is not linked to the system).

When the Girder HTTP server fails, we have no way of telling Girder to have the player load/play the next track.  So playback stops.  And because this is all HTTP based, the requests eventually time out and playback never resumes.

Now, I spent some time and coded some ways to recover from this situation gracefully (ie, handling the timeout and reporting a problem to the user or logging to a file), but restarting playback requires human intervention – for a number of practical and technical reasons that I won’t go into right now.  I even got to ditch an ActiveX object I was using to do HTTP requests and replaced it instead with Microsoft’s own XMLHttpRequest object.  It seems more robust, so that’s a plus.

But ultimately the problem is with Girder.  If an HTTP server fails, it’s a problem, plain and simple.

I entertained upgrading to Girder 5 (from Girder 4), going so far as to download the trial and run it to be sure my LUA code and Girder events would still work – and they seem to – but in the midst of being uncomfortable with spending money to get nothing more than stability I happened to stumble across the fact that my version of Girder was 4.0.1 while the last release in the version 4 train was 4.0.15.  So I grabbed that, cleaned up some LUA that didn’t want to work anymore due to semantics (could that have been a contributing factor to the problems I was experiencing?!?) and put 4.0.15 to work.

So far it’s been rock solid, knock on wood (yes, I just knocked on my desk).

Of note is that I accidentally left my work computer connected to the home network last night, sitting on a zone page – meaning it was querying Girder from closing yesterday to opening today.  Normally that would send Girder’s HTTP server into crazy land, but it’s still functioning normally today.

So I’ll keep my virtual fingers crossed.  Another plus in all this is that my Win32 service is now running grunt.exe vs. girder.exe – grunt being the Girder RUNTime that Promixis included in the distribution sometime after 4.0.1, which does all the cool Girder stuff without launching a UI.  Perfect, since a Win32 service doesn’t really need (or want) a UI.

So that’s it for this update.  Next time I’ll talk about a cool “app” I’m running on my phone to track my quality of sleep.

Oh Wendy’s…

It used to be that I’d have a Wendy’s burger fairly regularly. Big Bacon Classic… ummmm…

Which isn’t to say that I believed Wendy’s burgers to be fine examples of what a burger should be; no, in that regard, Wendy’s sits alongside McDonald’s as a place where you go because you’re looking for a particular taste. McDonald’s burgers have a distinctly “McDonald’s” taste, while Wendy’s burgers have a distinctly “Wendy’s” taste.

And I guess I just had a jones for Wendy’s burgers.

But that was another lifetime. In this lifetime I’m married and my wife tries her best to make my diet a healthy one. Even my subs, which used to be of the pizza or assorted variety, are now almost strictly veggie.

Now and then the old cravings come back. And while I Done Good(tm) recently and ordered a Wendy’s salad during a lunch outing with a friend, for whatever reason I decided to indulge two days ago by ingesting a Big Bacon Classic – a combo, “biggie sized” of course, just like the good old days.

And just like some things are meant to be left in the past, so too will I now relegate Wendy’s burgers to a time when I just Didn’t Know Any Better(tm). Once upon a time I used to scarf Burger King bugers, and then my sister and I got all nostalgic and decided to give them another go for Old Time’s Sake.

BIG mistake.

And two days later I’m still regretting that Wendy’s burger. I guess my body got wise and moved on from that trash before my brain did. Lesson learned.

Can’t wait for SPB

It used to be that I used SPB’s PocketPlus and PhoneSuite products on my HTC TyTN to provide some useful functionality.  Most of that – including finger/kinetic scrolling – is provided native in the WinMo 6.5 build I have running on the Touch Pro.  Which is one reason why I went with WinMo 6.5.

But some features of those programs were sorely missed.  Namely, timed profiles in PhoneSuite (the ability for the phone to automatically switch back to the Normal profile from, say, Silent or Vibrate after some time).  PocketPlus gave me an enhanced File dialog.

For whatever reason SPB is dragging their feet on supporting 6.5 in these two apps.  So screw it.

While I still don’t have an enhanced File dialog, I now have timed profiles.  I’m running code that I designed, but it works.

Quickly then – I’ve got a C program that watches certain registry entries waiting for them to change.  One of those entries – HKCU/ControlPanel/ShellOverrides/Mode – reliably indicates whether the phone ringer is Normal, Silent or Vibrate.  So the C program sits on a notification waiting for this key to change.  When it does, the program fires a Mortscript which does Interesting Things(tm) based on the registry key value – and by extension, the ringer mode we’re in.

If the mode is != Normal, the script sets up a notification queue entry to run x minutes later which will put the mode back to Normal.  We rely on a 3rd-party free application to do the actual mode switching.

Currently the script is hard-coded for 5 minutes, but it’ll be trivial to put a dialog in there so that I can select how long I want the delay to be.

That’s one.

Two… using the same C program, we watch ANOTHER key to see the state of the Bluetooth radio.  I do this for two reasons.

In the early days of owning this Touch Pro, Bluetooth stayed on when I told it stay on and never turned off unless I told it to turn off.  So I could reasonably expect that I when I got into my car, the phone would pair with the car and Life would be Good.

Lately, for whatever reason, Bluetooth is being naughty and turning itself off for no reason.

So I figured, let’s watch the registry to see when the Bluetooth state changes.  If it turns off, we’ll turn it back on.  Concept is simple: C program watches the key, fires a Mortscript when the key changes, Mortscript looks at the key and calls a 3rd-party freeware program to flick Bluetooth back on if required.

But hear this… one thing I like from Shelly’s phone (and most phones in fact) that mine is missing is the ability to turn Bluetooth to “Discoverable” mode and have it automatically switch back to normal (“Connectable”) mode after some time. The idea here is that you don’t want to walk around with your phone in Discoverable mode if you’re not pairing any new devices.  So using the same approach as above with the ringer, the script also looks for Discoverable mode and will setup a notification queue entry to kill that mode after 2 minutes.

Done and done.

Of inventions, and other ideas…

I’m quite upset.

I had a rather cool idea for a patentable invention, only to find that somebody beat me to the punch by a little under a year.  Although, I think there’s one element of my idea that’s not in their (quite exhaustive) patent application.

Two, is that anybody who’s interested in cleaning a microwave interior, where said interior has stubborn caked-on food waste, only need boil a bowlful of water and place that bowl within the microwave.  The hot water will rapidly evaporate and condense on the interior walls of the microwave, thereby soaking the food waste and making it much easier to clean out.   This cleaning can be done within 5 minutes or so of placing the bowl of water within the microwave.

This is a known trick apparently; I didn’t know that until I looked it up while writing this post.

Google Maps, and other PDA/smartphone-ish ramblings

My goodness, talk about an eventful past few weeks in technology-and-mechanisms land.

I wasted about 4-5 hours of my life on the phone with my wife’s cellphone carrier, trying to clear the fog of confusion and hold them to their word about a new plan… I spent some time setting up her new cellphone, which is part and parcel with the discussions above… I acquired a “new” (used) cellie to replace/compliment my TyTN… my internet server has been having unknown problems of a service-interruption nature for the past two weeks… my wife’s car is back to its old tricks (ie, being frustratingly unreliable)… my car soaked its passenger footwell and sprung a mysterious leak in a tire…

…and I think that’s it.

So what does all of that have to do with the subject of this post?  With the exception of my “new” cellphone and Shelly’s new cellphone – not much, but I haven’t posted since October 28th so I thought I’d bring you up to speed (and have you share my pain…)

Okay, so Google Maps.  Well, first off, is that I chose a used HTC “Fuze” (the AT&T version of the HTC Touch Pro) to replace my TyTN.  Ah, the TyTN… it’s come a long way since I first unboxed it back in ’07 and saw its gleaming, Rogers-infested workings.  Over time it’s been steadily upgraded with various software goodies to keep it relevant:

– interface: went from Today screen customizations and ended up with a new shell (SPB Mobile Shell), although at one point I thought the idea of a replacement shell was sacrilege

– web browser: from Opera (which never worked reliably due to memory constraints) to Opera Mini (which wasn’t a “true” experience and not suited for online banking) to SkyFire (also not a “true” expereince and not suited for online banking, but it wasn’t Java and it supported Flash)

– finger-friendliness: courtesy of native support in some apps, and psuedo-global support by SPB Pocket Plus and fTouchSL; as well as some registry tweaks to increasae the font size of  system-wide menus

I’m sure there’s more, but that’ s the gist of it.

But through all of these additions, one realm I could never improve on was the hardware itself.  Limited processing power and limited memory were becoming hindrances.  The recessed screen was on a divergent path with the increased emphasis on finger-friendliness.  And finally, the battery was rapidly approaching the upper limit of its useful age.

Now, some of these issues could have probably been resolved by flashing a new ROM.  But as the only Windows Mobile 5+ device in my stable, bricking the device was not an option.  Nor did I want to flash a new ROM and find that the hardware limitations were even more pronounced – or find some incompatibility with my carrier – and then have no way to go back to the known-working ROM.

So the decision was made to look for another device.  At least then I’d have two WinMo 5+ devices, so that one could serve as a backup in case Something Bad(tm) happened.  I wasn’t entirely convinced that my future would lie in Windows Mobile, but without my carrier offering any appealing subsidized smartphones I decided to go the pre-owned route for another couple of years.

The Touch Pro is currently one generation behind the latest and greatest Touch Pro 2.  It’s got ample memory, a sufficiently-fast processor, and a multitude of available ROM images.  The screen is flush, its got an internal GPS, accelerometer, VGA screen, but still has a 5-way dpad.  So that’s what I went for.

And while the unit I ended up could have been better cared for (scratches galore), I decided that was a small price to pay for such a huge jump in software and hardware revisions (2.5 and 2 generations, respectively).

Okay, great… so, what about Google Maps?

Yes, GMaps – it should be obvious, that with the Fuze’s GPS I now have pinpoint accuracy in this awesome, *free* application.  And while I’m still in the process of getting that GPS to fix quickly (and reliably, although I think I made a big step forward in turning *off* AGPS), I must say that GMaps has twice proved its usefulness in the last 24 hours.

Something I didn’t know, is that GMaps now supports live traffic info in Canada.  Apparently this has been around for some time, but since I’ve got GPS in the car and had no GPS in my phone before, it was rare that I would fire up GMaps while in any car.  The traffic info showed me that a route was flowing smoothly yesterday for the evening commute – which I wouldn’t have believed otherwise since that route is never clear that time of day – and it showed me that the same route should be avoided like the plague this morning, although the undisputed king of radio traffic reports had nothing to say on the matter.

In both cases the info was spot on.

So that’s cool.  I’m trying to convince the wifey to get a Google account so we can use Latitude.  She’s adverse to that sort of thing.  I’m not looking to track her whereabouts – especially since I wouldn’t recommend that she leave GPS on 24/7 and run GMaps during that time as well – but I think it would be useful in those moments where we’re out and/or apart and there’s some requirement to know where the other is or that the other is okay (because the other never hears their phone ring……… 🙂

But mostly I just want to see the technology in action.  I think it’s cool that Shelly now has a mobile device that’s as powerful as mine, with a mobile plan that includes a healthy chunk of data without breaking the bank.  For a while, her phone was even more powerful and feature-packed than mine.  Now we’re on par, but the point is that we can both do the same things – get info online, navigate with GPS, use Bluetooth – so I can get her up to speed on this stuff whenever she’s ready.

So anyhoo… more on this stuff later.  Particularly my woes with my Internet server at home.  Ugh… talk about a pain in the @ss, especially when I’ve got like -ve free time these days what with an infant son and a car-less wife.  Compounding matters is that that server is instrumental in receiving work-related alerts on my phone, so… stress all around.

I’m a Starbucks yuppie too!

This weekend I had my very first, multi-hour experience in a Starbucks.

This may seem like a non-event for many of you, but I’m not prone to holing up  in a Starbucks with a latte in one hand and bestseller novel in the other.

Not that I have anything against the notion – I just haven’t done it.

Anyhow, my experience involved a “premium” Hot Chocolate, a netbook, and a 3G cellphone.  And all in all, it was pleasant… ish.  The particular Starbucks I was at was rather small, and the angle of the sun at that time of day was such that it made seeing my netbook screen a little difficult at times.  That, and I was situated right beside a high traffic area.

But I accomplished what I needed to accomplish online.  No, I wasn’t there to soak in the ambience – I had a task to perform, and I’m happy to say that it went off suprisingly well.  I’ll attribute that to my cellphone 3G service vs. Starbuck’s WIFI service, which I have no interest in partaking of given my own mobile capabilities.

I guess the only downside was that my jacket smelled like a barrista for a good 2, 3 days afterwards.  Oh well, such is the like of a Starbucks yuppie I guess…?

No more IIS?

In keeping with the desire to run free (read: not be tied down to a particular technology or implementation) I recently decided that being forced to run IIS5 on Windows 2000 Server was anything but a Good Thing(tm).

I don’t see why Win2K users can’t be privy to the potential goodness that comes with IIS6+.

So, IIS be gone.

feather

Apache, come hither!

Yes, I’m running Apache on this here server, and while IIS5 is still toiling away, it’s only to serve the Piper’s Pages website by way of a reverse proxy.  Almost immediately after installing Apache, WordPress breathed a sigh and relief and showed its appreciation by enabling config-free permalinks and working plugins.

The sweet smell of freedom, indeed!

Save the cheerleader? Or, cheerleader saves?

I have no idea where Hereos is going with the Claire character. As it stands now she’s not doing anything particularly “heroic”.

Now, I do recall an earlier episode where HRG was gruesomly shot through the eye and subsequently died – only to be saved by some concoction involving Claire’s blood. Sooooo… why isn’t she out there saving the masses with her bro and good ole, home-grown Clairelixer?

Seems so obvious and yet here we are watching Claire’s painful interaction with an awkward college chick of questionable motives, versus something truly worthy of the series title.

What a waste.

What’s this? No updates?

Something (somebody…?) has been keeping me busy. Sorry!

A couple of interesting developments, all of a techie nature.

One… is that I got hit by a drive-by virus infection at work the other day. Imagine that – me, getting a computer virus! I became aware of its presense almost immediately, as I tend to do a lot of work online and I was suddenly unable to do anything. Existing connections – like the VPN to my home network – continued to work fine, but I couldn’t visit new sites.

The culprit was some trojan or whatever that was opening untold numbers of TCP connections in an attempt to send email. And while I suppose that this is a good, self-serving way to propagate, it’s not terribly inconspicuous. However, it took an entire day to get the thing removed; the eventual victor was a tool named ComboFix.

But that’s neither here nor there.  The point of interest is that Firefox has been Behaving Badly(tm) since then, using copious amounts of CPU every time it changes pages.  I suspect it’s been damaged in some way – or maybe it’s trying to phone home somewhere – but suffice it to say that it’s now maddeningly frustrating to use.  I can’t see any phone-home connections, but that hasn’t stopped 2.x, 3.0 and 3.5 from all being naughty in this regard.

chrome-205_noshadowSo I’ve been using Google Chrome for my browsing needs.  Again, that’s neither here nor there.  The real message… which is quite selfish really… is that I’ve been using Chrome with the Whole Home Audio web interface and it’s quite a slick experience.  Which is to say – in a very, very, very long-winded way – that I’ve come a long way from Firefox-dependence with respect to said interface.

I still don’t have workable drag-drop support, and its absence is notable during some playlist maintenance operations.  But with this one exception it’s all slick as snot.

And while I’m on the topic of the Whole Home Audio interface… I made a small discovery the other day with IIS’ setup that was potentially causing some consternation.  The interface will show you what’s playing on a particular zone, and the page which shows this information is very dynamic; a draggable, self-updating time bar; a self-updating, dynamic tracklist; a dynamic track position time counter, and some other goodies.

Anyhoo, this all is made possible with XHR objects, all of which make their requests back to IIS.  IIS normally logs every HTTP request, but when you’re making one call every second it gets a little silly.  (On a side note, I may look into using a keepalive connection to do these updates; I don’t know if anybody else does this, but it’s an idea that could reduce the overhead of handling all of these sequential async requests)  Sooooo… the XHR objects would make their requests to a virtual directory which was told to not log any requests.  Great.

Except that, for whatever reason, I had configured this virtual directory with its own “application”.  I have no idea why I would have done this if the only thing I was trying to accomplish was to keep logging in check.  So that config has been removed, and since then the XHR requests have worked as expected.

What else?  Oh yes.

lastfm

The collection is constantly growing, especially since I made a ton of room on my disk by moving some movies to my netbook.  So as any music listener knows, it’s nice to discover new music.  Having a kick-@ss way of navigating my existing collection is great, but what about discovering similar music or artists?

Last.fm is great for this kind of thing.  And even greater is the API, which allows my music application to query their database.  Today I’ve got a button that can retrieve similar artists and even populate a playlist with their albums.  Using that I’ve added a considerable number of new artists to the stable.  The next step, I think, is to make use of their “scrobbling” feature – allowing my application to update a last.fm user profile with tracks played, so that last.fm can make better recommendations.

This comes dangerously close to the “user” feature that the wifey nixed, but I think I can work around it; I’ll make a playlist “property” which is associated with a last.fm profile, and if you play from a linked playlist then my app will scrobble to the associated last.fm user profile.

So I guess those are the biggies, for now.  Some other small stuff, nothing blogworthy though.  So that’s it fer now.