Serial Console
Most routers have a serial console connection on the board, however most router and ther consumer products don't have a serial connection connector (RS-232) or something alike available. For this some soldering is required.
With a serial console connection It is possible to:
- Access the bootloader
- Re-flash firmware
- Follow (debug) output of the entire boot process of the device
- loading and executing the kernel
- linux init output
- Login to the Linux
Most router / consumer products will require to solder some wires to the board and connect that to a Level Converter (USB) before it can be connected to a PC. This is due to voltage differences between embedded devices and PC's. There are very check USB TTL converters available. It requires soldering 3 wires (RT, TX and GND) on the board of the device to the USB TTL converter. The USB converter can be directly inserted into a USB port of a PC and will provide a /dev/ttyUSBn serial device.
OpenWrt has a very good generic page on this soldering and level conversion: Serial Console. And many device specific pages on OpenWrt describe some details for that device on how to connect using a serial console.
Managing to get a serial console interface to your device is one thing, a second thing is how to connect to it, and more importantly, how to interrupt the bootloader from booting directly into the kernel and flash a new firmware. In the example below I use minicom. There are more terminal programs available, however they will all require to set the serial connections settings as below.
Minicom Configuration
Use dmesg to see which device name has been assigned to the serial port connection to your device and next configure minicom using minicom -s.
[ 8.554670] usb 2-2: cp210x converter now attached to ttyUSB0
[ Serial Port Setup] +-----------------------------------------------------------------------+ | A - Serial Device : /dev/ttyUSB0 | B - Lockfile Location : /var/lock | C - Callin Program : | D - Callout Program : | E - Bps/Par/Bits : 115200 8N1 | F - Hardware Flow Control : No | G - Software Flow Control : No | | Change which setting? +-----------------------------------------------------------------------+ +--------------------[Modem and dialing parameter setup]---------------------+ | | A - Init string ......... | B - Reset string ........ | C - Dialing prefix #1.... ATDT ...
Minicom
Minicom example on the TP-Link TL-WR1043ND. Start mini com, now without -s. Type "enter" once to see some output, or unplug and plug the power to your router and follow the boot process. See bootloader on how to interrupt the bootloader from automatically loading / booting the kernel.
Welcome to minicom 2.4 OPTIONS: I18n Compiled on Sep 5 2010, 08:31:32. Port /dev/ttyUSB0 Press CTRL-A Z for help on special keys U-Boot 1.1.4 (Mar 31 2012 - 10:40:21) AP83 (ar9100) U-boot 0.0.11 DRAM: sri 32 MB id read 0x100000ff flash size 8MB, sector count = 128 Flash: 8 MB Using default environment In: serial Out: serial Err: serial Net: ag7100_enet_initialize... No valid address in Flash. Using fixed address : cfg1 0xf cfg2 0x7114 eth0: 00:03:7f:09:0b:ad eth0 up eth0 Autobooting in 1 secondsar7100> ar7100> CTRL-A Z for help |115200 8N1 | NOR | Minicom 2.4 | VT102 | Offline