User Tools

Site Tools


doc:hardware:port.serial.cables

Serial Cables

This page assumes you have identified a serial connector on the router that you want to connect to from the PC. Modern PCs will usually have only a USB port to use for serial connectivity, and the first part of the page discusses how to use this. Some PCs have a traditional, 'proper' 9-pin (or maybe even 25-pin) serial connector and the use of this is discussed later in the page.

See also port.serial for information on making use of the connection, background information on serial port characteristics, etc.

Firstly:

WARNING!: Some people reported they fried their router connecting the voltage pins spite it isn't neccesary. NEVER connect voltage pins when using USB adapters unless you know what are you doing. Unless you need to power the device, you don't have to connect the voltage pins. And you usually don't need to power it this way - use the router power supply.

In other words you usually only need to connect GROUND, TX and RX at a suitable level. 3.3V and 5V ports will often be happy at either of those voltages, BUT 12V may well fry things. Think before assuming a physical connection is all you need!

USB (PC) to Serial (Router)

This section is aimed at what hardware is needed to communicate from the USB port on a PC to a device (router or similar) that has a serial connector of some kind.

Prebuilt Cables

USB - Serial TTL Cable Reviews

https://www.adafruit.com/products/70 is a great serial cable. It's used for ttl level serial. If you have to solder to the board, it's probably ttl. If there is an actual serial port, then it's 12V serial. Different device!

PL2303 cables

Its a component of many cheap USB-TTL cables available on ebay. Prolific produces the PL-2303HX/PL-2303HX.D chip in different variants at least since 2002 ( PL2303HX datasheet , PL2303HXD datasheet ). There are different designt with unattached cables, 3 pin (no 3.3V / 5V ), 4 pin (likely 3.3V ) or more pins available. Connecting 3.3V/5V is not needed and can damage the board.

USB to RS232 TTL Converter Module

These things make it simple to connect a computer (USB port) to the serial pins on the router.

They are usually shipped with four jumper cables. Try Dealextreme SKU 81872. Or on Amazon B009T2ZR6W. Or on ebay there are plenty of these cheap adapters.

Simply connect the jumper cables to the pins like this:

Router Converter module
GND GND
TXD RXD
RXD TXD

Please note that some USB serial adapters (The CP2102-based one in the Amazon link above, for example) have the RX and TX connectors labelled according to what you should connect them to, not what they actually do. If connecting TX → RX and RX → TX doesn't work for you, try switching to TX → TX and RX → RX.

Arduino Uno (REV3) as USB to serial cable

Caution: Do this at your own risk, since the Arduino runs at 5v and the serial sometimes is at a different voltage. Therefore, using the following technique may cause the router, Arduino, or other things, to malfunction or break. That said, this technique worked well for me during for lots of use (hours), with a Linksys E1000 v1 at 3.3v, and an Arduino Uno REV3.

This method uses the Development board's built in USB to RS232 converter and results in 5V signals. This technique works since the Arduino Uno REV3 has a chip called the atmega16U2, which is a serial to USB converter, to talk to the computer; we use it here to talk to the router. So, other Arduinos may work.

A PC typically communicates with an Arduino such as the Uno via a USB cable that enters the board via a chip that does USB - serial conversion to allow use of the microcontroller's serial interface. The outputs from this chip connect to the RX and TX pins on the microcontroller, and are generally suitable for use with other chips that operate at similar voltages.

Note: compatible development boards include: Demulotev

Method A (reversible changes to Arduino board)

  1. Remove the programmable IC
  2. Connect the RX(0) and TX(1) and the development board ground through to the router/device.
  3. Use software to talk to the router/device.
  4. Replace the programmable IC

Method B (no physical changes to Arduino board)

  1. An Arduino Uno REV3 (may work on other arduinos, but only tested on the above)
  2. A router
  3. A computer
  4. A USB A-B cable (to use with the Arduino)

By the way this method does not require any hardware modifications to the arduino.

Upload the Arduino Bare Minimum sample sketch (consisting of empty setup() and loop() functions) to the Arduino.

Common

