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. 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.
Go to and browse to the correct directory. Following instructions will leave your router in a state where the serial console is needed to recover. Now, go back to the RedBoot console waiting for you in minicom.
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. Has a very good generic page on this soldering and level conversion:.
And many device specific pages on 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 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.
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 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: ag7100enetinitialize. 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.
→ So in contrast to the, the Serial Ports needs some software running on the CPU so we can use it! In case the bootloader is damaged, or does not offer such a feature, the port is useless. Finding an UART on a router is fairly easy since it only needs 3 signals (without modem signaling) to work: GND, TX and RX (often accompanied by VCC). Since your router is very likely to have its I/O pins working at 3.3V ( level voltage), you will need a level shifter such as a Maxim MAX232 to change the level from 3.3V to your computer level which is usually at 12V. To find out the serial console pins on the PCB, you will be looking for a populated or unpopulated 4-pin header, which can be far from the SoC (signals are relatively slow) and usually with tracks on the top or bottom layer of the PCB, and connected to the TX and RX. Once found, you can easily check where is GND, which is connected to the same ground layer than the power connector. VCC should be fixed at 3.3V and connected to the supply layer, TX is also at 3.3V level but using a multimeter as an ohm-meter and showing an infinite value between TX and VCC pins will tell you about them being different signals (or not).
RX and GND are by default at 0V, so using the same technique you can determine the remaining pins like this. If you do not have a multimeter a simple trick that usually works is using a speaker or a LED to determine the 3.3V signals. Additionally most PCB designer will draw a square pad to indicate ping number 1. Once found, just interface your level shifter with the device and the serial port on the PC on the other side. Most common baud rates for the off-the-shelf devices are 9600, 38400 and 115200 with 8-bits data, no parity, 1-bit stop.
Cleanup Required! This page or section needs cleanup. You can this page to fix wiki markup, redundant content or outdated information. Many people get along without a serial console for their device because they are able to flash working firmware the first time or are able to apply various recovery methods and do all their communicating with the device over a network. However, due to characteristics of their bootloaders or because they are not yet fully supported, for some devices it can be quite handy to have a compatible serial console available. Most devices that are supported by OpenWrt include a serial port.
These serial ports typically provide a console to the bootloader and, when the firmware has booted, a console to the running system. Typically, a console to the bootloader will allow you to configure a network, fetch and flash a new firmware, which can be a life-saver when the firmware is broken. A console to the running system will let you correct a misconfigured network.
![Windows Windows](http://romain.novalan.fr/w/images/f/f2/FONERA-with-RS232-adapter.jpg)
This section descripes actions that might damage your device or firmware. Proceed with care!
Caution: Very few devices have standard +/- 12V serial ports, but in many OpenWrt-supported devices the serial ports operate at TTL voltage (sometimes 5V, most often 3.3V) levels, meaning you cannot use a standard serial or USB to serial cable: it will fry your board. In order for the serial console to work, the logic levels on the wires should match those expected by your device. The first step therefore is to determine which voltage levels are required. Often, you can find this documented on the OpenWrt wiki or elsewhere.
Check your device's voltage levels with this chart. For detailed description look In addition these levels are averages for the type of devices shown. In order to interact with your device over its serial port, you need a minimum of three wires connected: a ground (GND); transmit (TX); and receive (RX). It is possible to get useful information about what is happening with only GND and RX, but in order to fix a problem you will usually also need TX. Your computer's TX should be connected to the device's RX, and your computer's RX should be connected to the device's TX. The computer's GND should connect the the device's GND. That way, what you say will get heard by the device and what the device says will get heard by your computer.
This is often called a 'null-modem' configuration. You will also need a terminal emulation program on your computer, such as minicom, hyperterminal, etc. The terminal emulation program needs to be configured to be compatible with your device, in particular, with regard to baud rate and flow control. If you are using only three wires (GND, TX, and RX) then hardware flow control should be turned off; you aren't using the pins (RTS and CTS) necessary for it to work. Rarely, the baud rate that the device expects might be different in the bootloader and the running firmware; if so, you'll need to modify the baud rate settings in your terminal emulator after the firmware boots up. First, you need an 'RS232-TTL level converter chip.' RS232 refers to the standard defining what plugs into your computer, and TTL is a family of chips that use 0V and 0.8V as low and 2.2V and 5V as high.
They can be purchased new (the MAX233x line is popular). Most vendors have large minimums, but some (e.g. ) sell components in small quantities.
The wiring is fairly simple, but it depends on the chip. Generally, it involves connecting Vcc from the router to the chip's Vcc pin, both router and rs-232 grounds to the ground pin, and the TX and RX wires to the chip. Remember that the router's TX will 'connect' to the same level conversion bank as the computer's RX. Additionally, some of these level converters require external capacitors, while some have them built in. Much of this varies, so consult the chip's spec. Another great source for RS232-TTL converters is in cell phone serial cables. Most cell phones need this same circuit to level-up for connection to a PC's serial port.
![Openwrt Serial Console Minicom Download Openwrt Serial Console Minicom Download](/uploads/1/2/5/5/125515239/292349564.jpg)
Many people already have such a cable laying around, or can buy one fairly cheap. Using an existing cable is much easier than building one. If you open up the cell phone cable's serial port casing and see a MAX### chip, it's probably the cable you need. One known chip is a MAX323 (yes, 323, the original MAX232 is a 5V device and we need 3.3V here). If you've found a good cell phone cable to use, you merely need to determine which wires are the VCC, GND, TX, and RX connections.
Usually the VCC is red and the GND is black, but the other colors may vary (though blue and orange are common). There should be no need to modify the PCB embedded in the cable. One type of the 'Made in China' ones, not mentioned at ist the 'S30880-S5601-A802-1'; its WHITE wire is data out (TX) and the ORANGE one is data in (RX), VCC and GND are red and black. Its a 3.3V converter built with the MAX3386E chip.
This leaves two pins to identify: RXD and TXD. It's easiest to find the router's TXD pin first, because all the console output from the boot process appears there. Connect the RXD pin of your level shifter to one of the remaining console pins and re-start the router. You should have a terminal window connected to the serial port at the correct bitrate and parity, and you've connected the proper pin, you should see output data the router's startup process. If not, try another pin, restarting the router until you receive valid output. Now you've located the serial port TXD connection.