3

I've been trying to connect to the serial console of a Raspberry Pi 3 with Android Things using USB to TTL cable from my Linux (Ubuntu) machine. Despite I connected the cable as per the documentation, all I get when executing the minicom command is the following

enter image description here

with no chance to type in any character. So I neither can see any kernel messages nor shell into the device.

What am I missing?

Onik
  • 19,396
  • 14
  • 68
  • 91

3 Answers3

5

Linux (Ubuntu)


What's in?

  • GNU Screen
  • Minicom
    • minicom one-line-command (short answer)
    • minicom UI (long answer, detailed)

GNU Screen

Run in terminal

sudo screen port_name 115200

See below (step 2) to find out port_name, e.g /dev/ttyUSB0. Hit Ctrl-A, then K, then Y to exit screen. Execute sudo apt-get install screen if not installed.


Minicom

  • Short answer

Run in terminal

sudo minicom -b 115200 -o -D port_name

See below (step 2) to find out port_name, e.g /dev/ttyUSB0. Hit Ctrl-A, then X to exit minicom.

  • Long answer (UI)

minicom should be properly configured in order to open the connection. The general steps are as follows:

  1. Install minicom with

    sudo apt-get install minicom
    
  2. Connect Rpi3 with your host machine using USB-to-TTL cable and open the terminal. Find the tty connections with

    dmesg | grep -e tty
    

In my case I get

enter image description here

where ttyUSB0 is the board.

  1. Run minicom and select the serial port setup with

    sudo minicom -s
    

You should see

enter image description here

  1. Check (or set) the settings for the tty connection. Make sure that /dev/ttyX corresponds to your connection, the one you get in the step 2 instead of X, and Bps/Par/Bits set as per the documentation.

Similar to

enter image description here

  1. Now hit Exit and, if everything had been properly set up, the connection should be running. If you type the ls command you should see Android Thing's root directory

enter image description here

  1. For exiting minicom hit Ctrl-A, then hit Q, then Yes:

enter image description here

Onik
  • 19,396
  • 14
  • 68
  • 91
1

Windows (with PuTTY)

  1. Install PuTTY
  2. Connect the board to machine with USB-to-TTL cable and find out the COM port using Windows Device Manager. You should look for the the one called USB Serial Port (in my case it was COM3).
  3. Run PuTTY and set it up. Use the speed as per the documentation (115200):

enter image description here

  1. Hit Open and type a command in a terminal window popped up.
Onik
  • 19,396
  • 14
  • 68
  • 91
1

I'm going to suggest some troubleshooting advice based in my own experience:

Make sure you have the Tx and Rx cables connected correctly because all the other settings won't give you any warning, minicom would connect beautifully to the USB adapter but no info on your screen from your Pi.

I didn't use a USB to TTL like the one you are using, mine has the labels for Tx and Rx inverted on the board. Took me some time and the help of an oscilloscope to figure out what was going on.

Leonardo
  • 11
  • 2
  • TX and RX aren't mislabelled - you *should* connect TX to RX and RX to TX. One serial port's transmit is the other's receive. – fadedbee Oct 29 '20 at 10:58
  • @fadedbee some cheap USB adapters do indeed have the TX RX pins wrongly labeled (inverted) and I don't think you took a peek at mine to support your statement. – Leonardo Dec 17 '20 at 23:31
  • Sorry, I should have posted my comment as a potential answer, responding to your answer. I'm sure your board is mislabelled. – fadedbee Dec 18 '20 at 09:41