Before you start
ToolsFor opening the case you will need to remove two screws that are similar to those of mobile phones. I don't know the type name nor the size, so I recommend you to check type and size before starting. The screws are under the adhesive on the back of the router near the power plug and the mode button. UPDATE: Matt Sealey posted a comment saying that the screws are Torx T6. Thank you Matt!
USB to SerialYou will need something to connect your computer to the serial interface of the router. The most common solution is to use an USB to serial adapter. There are plenty of options, but I'm using this one that I bought on Ebay for less than € 10. Search for 'FT232RL' on your favorite online store.
You will also need 3 female to female breadboard wires, which are also easy to find in your favorite online store. I found a pack of 40 wires for less than € 2.
Opening the case and connecting wires
Opening the case
This is more complicated than usual for two reasons:
- There are two hidden screws on the back of the router. One near the power connector and other near the mode button. Remove the adhesive with care so you can put it back later. The screws are similar to the ones used on cell phones, so before you start, make sure you have the tools to open it properly.
- There is a heat sink on the part you are going to remove, and it is glued to some metallic case on the PCB. Open the case slowly and with care.
But it is not a big deal, the case is not fragile, so you can apply a little bit of brute force when opening it.
3.3V Serial vs 5V Serial
The Serial to USB usually have the option to be 3.3V or 5V. Configure it to 3.3V. On my adapter the configuration is done on the back side of the PCB.
Connecting the wires
This is easier than opening the case. The pins on the router are near the reset button on the top right. You need to connect GND, RX and TX. The labels on the picture shows where the pins of the Serial to USB adapter should be connected to. TX on the Serial to USB should be connected to the pin with the label TX on the picture below.
Picture from: http://www.dd-wrt.com/phpBB2/
Connecting 3.3V pin of the router to the VCC pin of the Serial to USB adapter causes the Serial to USB adapter to power off with the router. This can make your life harder as powering off the router may freeze the terminal emulation software on your PC.
How to find the device node of the serial port?
After connecting the USB to serial adapter to your computer use dmesg and look for the ttyUSB string:
[ 7174.272428] usb 6-1.3.4: Product: FT232R USB UART
[ 7174.272434] usb 6-1.3.4: Manufacturer: FTDI
[ 7174.321779] ftdi_sio 6-1.3.4:1.0: FTDI USB Serial Device converter detected
[ 7174.321873] usb 6-1.3.4: Detected FT232RL
[ 7174.322740] usb 6-1.3.4: FTDI USB Serial Device converter now attached to ttyUSB1
So in this case it is /dev/ttyUSB1
Do my user has permission to use the serial port?
Your distro may not allow your user to access the serial port. It is easy to check with ls and groups if you have rights:
$ ls -la /dev/ttyUSB1
crw-rw---- 1 root dialout 188, 1 Apr 14 16:55 /dev/ttyUSB1
peter wheel dialout wireshark
As the grouop dialout has read and write permission at /dev/ttyUSB1 and as I'm member of the group dialout, everything is fine. If your user is not on the correct group, fix it before continuing. Simple dirty and dangerous hack: call minicom with sudo
Which software to use?
As I'm using Linux, I tried moserial and minicom. I could made it work only with minicom. There are two magical commands to minicom: Ctrl-A Z for showing all options and Ctrl-A X to exit in a clean way.
How to configure the serial port?
Configuring the serial port to 115200 8N1 is enough to read from the console, but not to write to it. For writing, it is necessary to disable Hardware Flow Control and disable Software Flow Control.
$ minicom -s -D /dev/ttyUSB1
Then navigate to Sertial port setup and make sure the configuration matches the description.
Interacting with the console
I follow this order:
- Connect the USB to Serial to your computer
- Start minicom
- Power on the router and wait for the initialization messages
- Press Ctrl-C some times until you see the prompt CFE>
Now you can start fixing your router.