Difference between revisions of "RPi Serial Connection"

From eLinux.org
Jump to: navigation, search
(First interaction with the board)
(First interaction with the board)
Line 8: Line 8:
 
'''Note that the Raspberry has no PREBUILT COM port.  Soldering/protoyping and technical knowledge is required ! '''  
 
'''Note that the Raspberry has no PREBUILT COM port.  Soldering/protoyping and technical knowledge is required ! '''  
  
A UART is available in the Broadcom SoC, and its RxD and TxD lines are available on the [[RPi_Low-level_peripherals|GPIOs]] but you need a board or cable to convert 3.3V UART signals to RS-232. They do however could connect directly to a USB serial legacy device, provided it uses 3V3 levels. If the device uses 5V levels you will need level converters (which could be simple resistor dividers, or could be specific IC's)  See [http://codeandlife.com/2012/07/01/raspberry-pi-serial-console-with-max3232cpe/ this tutorial] for one example on how to build 3.3V to RS-232 levels converter with a breadboard, MAX3232CPE and five 0.1 uF capacitors.
+
A UART is available in the Broadcom SoC, and its RxD and TxD lines are available on the [[RPi_Low-level_peripherals|GPIOs]] but you need a board or cable to convert 3.3V UART signals to RS-232. They do however connect directly to a USB serial legacy device, provided it uses 3V3 levels. If the device uses 5V levels you will need level converters (which could be simple resistor dividers, or could be specific IC's)  See [http://codeandlife.com/2012/07/01/raspberry-pi-serial-console-with-max3232cpe/ this tutorial] for one example on how to build 3.3V to RS-232 levels converter with a breadboard, MAX3232CPE and five 0.1 uF capacitors.
  
 
Connect the serial cable to your COM circuitry , and connect the other end to the COM port or USB Serial Adapter in the computer.
 
Connect the serial cable to your COM circuitry , and connect the other end to the COM port or USB Serial Adapter in the computer.

Revision as of 21:00, 1 July 2012

Back to RPi Advanced Setup.

The Serial Port is a low-level way to connect to the Raspberry Pi. The communication depends on byte wise data transmission and is generally available even before boot time.

First interaction with the board

Note that the Raspberry has no PREBUILT COM port. Soldering/protoyping and technical knowledge is required !

A UART is available in the Broadcom SoC, and its RxD and TxD lines are available on the GPIOs but you need a board or cable to convert 3.3V UART signals to RS-232. They do however connect directly to a USB serial legacy device, provided it uses 3V3 levels. If the device uses 5V levels you will need level converters (which could be simple resistor dividers, or could be specific IC's) See this tutorial for one example on how to build 3.3V to RS-232 levels converter with a breadboard, MAX3232CPE and five 0.1 uF capacitors.

Connect the serial cable to your COM circuitry , and connect the other end to the COM port or USB Serial Adapter in the computer.

RaspPi UART tutorial (please add others if you find any)

You may also use a USB to Serial Adaptor as second option.

What about USB debugging (KBD) ?

Serial Parameters

The following parameters are needed to connect to the Raspberry. All parameters except Port_Name and Speed are default values and may not need to be set.

  • Port_Name: Linux automatically assigns different names for different types of serial connectors. Choose your option:
    • Standard Serial Port: ttyS0 ... ttySn
    • USB Serial Port Adapter: ttyUSB0 ... ttyUSBn
  • Speed: 115200
  • Bits: 8
  • Parity: None
  • Stop Bits: 1
  • Flow Control: None

The Serial Port is generally usable by the users in the group dialout. To add oneself to the group dialout the the following command needs to be executed with root privileges:

 $useradd -G {dialout} your_name 
  • Super Easy Way Using GNU Screen

Enter the command below into a terminal window

 screen Port_Name 115200
  • Super Easy Way Using Minicom

Run minicom with the following parameters:

minicom -b 115200 -o -D Port_Name
  • Tedious Old-Fashioned Way Using Minicom

Another method to setup minicom is described in the Tincantools Minicom Tutorial


  • GUI method with GtkTerm

Start GtkTerm, select Configuration->Port and enter the values above in the labeled fields.


  • Windows Users

Windows Users above Windows XP must download putty, TeraTerm or a comparable terminal program. Users of XP and below can choose between using putty and Hyperterminal.

First Dialog

If you get the prompt below, you are connected to the Raspberry Pi shell!

 prompt> #

First command you might want try is "help":

 prompt> # help

If you get some output, you are correctly connected to the Raspberry Pi! Congratulations!