Any advice on a USB to RS232 connector

Any suggestions on what to look out for in buying a USB to RS232 connector?

I've just bricked a router and someone suggested I may be able to see what is going on if I can set up a serial connection.
 
One thing to check is if you need 3.3v or 5v. Usually it is the former.

You generally have 3 popular chips:
  • Prolific
  • FTDI
  • ch340
I use these:
The first one seems to contain a different chip every time I buy it. The second has a fantastic build quality (ch340) and allows me to specify 3.3v or 5v via a jumper. The third one is basically an Arduino that I misuse as a usb serial (ch340) at 5v.

They all tend to work quite well on BSD/Linux. I remember Prolific being annoying on Windows a few years back because they bricked cheap Asian clones by flashing their vendor id to 0. Since serial devices tend to be jumble-sale/bargain bin items, its sometimes difficult to actually get a genuine chip.

If you also have an arduino around, you can use that as a usb -> uart by bridging RST to GND. Genuine Arduinos tend to use FTDI, whereas the clones tend to use ch340.
 
I've used Silicon Labs CP2102 chip based adaptors to flash STM32 MCUs. CP2102 is 3.3V chip. Worked flawlessly on FreeBSD 10.4-12.2 and need no drivers on Win10.
I have troubles with CH340A on FreeBSD because I was unable to set 8E1 (even parity needed to flash STM32) on FreeBSD12.2. Don't know if it has been fixed. And it doesn't worked at all on FreeBSD10.4 (As I remember, one of the pins RXD or TXD does not actually receive/transmit anything, do not remember which one).
Didn't touch Prolific chips since 2007, but as I can remember they worked fine on FreeBSD 6-7
Never used FTDI chip based adaptors because they are more expensive.
 
There are a number of recovery methods depending on the Make/Model of your router. A good resource is the OpenWRT project:
General OpenWRT user guide

Specific OpenWRT Recovery Methods
Actually it was in the process of trying to install OpenWrt on this router, a Teltonika RUT 955, that I bricked it.

The device reported that it was running OpenWrt and I did install the latest (Teltonika version) of OpenWrt via the GUI, then on the OpenWrt forum I found instructions for installing a newer, 'genuine' version of OpenWrt

OpenWrt firmware for Rut955 and with some 'help' from the good folks on the forum I managed to brick it!

Relevant OpenWrt thread
 
As kpedersen mentioned above, those chipsets work out of the box with FreeBSD. Personally I have dealt with FTDI and Prolfic.
E.g. this one is based on PL2303 (Prolific). "RS-232" should be in the title, not just "Serial" or "UART", and no TTL or 3.3V or 5V should be mentioned in the description. By the way, UGREEN in my link is a noteworthy brand, but there are many others.
 
As kpedersen mentioned above, those chipsets work out of the box with FreeBSD. Personally I have dealt with FTDI and Prolfic.
E.g. this one is based on PL2303 (Prolific). "RS-232" should be in the title, not just "Serial" or "UART", and no TTL or 3.3V or 5V should be mentioned in the description. By the way, UGREEN in my link is a noteworthy brand, but there are many others.
Many thanks, I'll order one of these.
 
I've received my RS232-USB connector today.

Bus /dev/usb Device /dev/ugen1.2: ID 067b:23a3 Prolific Technology, Inc. ATEN Serial Bridge

What do I need to run when I have connected it to to my 'bricked' router?

ISTR that cu() is the program I should use but have used it for many years, but don't recall how to use it.
 
Any suggestions on what to look out for in buying a USB to RS232 connector?

I've just bricked a router and someone suggested I may be able to see what is going on if I can set up a serial connection.
I use them here. They're great for connecting to serial consoles -- my servers in my basement are serial connected.

They type of connection you need to a bricked router depends on the router. Many require an Arduino because router port may not be an RS-232. Read documentation for your router.

I have a bricked router. The serial port must be connected to an Arduino to interface with the bespoke pins on the router's motherboard.
 
sysutils/screen can also be used. It is simple to use, just screen device speed, example screen /dev/ttyU0 115200 for example.
ISTR something about using something like /dev/cuaU0

