Maker Pro
Maker Pro

Bad Linksys router; how can I connect to its serial debug port?

Donuts and coffee

May 12, 2018
11
Joined
May 12, 2018
Messages
11
I have a bad Linksys wireless router, and during my attempt to repair it, I found its serial debug port. I hooked up my logic analyzer to it and found valid baud, and other settings. I am able to view ASCII characters in the captured data.

However, I keep getting garbage characters when I try connecting to it from an actual DE-9 serial port using the configuration detected in the data capture. I've tried dozens of various baud/data bit size/stop bits/parity/terminal type (VT102/ANSI) and other settings, but I haven't been able to find a compatible combination. I don't know what's wrong.

I was able to verify the GND pin on the router's PCB, and two of its serial pins with the logic analyzer. There is a fourth pin, which I read from various articles on the internet NOT to hook up when I try to connect to the debug port from a computer. This is the article I've found which I've been referencing the most: http://jcjc-dev.com/2016/04/08/reversing-huawei-router-1-find-uart/

I've been going by this diagram of the serial pinouts. I've even tried a null modem adapter, and reversing the gender pinout of the wires, but I haven't been able to get it to work.

Here is a picture of my capture. Click on it to see the full size.


The computer I'm using to try to connect to it runs Debian Stretch, and I've tried minicom, cutecom, and other serial terminal emulators. I know the serial port works, because I can connect to an old network switch with it with no problem at all, and its serial port device is /dev/ttyS0. At this point, I'm out of ideas, and I have decided to ask for help. If anyone can help, I'd greatly appreciate it! Thanks
 
Last edited:

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
What is the voltage swing of this debug port? Is it the same (i.e. not less than) the voltage swing for another port which worked?

If your logic analyser can decode rs232, does it get the same garbled characters?
 

Donuts and coffee

May 12, 2018
11
Joined
May 12, 2018
Messages
11
Thanks for your prompt reply. I'll check the voltage later this morning when I can. But the logic analyzer was able to decode the characters. If you look at the lower right of the picture, you can see them, along with their ASCII values in hexadecimal. It's just a small portion that's visible in the picture, but it shows that it's able to detect and decode them. "Wireless router" is spelled out in a vertical column. Toward the end of the capture, it says to hit the space bar three times to enter a command. However, when I tried that on a terminal, nothing happened that I could see visually; no messed up characters appeared to change as a result of pressing it.

Also, can you clarify your question a little? About another port that worked, did you mean another port on the computer that worked, or another port on the router, or the serial port on the old network switch that works when the computer's serial port is connected to it, etc?
 
Last edited:

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
When you are able to decode the signal using a logic analyzer, I guess the signal levels are TTL (0 V ... 5 V) or even less (0 V ... 3.3 V). This port may be a UART port providing all the logic for serial communication but not the signal levels for true RS232 signals (< -3 V ... > + 3 V). The necessary level shifter (e.g. MAX232) is probably not on the router's PCB to save a few cents as it is usually not required.
In that case you'll need an RS232 level shifter (e.g. this one or a similar one) to connect a PC to this port.
Hoping your previous attempts of directly connecting the PC to this port have not done harm to the router's electronics.
 

kellys_eye

Jun 25, 2010
6,514
Joined
Jun 25, 2010
Messages
6,514
What was 'bad' about the router that made you want to investigate the software within?

The manufacturers are always offering software upgrades for these types of things and the procedure for doing so is well documented so re-flashing the device would surely fix any 'soft' issues?

The only problems I've ever encountered in a router that was working erratically was related to the usual dried up capacitors on the supply rails and replacement fixes the problem in 99%+ of the cases.
 

Donuts and coffee

May 12, 2018
11
Joined
May 12, 2018
Messages
11
When you are able to decode the signal using a logic analyzer, I guess the signal levels are TTL (0 V ... 5 V) or even less (0 V ... 3.3 V). This port may be a UART port providing all the logic for serial communication but not the signal levels for true RS232 signals (< -3 V ... > + 3 V). The necessary level shifter (e.g. MAX232) is probably not on the router's PCB to save a few cents as it is usually not required.
In that case you'll need an RS232 level shifter (e.g. this one or a similar one) to connect a PC to this port.
Hoping your previous attempts of directly connecting the PC to this port have not done harm to the router's electronics.

I've dealt with serial stuff before, but not a lot, so thanks for that link. I'll probably buy it. Here are the voltages my logic analyzer detected.
UtfOt5b.png


What was 'bad' about the router that made you want to investigate the software within?

The manufacturers are always offering software upgrades for these types of things and the procedure for doing so is well documented so re-flashing the device would surely fix any 'soft' issues?

The only problems I've ever encountered in a router that was working erratically was related to the usual dried up capacitors on the supply rails and replacement fixes the problem in 99%+ of the cases.
Computers can obtain IP addresses from it, but name resolution doesn't work. Also, even after doing factory resets on it, the default username/password (none/admin) won't work, so I can't get into its control panel to check things the normal way.
 
Top