Woot-Off Lights – in Python

The Woot-Off Lights project continues to slowly progress. Over the weekend we moved over to Python for the coding, since that’s the language Alex is most familiar with right now (especially in networking).

Serial control of the lights in Python took longer than expected – we could have saved over an hour of troubleshooting had we simply waited two seconds between opening the serial connection and transmitting the first byte (allowing the connection protocols time to complete), but instead we tried half a dozen Python libraries, thinking the problem was somewhere in the code library. Lesson learned – the exact specifics of interaction between software and hardware is not to be ignored.

We then were able to force the Woot Tracker to update it’s cache, pull down the XML file generated by the tracker, parse it for the value we are looking for (wootoff, true or false), and take action based upon it.

Now we’re simply trying to figure out how to package the program into an .exe that can be hidden in the tray, and also figure out how the timing should work – I would prefer that my server didn’t get a ton of update requests at the same time, especially during a Woot-Off. Right now it looks like we’ll run a custom version of the software on our machine to update the tracker, and the software we distribute publicly will simply pull down the XML (without first updating the cache, because our software has already done so).

On the hardware side of things, I’ve consolidated the driver circuitry onto a small piece of protoboard that pops into the Arduino like a shield. I’ve also cut up an Altoids tin and housed the assembly inside of it. Don’t forget the isolate the top/bottom of the board with electrical tape or similar so the metal case doesn’t short anything.

Here’s a few pictures of the assembly, with the lights being controlled via the Python application.

Comments 2

  1. Shaun wrote:

    As far as requesting the XML file and reading it, why not just have woots servers push a notification to your python program? It would help out both parties…especially woots servers. I’m sure you’ve already thought of this…I’m just curious as to why it didn’t go that way. All the work you’re doing is greatly appreciated. Thanks ~Shaun

    Posted 12 Jul 2009 at 8:25 AM
  2. brettinman wrote:

    The python program checks my wootoff tracker (woot.brettinman.com), pulling down an XML file that has already broke down the info (major thanks to Darkstar, who wrote the tracker software). We’re going to make it so that you can choose which tracker to use, although that tracker has to be a darkstar one.

    There is almost no load on Woot’s servers, as my tracker is acting as a buffer. The tracker only pulls from Woot’s servers every couple minutes (shorter if there’s a Wootoff in progress).

    As far as the hardware, the PCB for the USB Power Shield has shipped and I’m waiting on it’s arrival to put it together. Expect an update soon.

    Posted 12 Jul 2009 at 8:59 AM

Post a Comment

Your email is never published nor shared.