Connecting to your Raspberry Pi via the USB

print
Raspberry Pi Workshop                                          About Chat B+ Pinout Location Contact

  1. Connecting to your Raspberry Pi via the USB to TTL Serial Cable

Aug 31, 2014

Overview

Despite having four full sized USB ports and one micro USB port (for power), you can’t connect to your Raspberry Pi from your computer via USB (without additional hardware).

You can however connect to your Raspberry Pi via a “USB to TTL Serial Cable”, also sometimes called a console cable. This cable allows you to access the command line of your Raspberry Pi, by plugging the USB end into your computer and the other end into speci鞎c serial GPIOs on the Raspberry Pi.

What you’ll need

For this exercise you’ll need a console cable:

Make sure you use this speciໄc cable with 3.3V logic, as other TTL cables at higher voltages may fry your Raspberry Pi

Software Installation (Mac)

Mac OS X includes a Terminal (inside /Applications/Utilities/), so the only other software you need to install is the drivers for the cable.

You can download the drivers here.

Software Installation (Windows)

Windows does not include a Terminal application that you can use to connect over serial.

For this workshop we’ll use Putty. You can get the “putty.exe” app from the putty website.

Download the one called “PuTTY” under For Windows on Intel x86 (direct link).

Putty downloads as an uncompressed binary.

Now that you’ve got Putty, you’ll also need to install the FTDI drivers.

Software Installation (Linux)

Assuming you’re running a v2.6 kernel or later you shouldn’t need to install drivers for the cable. If you 鞎nd that your distribution doesn’t have the drivers installed you can download the drivers from the FTDI website.

You may also need to install screen. The screen command (some Linux distributions such as Ubuntu 12.10 don’t include the screen software). To see if you’ve got screen installed type screen and if you get an error install screen by running: sudo apt­get install screen.

Connecting the cable

The console cable handily provides the name of the line on the side of the terminal header.

Connect the console cable to the following pins:

VCC → RPi Pin 02 (DC Power 5V)

GND → RPi Pin 06 (Ground)

RXD → RPi Pin 08 (TX)

TXD → RPi Pin 10 (RX)

Connecting via the Shell

Bringing up the Shell On Mac / Linux

TL;DR:

bash‐3.2$ screen /dev/cu.usbserial‐A800I4BG 115200                              [screen is terminating]                                                         bash‐3.2$ exit                                                                  exit

$://showterm                                  slow fast stop ? [ ]

If you’re running Mac OS X all you need to do is open a Terminal window and run screen in the command line using the command: screen /dev/cu.usbserial­A800I4BG 115200 screen is the command. /dev/cu.usbserial­A800I4BG is the path to your FTDI serial device and 115200 is the baud rate (the speed at which we send data across the serial interface).

If you’re on Linux you’ll need to escalate your privileges by putting sudo in front of the command. E.g:

sudo screen /dev/cu.usbserial­A800I4BG 115200

Bringing up the Shell on Windows

If you’re running Windows, you’ll need to 鞎nd out what com port the console cable is using.

 

1 Search for Device Manager

  1. Expand the Ports (COM & LPT) section

You now need to open putty

1 Select Serial as the connection type

  1. Enter the name of the COM port you’ve found 3 Set the speed to 115200

4 Click Open and you should see the terminal

Logging In

Once you’ve brought up the shell, you’ll be faced with a login prompt. You can log into your Raspberry Pi with the following credentials:

username: pi password: raspberry

Ok we’re in! Let’s have a look around in the next tutorial.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.