Serial Cables

The most likely adapter you need is USB-TTL serial adapter, consumer routers with rs-232 ports are pretty rare

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.

RS232 serial (usually somewhere around 13 V) will fry any TTL serial port instantly.

TTL serial levels (5 or 3.3 V) from an as-shipped adapter can quickly destroy it as well.

Always confirm that the adapter outputs no more than 3.3 V and never output negative voltage before connecting.

Note that 2.5 V logic and even lower levels are beginning to appear in consumer routers. Lower voltage logic can be destroyed by even a 3.3 V adapter.

In other words you usually only need to connect GND, TX and RX at a suitable level for the specific device in question. Checking the V+ (sometimes labeled Vcc or Vss) with a voltmeter is recommended if you are at all unsure of the voltage levels.

Think and confirm before assuming a physical connection is all you need!

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.

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.

Use low cost cables with mechanical fixing

Drill hole and use wire straps and some hot glue for fixing the cable: (Zyxel NBG6617 used as example)

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.

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. I was unable to get this to work with a Arduino nano Clone with the CH340 usb serial chip.

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.

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 (or clone with the atmega16u2)
  2. Using a Jumper wire, connect the Reset Pin to Ground on the Arduino
  3. Connect the RX(0) and TX(1) and the Arduino ground through to the router/device.
  4. Use your favorite Serial capable program to talk to the router/device.

Method C (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)

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.

Using this board as a serial modem emulator can be a better match for most routers as it uses 3V pin signals. No user programming is required as an official loadable binary (UF2) for a tool called “picoprobe” (originally used to program micro processors) can be downloaded from raspberry's web page (from the Software Utilities section of the Raspberry Pi Pico documentation page. Click on the Raspberry Pi Pico section, scroll down to Software Utilities, and download the UF2 under “Debugging using another Raspberry Pi Pico”) Then you should only wire (and disregard other pins/functions) a GND Pin, Pin GP4 = UART1 TX and Pin GP5 = UART1 RX and you will be able to access our router serial port as per instructions described elsewhere in this document.

Further information about the tool can be found in the document “Getting started with Raspberry Pi Pico”

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

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.

Proper serial RS232C ports operate at -12V (logical 1) and +12V (logical 0). Not only that's completely opposite of the usual logic signalling (+Vcc for 1 and -Vcc or 0 for 0) - that's also a lot higher than the 3.3V or 5V that a router is likely to need, and will easily cook the device if it's not protected - and you should always assume that it isn't!

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 (search for “RS-232 Drivers” or “RS-232 level converter”). Maxim IC has made a few handy little ICs for us to use - see https://www.maximintegrated.com/en/datasheet/index.mvp/id/1798.

Standard RS232 levels, for example:

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.

Some of the simplest ways to create a level converter is using discrete transistors (one is needed for each direction, so you need two for bidi communication).

This one, using MOSFETs, allows the completely minimal part count: 2x 2N7000, 1x 4K7 & 100K resistors. That's all! (note that you can add additional gate pulldown for more stable operation)

Another solution, using BJTs:

ttl_to_rs2320kf.jpg

Ensure that either the hardware handshake is disabled (flow control on PC set to either XON/XOFF or none) or the DTR signal at the PC end is asserted, otherwise nothing will be received by the PC from the router. For example, in the Bray terminal program click on the DTR icon to turn it green.

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.

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
  • Last modified: 2022/08/27 20:16
  • by pbrena