The lamp which I used was a "USB Glitter Light" available at low cost from your favourite online auction site, local market or pound store. Unfortunately programmatic control of this type of lamp is not possible in the as-purchased state, when plugged in it is always on.
Therefore I designed a simple circuit around an FTDI MM232R module and some MOSFET drivers to accomplish this, also adding a piezo-beeper to alert developers when a build fails. The MM232R can be obtained either direct from the FTDI shop or from Farnell.
FTDI data sheets are available from http://www.ftdichip.com. I recommend reading the following:
The prototype was simply built on old-fashioned stripboard (0.1" pitch).
I used a self-drive piezo-electric beeper to provide an audible alert - available from Maplin part number KU58N. The MOSFETs and other components were obtained from Maplin and various eBay sellers. It would have been nice to fit the board inside the base of the lamp, but my prototype was too large, so the completed board was fitted in to a small plastic box with a DC power socket for the lamp. I cut the USB plug off the the lamp cable and replaced it with a matching DC power plug. An LED in parallel with the socket provides an additional on/off indication.
All of the documentation is contained within the Hudson plugin as LavaLampElectronics.zip. You will need to use jar or unzip to extract it.
Since the hudson server is back in the server room, the lava lamp module is attached to USB on a desktop machine and a simple socket server runs to listen for build results.
FTDI provide free USB drivers for a number of operating systems. Higher level code still has to interface with the driver - a SourceForge project, FTD2XXj, has already done this, so writing a Java program to control it becomes very straightforward.
Before you can run the software using the design above, you need to set the EEPROM configuration in the FT232R chip.
This is done using the FT_PROG utility (download from FTDI).
We need to set two lines (lamp and piezo-buzzer) as bit-bang outputs, and tell it to request the D2XX driver when initialised.
Therefore connect your MM232R to a USB cable and run FT_PROG.
(If you want to do this even before you have built your circuit, use a jumper connect pins 2 to 3 together
and pins 14 to 15 together. Then the device will power up correctly and be recognised by Windows).
Make the following configuration changes (the template file ft-mm232r-lavalamp.xml contains these) :
The lamp control software is zipped up inside the released Hudson plugin as LavaLampController.zip. Extract it from LavaLampNotifier.hpi, then unpack it to a directory on your Windows or Linux machine. An example Windows batch file lavalamp.cmd is provided which should get you up and running.
The notifier plug-in talks to this server across the network. (I could have used an existing RSS notifier, but didn't want the lamp to be polling Hudson constantly, I rather preferred the immediacy of the result being "pushed" to a known listener.) It consists of a "global" module which allows configuration of any number of different LavaLamp host/port combinations (to support different jobs or projects).
A "per-job" module then allows selection of the lamp you want to notify with the status of each job.
Theoretically alternate "lamp server" modules could be developed which might not necessarily use a hardware lamp at all - listening on an IP-multicast address to pop up an icon in everybody's windows tray is one idea.