Wednesday, February 13, 2013

Raspberry Pi - Connecting Up A Dumb Serial Terminal

 
** Edited Feb 18, 2014 **

A dumb serial terminal (or a PC emulating one) is a handy thing to connect to the rPI for a number of reasons:
 
- when rPI is booted, boot messages are displayed
- you can log in to the rPI from it
- it allows you to connect to and change / debug / update a rPI with no keyboard / monitor that is being used as an embedded controller (perhaps a model B with no Ethernet)
 
Since the rPI uses 3.3 volt logic and a standard PC serial port with a terminal emulator program such as TerraTerm uses the RS232 and ASCII standards, you need to get a converter that converts 3.3 volt levels to RS232.
 
I found this one on eBay from seller skt_flyer:
 
 
If this one is no longer available, there should be lots more, just make sure you get one that works with 3.3 volt power and logic level.

It has pins that connect into my breadboard, you connect the RX, TX, 3.3 volt power and ground to the appropriate pins of the Raspberry Pi. I am not using the CTS/RTS pins for handshaking.
 
From the converter I go thru a null modem cable and then a serial cable to a PC running a terminal emulator program. This is always the fun part about hooking up RS232, you have to worry about the DTE / DCE conventions

I have an old laptop that has a real 9 pin PC serial port, if you don't have that you can use a USB to Serial adapter cable.

From the software perspective on the Raspberry Pi, if you have disabled the serial port from spawning a login process you have to enable it again. In the file /etc/inittab on the rPI, if you commented out the line (as I did previously to use the serial port from python):

     #T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100

you have to restore it to the original

     T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100

This is described more fully in this article (which also discusses how to turn off all the boot messages going to the dumb terminal).

With everything set up like this and the terminal (or terminal emulator software) set for 115200 baud, no handshaking (since CTS/RTS are not used) when the rPI is booted the boot messages will scroll out on the terminal. They you will get a login prompt and can login.

If you are looking for a good Terminal Emulator software for windows, try the open source TerraTerm, which defaults to VT100 emulation.


Eric Pierce VA3EP - See the Disclaimer in the Introduction

© Eric Pierce and "VA3EP Amateur Radio And Other Geek Pursuits", 1952-2099. Unauthorized use and/or duplication of this material without express and written permission from this blog’s author and/or owner is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to Eric Pierce and "VA3EP Amateur Radio And Other Geek Pursuits", with appropriate and specific direction to the original content.



No comments:

Post a Comment