Reply
Posts: 1
Registered: ‎09-01-2017

Raspberry Pi USB to Serial Connection issues!

Hello everyone,

My colleague and I are having issues getting a Raspberry Pi 3 connected via a USB to Serial cable, to our Ubuntu 16.04 machine. I have tried to attach as much information to this post as possible to aid in solving our issue, if there is something I missed please let me know and I will get it posted as fast as possible. The Pi was also configured to allow serial connections. We got this working on OSX as well.

 

The following are the steps we are taking when hooking up the PI:

  1. Attach SD Card to Pi
  2. Wire the serial cable to the Pi using the diagram posted below
  3. Plug the usb end of the serial into USB port on the computer
  4. Check dmesg to confirm device recognition
  5. Confirm /dev/ttyUSB0 exists
    1. We did confirm this is created when the USB is plugged in
  6. Run the following command:
    1. $ sudo screen /dev/ttyUSB0 115200
  7. Observe output

 

When following the above steps we receive the following output:

Just a blank terminal with the flashing cursor. We waited several minutes for any interaction and didn’t get any output.

 

Expected output would be a terminal with the login prompt from the Pi being displayed.

 

Hardware:

Dell Optiplex 9020

Processor: Intel® Core™ i7-4790 CPU @ 3.60GHz × 8

Graphics: Gallium 0.4 on AMD OLAND (DRM 2.43.0 / 4.4.0-92-generic, LLVM 4.0.0)

OS Type: 64-bit

Disk: 235 GB

Memory: 15.6 GiB

 

Operating System: Ubuntu 16.04.3 LTS

Kernel Version: Linux 4.4.0-92-generic #115-Ubuntu SMP x86_64 GNU/Linux

Device: Raspberry Pi 3 (Model B)

SD Card: Adafruit micro SD card (8GB) Pre-installed with NOOBS

USB to TTL Serial: http://adafru.it/954 P954C

 

Dmesg Logs:

[ 1063.876795] usb 1-1.4: new full-speed USB device number 3 using ehci-pci

[ 1063.970967] usb 1-1.4: New USB device found, idVendor=10c4, idProduct=ea60

[ 1063.970970] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3

[ 1063.970971] usb 1-1.4: Product: CP2102 USB to UART Bridge Controller

[ 1063.970972] usb 1-1.4: Manufacturer: Silicon Labs

[ 1063.970973] usb 1-1.4: SerialNumber: 0001

[ 1064.989327] usbcore: registered new interface driver usbserial

[ 1064.989340] usbcore: registered new interface driver usbserial_generic

[ 1064.989350] usbserial: USB Serial support registered for generic

[ 1064.989861] usbcore: registered new interface driver cp210x

[ 1064.989874] usbserial: USB Serial support registered for cp210x

[ 1064.989893] cp210x 1-1.4:1.0: cp210x converter detected

[ 1064.991457] usb 1-1.4: cp210x converter now attached to ttyUSB0

 

lsusb output:

cumorris@csee137aer60:~$ lsusb

Bus 002 Device 004: ID 413c:2107 Dell Computer Corp.

Bus 002 Device 003: ID 046d:c077 Logitech, Inc. M105 Optical Mouse

Bus 002 Device 002: ID 8087:8000 Intel Corp.

Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 001 Device 003: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x UART Bridge / myAVR mySmartUSB light

Bus 001 Device 002: ID 8087:8008 Intel Corp.

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

 

lsmod output:

cumorris@csee137aer60:~$ lsmod

]Module               Size  Used by

cp210x              24576  0

usbserial           53248  1 cp210x

pci_stub            16384  1

vboxpci             24576  0

vboxnetadp          28672  0

vboxnetflt          28672  0

vboxdrv            454656  3 vboxnetadp,vboxnetflt,vboxpci

input_leds          16384  0

dcdbas              16384  0

intel_rapl          20480  0

x86_pkg_temp_thermal 16384  0

intel_powerclamp    16384  0

coretemp            16384  0

crct10dif_pclmul    16384  0

snd_hda_codec_realtek 86016  1

crc32_pclmul        16384  0

ghash_clmulni_intel 16384  0

snd_hda_codec_generic 77824  1 snd_hda_codec_realtek

aesni_intel        167936  0

snd_hda_codec_hdmi 53248  2

aes_x86_64          20480  1 aesni_intel

lrw                 16384  1 aesni_intel

