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.
For 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.
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.
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 +|
|| GPIO 14 (UART TXD)
|| GPIO 15 (RXD UART)
Then we are going to install ckermit, a software to control the serial port.
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.
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.
If 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.