root@W520:~ $ ls -al /dev/cuaU*
crw-rw---- 1 uucp dialer 0x1cb Nov 23 21:41 /dev/cuaU0
crw-rw---- 1 uucp dialer 0x1cc Nov 23 21:41 /dev/cuaU0.init
crw-rw---- 1 uucp dialer 0x1cd Nov 23 21:41 /dev/cuaU0.lock
crw-rw---- 1 uucp dialer 0x1d1 Nov 23 21:41 /dev/cuaU1
crw-rw---- 1 uucp dialer 0x1d2 Nov 23 21:41 /dev/cuaU1.init
crw-rw---- 1 uucp dialer 0x1d3 Nov 23 21:41 /dev/cuaU1.lock
crw-rw---- 1 uucp dialer 0x1d7 Nov 23 21:41 /dev/cuaU2
crw-rw---- 1 uucp dialer 0x1d8 Nov 23 21:41 /dev/cuaU2.init
crw-rw---- 1 uucp dialer 0x1d9 Nov 23 21:41 /dev/cuaU2.lock
root@W520:~ $
 
yes, usb serial devices are both /dev/cuaUn and /dev/ttyUn at the same time. As long as you have the correct rights (ownership / group membership and devd rules fixes that) you can use whichever of the two you want.
 
yes, usb serial devices are both /dev/cuaUn and /dev/ttyUn at the same time. As long as you have the correct rights (ownership / group membership and devd rules fixes that) you can use whichever of the two you want.
How do I know which of the /dev/cuaU* devices is the one that my cable is connected to?

After inserting the connector, I see that cuau3 appears so it must be that one.

root@W520:/dev $ cu -l /dev/cuaU3 -s 9600
Connected

then nothing...
 
pwd ; mkdir ~/test ; cd ~/test
dmesg | grep -i cua or dmesg | grep -i tty or ls /dev | grep -i cua
cu -l /dev/cuaU3 -s 115200 # what speed does your bricked router use for the TTL serial port speed? Could it be 500K speed or 4800 speed or others used different speeds. Whats your router documentation say?
USB Serial 3.3V TTL connection examples
SCP copy a file through SSH from an embedded computer

Hope this answers your questions, Balanga. Ask more with details
sudo cu -s 115200 -l /dev/ttyU1 # use what works for your hardware and O/S
dmesg | grep -i cua
 
pwd ; mkdir ~/test ; cd ~/test
dmesg | grep -i cua or dmesg | grep -i tty or ls /dev | grep -i cua
cu -l /dev/cuaU3 -s 115200 # what speed does your bricked router use for the TTL serial port speed? Could it be 500K speed or 4800 speed or others used different speeds. Whats your router documentation say?
USB Serial 3.3V TTL connection examples
SCP copy a file through SSH from an embedded computer

Hope this answers your questions, Balanga. Ask more with details
sudo cu -s 115200 -l /dev/ttyU1 # use what works for your hardware and O/S
dmesg | grep -i cua
I'm not sure what you're telling me.

I change -s to 115200 and get a 'Connected' response but have no idea what this means and whether I should expect some response.

Maybe I need to load some driver for the connector.
 
How do I know which of the /dev/cuaU* devices is the one that my cable is connected to?
You can use ttyname for that. Examples:
Code:
root@kg-core1# sysctl dev.uftdi.1.ttyname
dev.uftdi.1.ttyname: U1

root@kg-core2:~ # sysctl dev.uslcom.0.ttyname
dev.uslcom.0.ttyname: U0

root@kg-core1# sysctl dev.uchcom.0.ttyname
dev.uchcom.0.ttyname: U1

root@kg-core2:~ # sysctl dev.umodem.0.ttyname
dev.umodem.0.ttyname: U0
 
I change -s to 115200 and get a 'Connected' response but have no idea what this means and whether I should expect some response.
It will say "Connected" if the serial device (/dev/cuaU3 in your case) can be opened -- it tells you nothing about whether this is the device the adapter is attached to, whether the speed setting is correct, or whether the serial/USB adapter is correctly configured for the voltage of the serial connection.
If you're sure the serial port voltage is correct, and you're on the right device, I would suggest trying the "cu" command with different speed settings and restarting (power cycle) the bricked device each time to see if it outputs recognizable text on its serial port. I found the device I was most recently working on to be 115200 baud, though I've seen plenty of 9600 baud in the past.
 
Back
Top