snd_hda_intel       40960  7

gf128mul            16384  1 lrw

glue_helper         16384  1 aesni_intel

snd_hda_codec      135168  4 snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_intel

ablk_helper         16384  1 aesni_intel

cryptd              20480  3 ghash_clmulni_intel,aesni_intel,ablk_helper

snd_hda_core        73728  5 snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_codec,snd_hda_intel

snd_hwdep           16384  1 snd_hda_codec

snd_seq_midi        16384  0

snd_seq_midi_event 16384  1 snd_seq_midi

serio_raw           16384  0

snd_rawmidi         32768  1 snd_seq_midi

snd_pcm            106496  4 snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel,snd_hda_core

snd_seq             69632  2 snd_seq_midi_event,snd_seq_midi

snd_seq_device      16384  3 snd_seq,snd_rawmidi,snd_seq_midi

snd_timer           32768  2 snd_pcm,snd_seq

snd                 81920  25 snd_hda_codec_realtek,snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_pcm,snd_seq,snd_rawmidi,snd_hda_codec_generic,snd_hda_codec,snd_hda_intel,snd_seq_device

mei_me              36864  0

mei                 98304  1 mei_me

soundcore           16384  1 snd

shpchp              36864  0

lpc_ich             24576  0

8250_fintek         16384  0

kvm_intel          172032  0

mac_hid             16384  0

kvm                544768  1 kvm_intel

irqbypass           16384  1 kvm

binfmt_misc         20480  1

parport_pc          32768  0

ppdev               20480  0

lp                  20480  0

parport             49152  3 lp,ppdev,parport_pc

autofs4             40960  2

hid_generic         16384  0

usbhid              49152  0

hid                118784  2 hid_generic,usbhid

amdkfd             131072  1

amd_iommu_v2        20480  1 amdkfd

radeon            1515520  47

i915              1208320  2

ttm                 98304  1 radeon

i2c_algo_bit        16384  2 i915,radeon

drm_kms_helper     155648  2 i915,radeon

syscopyarea         16384  1 drm_kms_helper

sysfillrect         16384  1 drm_kms_helper

psmouse            131072  0

e1000e             237568  0

sysimgblt           16384  1 drm_kms_helper

ahci                36864  2

fb_sys_fops         16384  1 drm_kms_helper

libahci             32768  1 ahci

drm                364544  8 ttm,i915,drm_kms_helper,radeon

ptp                 20480  1 e1000e

pps_core            20480  1 ptp

fjes                28672  0

video               40960  1 i915

 

Serial Cable Hookup:


usb-to-ttl-serial-cable-for-raspberry-pi-debugging.jpg

Posts: 562
Registered: ‎09-18-2015

Re: Raspberry Pi USB to Serial Connection issues!

Hi @cumorris,

 

Can you determine if your USB-to-serial adapter works with anything else?

 

Just because the CP2102 enumerates on your host PC doesn't mean you have the console serial port end of things working on your RPi.

 

I know from personal experience with plenty of other embedded ARM boards (I used to work at Marvell and had my hands on all different kinds of these things) that there are all sorts of things that can go wrong.

 

For starters, you need to make sure your Linux kernel is being booted with a command line that specifies the appropriate serial port for the console, e.g. something like "console=ttyS2,115200". The only thing this will guarantee that you get are all the system boot-up messages (assuming you don't have some kind of "silent" boot configuration).

 

This doesn't necessarily mean you will get a shell login prompt. For that, you'll need the appropriate configuration for your init system, like systemd (yuck) or classic System V init.

 

Also, you're using Ubuntu, so I'll take some pity on you for that Smiley Tongue and suggest that you go with Arch instead. They have much better documentation than Ubuntu, and I ended up fixing a lot of things under Ubuntu when I had to use it by finding the solution on the ArchWiki.

 

I'm guessing that you can probably connect to the RPi with a USB keyboard and an appropriate HDMI display. Assuming you can do that, I'm guessing you can also probably get a console. If so, check in /dev to confirm that the RPI's console serial port is actually present. If it's there, do this...

 

cat /dev/urandom > /dev/ttyS0

...substituting the appropriate console serial port for ttyS0. This will run ad nauseum, allowing you to put a scope probe on the TX pin to see if there's activity. Assuming there is, you could check the same during boot to see if your start-up messages are getting dumped, in which case, something's going on with your host PC.

 

John