Wow. For the first time in my life I've undertaken an electronics project and had it immediately work. I'm still a little shaken by the experience.
As you might recall, in my last post I discussed loading the custom, Linux-based DD-WRT firmware onto the Fonera router. I left off with some thoughts about using that environment to achieve serial communication with an Arduino.
Getting the Fonera to talk to my Arduino turned out to be shockingly easy. The 2200 Fonera model has a four-pin header exposed. The pin closest to the ethernet port is ground; next is serial receive; then comes serial transmit. I scrounged up a female pin header connector from a USB break-out bezel I had lying around (already half-cannibalized — last year I'd used the USB end to make the cable necessary for softmodding the office Xbox). That makes the photo to the right look a bit messier than it needs to. In truth I simply connected ground to ground, then the Fonera transmit pin to the Arduino receive pin.
The Arduino software environment's serial monitor only displays transmitted data, so I whipped up a quick program to read incoming data and echo it back out on the transmit pin (which wasn't connected to anything, but the Arduino's serial output is picked up by my macbook through the USB connection). You can see the program in the picture below. You can also see the result I got when booting up the Fonera:
It worked! First you see the bootloader, then a bunch of garbage. That's nothing to worry about, though. The bootloader runs at 9600 baud, which is what I had the Arduino serial link configured to expect. Once the bootloader is done, the DD-WRT environment takes over, and it ramps the serial port's speed up to 115200 baud, producing the cloud of gibberish that follows the bootloader.
Fortunately, that's easy to fix with the stty command: