Click on images to enlarge them

Tuesday, March 23, 2010

Linksys WRT54G with bluetooth console access

I have been playing with Linksys WRT54G series routers and various firmware distros for several years. One of first mods usually is to solder a UART header to the router board in order to get console access. There are plenty of guides on how to do this, so I won't go into that procedure. Many write-up for show how to add a RS-232 9-pin D-shell connector. Usually this entails modifying the router case in order to mount the RS-232 header. I am reluctant to hack-up my router case to get console access. To my notion, the results often look hackish.

So I have found two solutions which don't require modifying the case.

The first is too simple to go into detail, but I just route the ribbon cable through the top two section of the router case. This leaves a small, unaesthetic gap where the ribbon cable pushes though and for this reason I am have move to the second solution.

My prefered solution for general router console access is via a Bluetooth connection. This Bluetooth connectivity is provided with a Bluetooth module such as the "BlueSMiRF" module sold by SparkFun (see note below). The Bluetooth connection is based on the SPP/RFCOMM profiles which this module supports. Access from Windows, Macs, and Linux systems quite easy. I use hyperterm on Windows-based systems and minicom on Linux-based systems.

A description of my procedures --

I constructed a new header cable with the standard 5x2 header and 10 strand ribbon cable. The cable length should be about one foot long (30cm) or so. The UART pins on the router board header are layed-out such that odd-numbered pins are UART0 and even-number pins are UART1. You can see in the photo below how, on the cable, I split-out the individual strands for each uart. I used shrink-tubing to re-gather the strands. I then soldered 4pin headers onto the ends of each cable branch. Be sure to cross-over the TX and RX cables at this time. Notice that the UART pins 4 and 8 are not connected and I just tucked them back into the shrink-tubing.

The new dual-headed cable should now be ready for use.

I connected an old "BlueSMiRF" module I bought from SparkFun years ago. The pin layout matched the layout of the new cable header. Then I "paired" the PC with the BlueSMiRF module and opened hyperterm using the new virtual com port. Tap a couple of [enter] and a prompt from the linksys shell should appear.

At this point I normally would stick the bluetooth module to the inside roof of the linksys case with double-side foam tape, and tuck the cable into the case before closing it. When closed up, the case should show no signs of this modification.

Since I didn't have two Bluetooth modules, I used a Serial-to-USB adapter with a RS-232-to-TTLv3 level converter to interact with the second UART. The last image shows a simple test in which the console UART sends a short message to the second UART.



Notes:
1) Be sure to consider how to handle RTS/CTS on your bluetooth module. For the "BlueSMiRF" there is a 0-ohm pads which will short CTS to RTS. Your module probably has a similar option.

2) The second UART on the header usually is initialized at 9600 baud, not 115200 baud.

3) I don't believe SparkFun offers the same BlueSMiRF module as I used. The replacement part appears to be the "BlueSMiRF Gold", which is based on the Roving Networks module. This substitution should work without problems.