Raspberry PI and GPIO pins: Controlling Raspberry through console serial port

With the second installment on affordable home automation based on Raspberry PI still to come, today I want to show how to access through the serial port to a terminal of our Raspberry PI; This can be useful in many situations.

OLYMPUS DIGITAL CAMERAFor example in the case of do not have a keyboard or a screen, making it impossible to enable the server SSH, We will be able to access this form; or if our Raspberry will not start but the LEDs State ignited properly, with this method we can see the error message to identify why.

Raspberry PI has a port UART for communications in series TTL, that we should convert to the standard serial RS232 using a plate like the following to connect to our serial port.

Screenshot of 2014-11-15 23:03:18

There are also cables that do the same function that this plate, but rather than offer connection via serial port RS232, connected directly to a port USB the computer and are more expensive; I'm going to use a serial port adapter RS232 to USB He already had.


Some converters modules of TTL to RS232 not they should feed externally under any circumstances since they receive the power from port series, and we could burn our Raspberry PI by supercharging; in our case we will use a converter based on chip SP3232EEN, that if we feed from Raspberry through pin VCC Converter plate.

Pinout and wiring diagram extracted from the datasheet of SP3232E, identical to SP3232EEN.

Pinout and wiring diagram extracted from the datasheet of SP3232E, identical to SP3232EEN.

The converter plate (or cable) We must connect it to the pins GPIO reserved for communication UART, What are the pins 14 (TXD), and 15 (RXD) as we can see in this table and the following connection diagram.

Plate TTL to RS232 converter Raspberry PI models to, B, A +, B +
+ 5V

Connection diagram.

Then we are going to install ckermit, a software to control the serial port.

usuario@maquina:~$ sudo apt-get install ckermit

The first thing we must do is to tell the device that will work; in my case is an adapter USB to RS232, Therefore the assigned route is /dev/ttyUSB0 and with the option -l We are going to indicate to connect.

usuario@maquina:~$ sudo kermit -l /dev/ttyUSB0

Once opened ckermit, It only remains to establish the parameters for the connection; We see as.

(/home/usuario) C-Kermit> set speed 115200
(/home/usuario) C-Kermit> set parity none
(/home/usuario) C-Kermit> set flow-control none
(/home/usuario) C-Kermit> set carrier-watch off
(/home/usuario) C-Kermit> connect
Connecting to /dev/ttyUSB0, speed 115200
 Escape character: Ctrl-\ (ASCII 28, FS): enabled
Type the escape character followed by C to get back,
or followed by ? to see other options.

Now press the key “Enter“, and we will see a summary of the errors which have taken place at the start of the Raspberry, and finally the prompt to log.

PB150032Just enter the user and the password, and we are already inside.

Screenshot of 2014-11-15 23:38:23If you like you can follow me on Twitter, Facebook, Google +, LinkedIn, or share it with the buttons under this publication, If you have any questions or suggestions please do not hesitate to comment.

Help us to reach more readers Share on LinkedIn
Share on Facebook
Tweet about this on Twitter
Share on Google+
Google +
Email this to someone

Leave a Reply

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