February 5. 20:00 -  Imagine the worst nose itch ever. Then imagine arms that are too short to scratch your nose. #enjoy

Home Automation History Month

May 22, 2011 16:06 by docbliny

It’s May which equates to Home Automation month. OK, I just made that up, but it is somewhat fitting since Google announced Android@Home this month, and the last version of VoiceShell for the Commodore Amiga I published is dated May 2nd, 1996.

VoiceShell

VoiceShell was my speech recognition application that could be trained to understand up to 60 different phrases and run a different command for each. With the magic of ARexx, a scripting language that allowed communication between applications, I was able to send commands to other applications. It also allowed me to switch vocabularies to both extend the available number of commands, and to maximize the recognition accuracy (today I can simply construct a hierarchy of commands using SRGS XML files).

Here’s the description from the Hyperlinked documentation:

WHAT DOES IT DO?

This program is a 'replacement' for VCLI. It doesn't have the fancy graphics etc. but it seems to eat less CPU time and should be faster overall. It also has some extra options.

"So what is VCLI?" I hear you ask. VCLI is a program by Richard Horne that uses his voice.library to recognize speech. With VCLI and VoiceShell you can start programs by saying the program's name. You can teach VoiceShell 60 (VCLI allows 48) different words. You also have the possibility to load a new set of words, thus giving limitless possibilities. The more words you teach, the less accurate the result will be. Thus having more than one project might be a good idea. All you have to do to get started is to set the correct preferences, teach some words, set the commands and away you go!

Of course, like everything I wrote back then, this was written using assembly language for the Motorola 68000 series CPU. The application had an installation utility, hyperlinked documentation, support for startup arguments for both Command Line Interface (CLI) and Workbench icons, ARexx scripting interface, and hotkey support. I know it got published in at least one Amiga magazine on their floppy disk (I believe in the U.K., but I’d need to dig up the copy they sent me) and was available on the Internet as early as 1993. I had at least 26 releases with incremental feature additions and bug fixes.

I was contacted by Alex C. last year to get a copy of the source code and there is a thread on AmigaWorld.net discussing adapting it for the current crop of emulators and Amiga OS versions. It’s amazing how code will live on!

CompleteControl

Of course, VoiceShell was only part of the picture. CompleteControl was the software part of the automation suite that controlled devices via relays. It comprised of a set of ARexx scripts, sounds, images, and an application that would run on a MS-DOS PC. These applications, along with an Input/Output board and a custom power strip, would allow me to turn on and off devices such as lamps. I even rigged a relay into my bedroom light switch, so that I could turn it on and off.

It was a total hackfest with a lot of moving pieces: Custom PCBs, two computers (an Amiga and a PC), sound sampler dongle, a custom power strip, custom DB9 cables, an I/O card, voice recognition, custom sound samples for responses, and hardware control software. But hey, it actually worked!

Present Day

There have been many iterations on the same basic premise over the years. I’ve cobbled together various X10 and ZWave solutions with PCs using custom and off-the-shelf software over the years. The current project is named “Remoat” and it’s in a prototype stage controlling lights in the whole house along with supporting media playback. It’s a labor of love that has had to take the backseat over the past several years, but the goal is to evolve it further and make available online.

Screenshots

Screenshot of the VoiceShell Application

Screenshot of the VoiceShell application

VoiceShell Hyperlinked Documentation

VoiceShell hyperlinked documentation

PCB Board Image Opened In DeluxePaint

PCB Board Image Opened In DeluxePaint


System.Speech.SpeechRecognizer works, SpeechRecognitionEngine doesn’t

April 24, 2011 08:53 by docbliny

I believe I've found an issue with the managed speech recognition libraries. The short problem description is that I am unable to use SRGS/.grxml files that contain "ruleref" elements pointing to other files with System.Speech.Recognition.SpeechRecognitionEngine (InProc). They load fine when using SpeechRecognizer.

After debugging (and finally making a custom build of System.Speech.dll), I've narrowed down on the issue. When you use an InProc recognizer, RecognizerBase.cs sets a custom grammar loader (ISpGrammarResourceLoader). Unfortunately, the RecognizerBase.LoadResource method that is used will receive a null value for the last argument ("pbstrRedirectUrl"), and cause a null exception when it tries to do a split on the null string. This also explains why SpeechRecognizer does not have any issues with the same files.

The same issue happens with both 3.5 and 4.0 versions of the Framework.

Problem

I can’t get a speech recognition project I started in 2008 to correctly load the grammar definition files (.grxml / SRGS) in my current environment (Windows 7 64-bit) with SpeechRecognitionEngine.

STATUS

Well, turns out that the shared SpeechRecognizer will correctly load the exact same GRXML files with external ruleref definitions. After hunting through the .NET source code, the culprit might be in the RecognizerBase.cs method named LoadSapiGrammarFromCfg(). It sets a custom grammar loader for SAPI only when using an InProc recognizer (which SpeechRecognitionEngine is). The comments even state “The rulerefs will be resolved locally.”

