After some frustrating attempts at making the Lilypad and the XBee modules work, we decided it was time to turn to the master: Greg Corness, fellow PhD student and electronics tinkerer extraordinaire.  We brought all our gear to campus, parked ourselves in the grey box and fumbled around with setting a network up until Greg took pity on us and helped us figure it out. While getting the two XBees communicating with each other was not nearly as straightforward as we had hoped, we succeeded in the end.

Above is the prototype of the wireless unit for the glove-a Lilypad mainboard on the left connecting to an XBee shield + chip antenna module on the right.  We programmed this unit to send a stream of steadily incrementing numbers to a second XBee on a simple USB breakout board connected to a laptop and were able to see those numbers on the screen.  We had been anticipating needing an Arduino “base station” on that end as well, but it turns out we can just plug the XBee directly into the computer without an additional microcontroller. What is particularly exciting is that we got the XBee communication on the mobile unit running through pins 2 and 3, using a software serial connection, which leaves the standard serial tx/rx pins free for the RFID reader, a conflict we were anticipating having to solve later in the process.

To get this all working, we used a couple different resources (in addition to Greg):

Tom Igoe’s Making Things Talk was a starting point, but we quickly realized that the instructions in the book for the series 1 XBees were not going to work for our series 2 modules.

Lady Ada’s tutorial provided some basic information and grounding on using the XBees, but was a little out of date for providing detailed instructions.

This walkthrough ended up being both invaluable and deeply frustrating.  The terminology used-“coordinator” versus “router/end device” was endlessly confusing, and possibly actually written up wrong in the walkthrough.  We actually ended up configuring both of the XBees as “Coordinators”; this was the only way to get both modules to successfully send and receive.  It was the best resource we found for configuring the series 2/2.5 modules, however.

Getting software serial working was pretty straightforward, and we used a modified version of the library example code.
To communicate with the XBees, we used TeraTerm & and X-CTU.

In the end, it was just a lot of troubleshooting work-connecting this, disconnecting that, swapping these two things, trying to figure out why that light was blinking or was no longer blinking, etc.  Greg and Josh powered through a number of moments of utter bafflement and came out the other end victorious.  Now we need to get the RFID reader wired in and it’ll be time to really start programming the whole interaction.