Remember, many devices will not need the Vcc to be connected, and connecting it when not needed may damage the router.

Then connect one end of the wires to the serial port / header and the other to the Arduino board:

  • Connect the ground to the Arduino's ground
  • Connect the TX and RX pins (digital 0 and 1 on a Uno, also labelled as TX and RX) of the Arduino to the RX and TX of the device.

The Arduino development environment is not needed; just use a regular serial terminal program using the USB Serial device that the Arduino drivers create.

If nothing is seen try switching TX and RX - it shouldn't break if reversed.

Build or hack your own USB - Serial cable

USB-serial parts

Cellphone Data Cables

A USB based data cable for a mobile cell phone is another possibility.

Ebay clone cables:

  • Datacable for Nokia 6210, 6250, 6310, 6310i, 7110

reference: http://www.nslu2-linux.org/wiki/HowTo/AddASerialPort

Data cable for Siemens cell phones

This kind of cable is really cheap. Only some €uros on ebay, because the phones are not built any more.

The cable should be compatible to one of these Siemens cell phones:
A35 / A36 / A50 / C25 / C25 Power / C28 / C35i / C45 / M35i / M50 / ME45 / MT50 / S25 / S35i / S45 / S45i / SL42 / SL45 / SL45i

It's the well supported prolific pl2303 USB to serial converter. There are 4 lines coming from the usb part to the phone jack. You don't need the Vcc line.

pin function
1 GND
3 Vcc
5 Tx
6 Rx

Mesh cube wiki page from archive.org

Serial (PC) - Serial (Router)

This section is aimed at what hardware is needed to communicate with a router or similar OpenWrt device that has a serial connector of some kind from the serial port on a PC.

Prebuilt Cables

Standard RS232 levels, for example:

Level conversion

Legacy / proper serial ports that have the trapezium 9-pin (DB9) or 25-pin (DB25) format operate at 12V. That's lot higher than the 3.3V or 5V that a router is likely to need, and will easily cook the device!

TTL-RS-232 level conversion is a fairly common problem, so there are a number of ICs on the market that convert between these voltage levels. Maxim IC has made a few handy little ICs for us to use. The best (IMHO) is the MAX3232, which can operate at different voltages depending on the capacitors in the circuit. This guide will tell you how to solder everything together to get a pc-compatible serial port on your OpenWrt router.

From scratch

With MAX233x IC

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 Maxim IC MAX233x line is popular). Most vendors have large minimums, but some (e.g. Mouser Electronics) 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.

With basic components

I found an easy way to get a cable working, it just require 7 components:

  1. 4 Resistances 1,5K 3,9K 4,7K 22K all by 1/4W
  2. 2 Transistors BC337
  3. 1 DB9F Terminal

The image shows how to make the cable

ttltors2320kf.jpg

http://3.bp.blogspot.com/_JE4GMReEeGU/SpATfyGBmLI/AAAAAAAAAF0/VHTl3Vcs6hU/s1600-h/ttltors2320kf.jpg

This cost less than 2 Dolars in Chile, i hope it be the same for you! I tested it on a Zyxel 600 Series, it works!

Ensure that the DTR signal at the PC end is asserted, otherwise nothing is received from the router. For example, in the Bray terminal program click on the DTR icon to turn it green.

Source: http://maximi89.blogspot.com/2009/08/hola-intente-modificar-el-bootbase-pero.html

From a PDA or cell phone serial cable

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. 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 http://www.nslu2-linux.org/wiki/HowTo/AddASerialPort ist the "S30880-S5601-A802-1"; its WHITE wire is data out (TX) of the DTE (PC) and conntcts to the RX of the DCE (Router); the ORANGE one is data in (RX) of the DTE (PC) and conntcts to the TX of the DCE (Router), VCC and GND are red and black. Its a 3.3V converter built with the MAX3386E chip.

MAX232 Kits

Model-specific guides

These guides are somewhat model specific, but if you're struggling to build your own cable, they're filled with information that applies to that part of the process.

doc/hardware/port.serial.cables.txt · Last modified: 2015/12/02 09:55 by WrtHog