So, I have the following options:

  • Continue debugging .NET to see if the behavior has changed, and I’m simply missing some element in the XML file. This doesn’t seem likely, as ProcMonitor clearly states that only the first file even gets a open/read attempt. I’ve tried setting the base URI, used absolute paths, did a quick attempt at loading from a URL. The problem is made worse by the fact that I can’t step through the .NET code in either Visual Studio 2008 or 2010. Fixing that will take its own time… I could try using the .NET Framework code (fingers crossed all the required files are available) directly.
  • Switch to using SpeechRecognizer. I don’t want this, because I’d end up with a broader dictionary which will reduce accuracy.
  • Merge my GRXML files. Yuck. There’s a reason for ruleref support in the files. In addition, the app is meant to be extensible, and having to merge files just makes things harder for the developer and end users.
  • Go down the path of using SpeechLib/SAPI, but looking at the amount of code in the Framework, this seems totally redundant.

Error Info

  • SapiErrorInvalidImport A rule reference to an imported grammar cannot be resolved.
  • SAPIErrorCodes.SPERR_INVALID_IMPORT
  • 0x80045024
  • -2147200988

Hacking the Vista ICM e-mail notifications

February 18, 2010 20:07 by docbliny

Another great post by our guest blogger Richard Perlman:

I hacked at the VistaICM email process and here is what I found:

Part 1: The information for the email is sent, via HTTP, to outgoing.in2myhome.com. So, If you are running a local DNS server, you can enter a record for that host/domain and resolve it to some other HTTP server.

Part 2: The information is sent as a GET request. I.e. It’s ALL in the URL. Really simple (and insecure). For example, here is an “Armed” notification:
GET /email.aspx?address=alarm%40foo.com&subject=Security+Alert&message=System+Armed&mac=00%3A0e%3A70%3A00%3A35%3A7d&time=02-16-2010+01%3A03%3A33+PM

So, all that would need to be done is to write a simple cgi-bin script to handle requests for /email.aspx to parse the GET request and create an email or do whatever you wanted.

Richard


Vista ICM 2.8 Information

February 18, 2010 20:00 by docbliny

I got a great email from Richard Perlman containing detailed information about the latest ICM update 2.8. Since people tend to end up here for info on the ICM he wanted to share it with the rest of you. Thanks Richard!

Many changes in the Vista ICM, some significant:

Most notable: Honeywell has discontinued the Vista ICM. It seems there was some disagreement with in2net over fees. Since in2net seems to have designed most of the internal code, it doesn't look good for further support. I have emailed them, but they don't reply. The immediate result is that email is effectively dead, unless you pay a fee. If you are running a DNS service on your network it should be simple to "deflect" the HTML connection used by the ICM to pass email messages to in2net to a local web server. Then you'd just have to figure out how they pack the email message into the HTML content.

Other things as of release 2.8:

  1. There is no more backup (i.e. download). You can still upload, but "download" is pretty much limited to cat/copy/paste.
  2. A lot of the web pages, like the PDA page, are now configured differently, not as easy to change.
  3. I found the same TCP data that was on port 50003 on port 50001 too and I also found an in2networks debug facility of port 50501. But, I can't make any sense of it.

On the other hand, using the TCP interface I have been able to build a fairly simple state engine in Perl. This maintains a state table for each zone, as well as reporting the panel state. The script was customized to Interface to the Indigo home automation system running on a Mac. But, it could be easily modified to report to other services. Take a look at:

http://www.perceptiveautomation.com/userforum/viewtopic.php?f=9&t=5444&p=32308&hilit=ademco#p32308

If there is sufficient interest maybe we can set up a small mail-list to share ideas and discoveries, etc.

Richard Perlman


Tip of the day: Save some power on Windows Home Server

February 22, 2009 16:14 by docbliny

Window Home Server is built on Windows Server 2003 and thus doesn’t have any power savings turned on by default. While there are some add-ins to put WHS to sleep/hibernate, you should go into the Power Options and turn on the “Server Balanced Processor and Performance” scheme to at least minimize CPU power consumption.

  1. Make a Remote Desktop connection to your WHS machine.
  2. Click the Start button.
  3. Click Control Panel, and then click Power Options.
  4. On the Power Schemes tab, select Server Balanced Processor Power and Performance.
  5. Consider changing the settings for Turn off hard disks, too.
  6. Click OK.

WHSPowerSave


Converting D-Link D-ViewCam .DVF files to .AVI

February 14, 2009 14:10 by docbliny

I ordered another HDHomeRun Thursday and was expecting it to arrive Friday. Well, after having some friends over for dinner I got around to checking the UPS order tracking and it stated “Delivered – Front door”. Well, I certainly couldn’t find it. So I started D-ViewCam to check the security footage from our front door and guess what? No UPS guy had ever walked past our front door Friday.

