Ambient Orb Setup

This 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:

  1. 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.

  2. 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.