Trouble Shooting USB Serial Adapter CP2102

Issues related to hardware problems
gw1500se
Posts: 222
Joined: 2012/05/07 13:53:35

Trouble Shooting USB Serial Adapter CP2102

Post by gw1500se » 2020/03/05 11:37:22

I have a CP2102 USB-serial adapter that appears to be working. However, using putty, I seem to be connecting to the port but the serial line does not respond to anything. I have crossed tx and rx so that is not the problem. The baud rate is set correctly (115200) but I do not see how to set flow control (8-N-1). I am guessing that is the default so it probably does not matter but I don't know how to debug this to figure out why it does not communicate. Does anyone have any suggestions? TIA,

User avatar
TrevorH
Site Admin
Posts: 33216
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Trouble Shooting USB Serial Adapter CP2102

Post by TrevorH » 2020/03/05 11:49:11

Connection details are specified in putty under Connection->Serial and you can set speed, data bits, stop bits, parity and flow control there.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

gw1500se
Posts: 222
Joined: 2012/05/07 13:53:35

Re: Trouble Shooting USB Serial Adapter CP2102

Post by gw1500se » 2020/03/05 12:00:47

Found it. Way down at the bottom. Thanks. Unfortunately the settings seem to be correct. I cannot get a log, I guess because it is not getting far enough to write anything. I don't know where to go from here. The terminal window pops up but nothing beyond that.

tunk
Posts: 1206
Joined: 2017/02/22 15:08:17

Re: Trouble Shooting USB Serial Adapter CP2102

Post by tunk » 2020/03/05 13:00:06

What kind of device are you trying to connect to?
I think that for some routers you have to solder in
a resistor or short some pads.

Edit: Are you sure you've selected the correct /dev/tty?

gw1500se
Posts: 222
Joined: 2012/05/07 13:53:35

Re: Trouble Shooting USB Serial Adapter CP2102

Post by gw1500se » 2020/03/05 14:38:00

The device is a Carambola 2 and yes I have the right tty because there is only 1 showing up. It looks like the correct one to me. This is the 'lsusb' output:

[ 0.531894] 0000:00:03.3: ttyS0 at I/O 0x1248 (irq = 17) is a 16550A
[ 0.581078] usbcore: registered new interface driver usbserial_generic
[ 0.581086] usbserial: USB Serial support registered for generic
[84514.186377] usbserial: USB Serial support registered for cp210x
[122572.616458] usbserial: USB Serial support registered for pl2303

Here is what I found in dmesg for the device.

Bus 008 Device 003: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP2102/CP2109 UART Bridge Controller [CP210x family]

I specify /dev/ttyS0 in putty.

User avatar
TrevorH
Site Admin
Posts: 33216
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Trouble Shooting USB Serial Adapter CP2102

Post by TrevorH » 2020/03/05 16:36:50

I don't think /dev/ttyS0 is the correct device. By the looks of it you plugged in your USB device(s) at 84514 or 122572 seconds after booting and yet /dev/ttyS0 existed at 0.5s after booting. This is what I get in /var/log/messages when I plug the cable in for my Odriod HC1 serial console
Mar 5 16:35:31 trevor4 kernel: usb 3-14.4.1: new full-speed USB device number 45 using xhci_hcd
Mar 5 16:35:31 trevor4 kernel: usb 3-14.4.1: New USB device found, idVendor=10c4, idProduct=ea60, bcdDevice= 1.00
Mar 5 16:35:31 trevor4 kernel: usb 3-14.4.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Mar 5 16:35:31 trevor4 kernel: usb 3-14.4.1: Product: CP2104 USB to UART Bridge Controller
Mar 5 16:35:31 trevor4 kernel: usb 3-14.4.1: Manufacturer: Silicon Labs
Mar 5 16:35:31 trevor4 kernel: usb 3-14.4.1: SerialNumber: 00BBD596
Mar 5 16:35:31 trevor4 mtp-probe: checking bus 3, device 45: "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-14/3-14.4/3-14.4.1"
Mar 5 16:35:31 trevor4 mtp-probe: bus: 3, device: 45 was not an MTP device
Mar 5 16:35:32 trevor4 kernel: usbcore: registered new interface driver cp210x
Mar 5 16:35:32 trevor4 kernel: usbserial: USB Serial support registered for cp210x
Mar 5 16:35:32 trevor4 kernel: cp210x 3-14.4.1:1.0: cp210x converter detected
Mar 5 16:35:32 trevor4 kernel: usb 3-14.4.1: cp210x converter now attached to ttyUSB0
What do you see if you unplug yours, watch /var/log/messages and then replug it.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

gw1500se
Posts: 222
Joined: 2012/05/07 13:53:35

Re: Trouble Shooting USB Serial Adapter CP2102

Post by gw1500se » 2020/03/05 16:50:29

Looks like I got pretty much the same thing.

Mar 5 11:44:31 dap002 kernel: usb 8-2: new full-speed USB device number 6 using uhci_hcd
Mar 5 11:44:31 dap002 kernel: usb 8-2: New USB device found, idVendor=10c4, idProduct=ea60, bcdDevice= 1.00
Mar 5 11:44:31 dap002 kernel: usb 8-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Mar 5 11:44:31 dap002 kernel: usb 8-2: Product: CP2102 USB to UART Bridge Controller
Mar 5 11:44:31 dap002 kernel: usb 8-2: Manufacturer: Silicon Labs
Mar 5 11:44:31 dap002 kernel: usb 8-2: SerialNumber: 0001
Mar 5 11:44:31 dap002 kernel: cp210x 8-2:1.0: cp210x converter detected
Mar 5 11:44:31 dap002 kernel: usb 8-2: cp210x converter now attached to ttyUSB0
Mar 5 11:44:31 dap002 mtp-probe: checking bus 8, device 6: "/sys/devices/pci0000:00/0000:00:1d.2/usb8/8-2"
Mar 5 11:44:31 dap002 mtp-probe: bus: 8, device: 6 was not an MTP device

I tried using /dev/ttyUSB0 but got the same result.

User avatar
TrevorH
Site Admin
Posts: 33216
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Trouble Shooting USB Serial Adapter CP2102

Post by TrevorH » 2020/03/05 18:15:49

If you're running putty as your own user, check that /dev/ttyUSB0 has the correct ownership:

crw-rw----. 1 root dialout 188, 0 Mar 5 18:14 /dev/ttyUSB0

so you would need to be a member of group dialout to use that. If you're not part of it now, add yourself with usermod -a -G dialout $youruser then logout and back in to pick that change up.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

gw1500se
Posts: 222
Joined: 2012/05/07 13:53:35

Re: Trouble Shooting USB Serial Adapter CP2102

Post by gw1500se » 2020/03/05 19:01:58

I am running putty as root so permissions are not the issue. As I said, it appears I can connect but there is no data moving between the devices. If I look at the stats I see tx: 70 rx: 0. Of course that means nothing if it is connecting to the wrong device.

gw1500se
Posts: 222
Joined: 2012/05/07 13:53:35

Re: Trouble Shooting USB Serial Adapter CP2102

Post by gw1500se » 2020/03/05 20:09:27

I don't know why I didn't think of this sooner. I did a loopback test and the device works as /dev/ttyUSB0. It is beginning to look like the carambola is the problem.

Post Reply