The software that comes with certain D-Link web cameras is pretty awful. It also creates proprietary files (MJPEG/MPEG4?) along with additional information such as motion detection details. This was the first time I wanted to actually get the video out in a format that I could actually forward on if needed which I didn’t end up needing. Amazon had placed a replacement order with free next day shipping about two hours after I emailed customer support. Of course, this didn't really help on a Friday (OK, OK… Saturday) past midnight.

Turns out that D-ViewCam doesn’t work all that well on a Windows Home Server, at least through Remote Desktop. I was able to set the start and end cue points only once for an export. Other times they were disabled making it impossible to actually export anything. And the one time I was able to export, I ended up with a zero length file.

Long story short (I’ll leave out having to install VS2008 in a virtual machine since D-ViewCam doesn’t work under 64-bit Vista either), a few hours later I had a custom utility that will take a .DVF file and convert it into an .AVI. Unfortunately, I have to use the libraries from D-ViewCam to do this, which means you’ll need to have that installed. In addition, the format (compression) doesn’t seem to work (It doesn’t have any effect. The same goes for exporting via D-ViewCam).

The story also has a happy ending, the person who received the package a few streets down was kind enough to bring it over this morning, so now I have 4 tuners in Vista MCE, but getting that to work is another post altogether.

Dvr Convert Screenshot

The utility is a quick hack. It will only convert the whole file, and this will take several hours. It doesn’t do batches, and you can’t cancel it (unless you kill the app with Task Manager). I didn’t want to spend the time writing these unless someone actually asks for these features.

It’s available on the downloads page. Just extract and run DvrConvert.exe. Let me know if you want the source.

I’ve only tested with D-ViewCam 2.03 (available here) which is listed to work with the following cameras:

DCS-900
DCS-900W
DCS-G900
DCS-910
DCS-920
DCS-950
DCS-950G
DCS-1110
DCS-2000
DCS-2100
DCS-2100+
DCS-2100G
DCS-2120
DCS-3110
DCS-3220
DCS-3220G
DCS-3410
DCS-3415
DCS-3420
DCS-5220
DCS-5300
DCS-5300G
DCS-5300W
DCS-5610
DCS-6620
DCS-6620G
DCS-6110


Getting mControl build 2.1.3257.3 working on 64-bit Vista

January 16, 2009 18:01 by docbliny

The current latest beta build of mControl doesn’t work under Vista. I tracked the issue down to the DLLS being compiled for 32-bit, but the main application for “anycpu”.

If you have the .NET Framework SDK, you can create a workaround as follows:

  1. Open an administrative command prompt. The Visual Studio 2008 command prompt is a good candidate, since it has the required paths pointing to "corflags.exe" (It’s in C:\Program Files\Microsoft SDKs\Windows\v6.1\Bin or similar).
  2. Go to the mControl binary folder:
    CD C:\Program Files (x86)\Embedded Automation\mControl\bin
  3. Turn on the 32-bit flag for mControlEditorForm.exe:
    corflags mControlEditorForm.exe /32bit+ /force

UPDATE: This issue has been fixed in build 2.1.3306.3


Adding a custom iPhone/iPod Touch icon for mControl

October 17, 2008 22:54 by docbliny

Both the iPhone and iPod Touch let you add bookmarks directly to your device's home screen. Adding a bookmark to mControl's mobile.aspx page makes it quicker to access your home automation, and for that reason I tend to walk around with my phone in my pocket even at home.

I also added a custom icon by creating a 57x57 pixel PNG file named "apple-touch-icon.png" and copying it to the WHS machine's C:\Inetpub\wwwroot folder. The "mHome_ThumbVista.png" file in the mControl directory is a good starting point for an image, though you should make it square without the glassy effect for best results.

For more details on creating icons for sites, do a web search for "apple-touch-icon.png" and you should get all the information you need.

Fake home screen


Mi Casa Verde Vera all-in-one home automation solution

October 17, 2008 16:09 by docbliny

Thanks to Engadget I'm out of another $150. They had an article about MiCasaVerde's Vera device and I just placed my order. In short it's a box that looks like a wireless router/access point (and actually works as one), but contains home automation software and support for Z-Wave (aren't I glad I've got all the switches in the house replaced with those?). Their goal is to make home automation dead simple, but for me personally (once again) the key is that it's an open platform with support for extending and hacking the device.

There's an enthusiast special going on until the end of the month (October 31, 2008) and you can get the device for $149 (plus shipping) instead of the retail $299. Details about this and the device itself are available on their wiki: http://wiki.micasaverde.com/index.php/Invitation_To_Enthusiasts

In addition to having a device that consumes 6W instead of 90+W for a PC, one other great thing I see compared to other home automation solutions is the Z-Wave adapter that comes with the device. You can unplug it from the Vera's USB port and walk around the house to register Z-Wave devices. Compare this to my experience of having to buy a handheld Z-Wave controller to walk around with, and once I was done, going into the garage, pressing a bunch of buttons on the remote (where's that manual again for the correct combination so I don't erase everything?) and running to my PC to start the transfer to the computer before the transfer times out.

Vera Pictures