Ambient Orb Setup
Posted: June 1, 2009 Filed under: Hardware, Software Leave a commentThis page describes the process of hooking an Ambient Orb up to show a real-time information using the Ambient Hardware Developer’s Kit.
Previous Work
The Orb provides a great, at-a-glance indication of build status for a continuously integrated software project. The subjects of Continuous Integration and its benefits are discussed in a number of other places, so I won’t cover them here. Likewise, the use of an Orb using the Ambient Web API is covered admirably by Michael Swanson, so you can read that there.
Problems
The two problems I found were:
-
Update lag
The Ambient pager network does not change the color of an orb for 10 – 30 minutes. I can break a build in seconds. An ideal system would indicate the status of software builds in real time with no lag.
-
Integration of multiple software projects
I work in a shop that produces a lot of different projects at a time. We currently have eleven builds managed by CruiseControl.NET. Using NAnt events as described elsewhere did not provide an easy way to measure how many builds were successful moment-by-moment.
Solution
Lucky for me, the first problem can be solved with hardware. As a software guy, I love when that happens. Ambient produces a Hardware Developer’s Kit. You put an Orb on one end and a serial port on the other, and you’re in business: you can update the orb instantly to any color you like.
Unfortunately, the cable is only 3 feet long, making the orb’s location a bit constrained. This was easily solved with a cheap 50-foot serial cable. As a bonus, the $45 (with shipping) HDK frees me from the $80/year subscription to Ambient’s developer channel, so the hardware investment will pay for itself within the first year.
To have the Orb reflect the status of multiple software projects all at once, I polled the CruiseControl.NET server. For now, I’m using a screen scrape of the CruiseControl dashboard. With a little gumption, I could probably poll the same port that CCTray uses.
Keeping in mind that I might not always use CruiseControl as my CI solution, and that I might change the way I poll it for build status, I thought it would be nice to keep those changes insulated from the core orb updating service.
I’m a native speaker of Perl, so that’s the language all of this is in. I used Win32::Daemon by Dave Roth to create a Windows service in Perl. The service talks on the serial port using Bill Birthisel’s Win32::SerialPort package and updates the colors using my Win32::AmbientOrb package.
How to Do It Yourself
This Walkthrough describes how to set up the whole system.
Lazy Part 3
Posted: March 31, 2006 Filed under: Build, Hardware, Software Leave a commentPart 3: Talking to the Computer
For my next trick, I’ll need an assistant: the USB-UIRT. This is that gadget that’s going to receive infrared signals from the remote. I’ll also need the Girder software to learn the codes my remote is sending and actually do something with them. For now, I’m just going to be satisfied with proving that my PC is hearing what the remote is saying. Making the software do anything about it is a matter for another day.
I’ll only be needing a handful of buttons here. They’re all standard play controls and appear on just about any remote.
- Power (to open or bring focus to the application)
- Play/Pause
- Stop
- Previous Track
- Next Track
- Shuffle
- Repeat
Hardware Installation
Dude. That couldn’t have gone much easier. Plug in the UIRT and the Plug and Play dialog finds it. You download the drivers from the USBUIRT site and tell the PnP wizard where to find them. Done.
Software Installation
This was also a cakewalk. Come to think of it, it was much easier than a cakewalk. I’ve participated in several of those and never walked away with a thing. Here there is no cake, but at least I have something to show for my effort.
Telling Girder About It
Go to File -> Settings, select “Plug-in settings,” and check the box next to “USB-UIRT.” Restart Girder and you’re off & running.

Setting Up Your Remote
Go to Tools -> Add Remote Wizard. Click Next, name the remote, then start programming. It asks you to press any button to make sure it detects a remote at all, then it asks you to press each button that you want to use on the remote. After you finish this, Girder will be able to get signals from your remote. 
All of this only took me an hour, and most of that was poking around trying to figure out what else Girder could be used for. I went ahead and picked buttons to use for song rating too. If everything goes smooth, I’ll not only be able to skip sucky tracks, but ban them for good measure. Next, I’m going to make Girder listen for the signals from my remote.
Budget update: $143.44, 8 hours.
Lazy Part 2
Posted: March 27, 2006 Filed under: Build, Hardware, Software Leave a commentPart 2: Programming the Remote
I got the remote control in the mail today. It’s a beautiful, silver OneForAll 8910.
Just to get things warmed up, I found the code for my TV and entered it. I got that up and running right away. Early win. Nice.
Uncharted Territory
I tried out the IR.exe and Remote Master software. It turns out there’s one more handy piece of software, IrToWav. I’ll explain that in a minute.
In brief, Remote Master creates the key mapping for the remote (which button should send what signal), IR.exe converts that map to a binary file the remote can understand, and IrToWav generates a .wav file that can load the upgrade to the remote.
How slick is that? The remote has a modem in it for one-way uploads of information. If you call OneForAll technical support, they can have you hold your remote up to the phone and load new devices and protocols. If you use IrToWav, you can do the same thing, but with a custom program you created. You don’t even need the JP-1 cable to write to this remote.
There’s a great tutorial on all of this on the hifi-remote site, and another good one here. The hifi-remote forums are also a gold mine of great information. If you just take two hours to read the sticky posts in the beginner forums and search for your particular remote, you’ll be a beginner no longer.
To control the music player on my PC, I just selected a common universal code for a CD player (for some reason, code 0157 is used for 16 different CD players in my remote’s catalog, but not for mine). I figure choosing a common code means there’s a low probability that its carrier signal will be out of range for my IR receiver or some other nonsense. I plan to use these play controls to manipulate the Music Engine on my screen. I must say that this step of the process went smoother than I could have imagined. The remote is already controlling my whole home entertainment system (except PC), and I had a super-easy graphical interface to remap all of the buttons.
I didn’t need the $14 JP-1 Cable to do this, but since I already ordered it, I’m adding it to the budget. I’ll use it later when I’m in a nerdy mood.
Budget update: $39.84, 7 hours

