Raspberry Pi – Making a Serial Console Server

I have gotten far enough in the process of learning the Raspberry Pi that I was able to get to one of the more important projects for me and that was creating a Console Server that would allow me to access any network device by using it’s serial port. The process is very simple. The main thing is to use a Plugable USB to RS-232 DB9 Serial Adapter (Prolific PL2303HX Rev D Chipset)USB to Serial adapter. There are a host of these available. The one I used runs less than $15 on Amazon. You will see it in the video that accompanies this post. The main thing to remember here is that the PL2303 drivers are built into Raspbian and that makes one less thing that you have to download and install

To get the process started, I have installed a fresh copy of Raspian on a new SD card, plugged that into the RPi as well as the USB to Serial adapter. After everything is powered up and you have logged into the RPi, the next thing that you need to install is a serial communications application. The two most common I found are Minicom and Kermit. I went with Kermit for this particular post. You can install it by using sudo apt-get install ckermit.
YouTube Preview Image
We next need to use the lsusb command to verify that the USB to Serial cable is recognized by your RPi. Before running kermit for the first time, we need to know the virtual port number that is assigned to the cable you have plugged in. Using dmesg | grep 2303 will show you what tty port name and number have been assigned to the cable(s) you have connected. Once you have that information, start kermit by using kermit -l /dev/ttyUSB0 (or whatever the port number the dmesg command showed you and press enter. Use the connect command to initiate a session with the network gear that you have attached.

You may get an error message when you start kermit that it doesn’t see the carrier detect signal it would normally expect from a serial port. After using set carrier-watch off, you can use the connect command to get the session started with your network gear. To exit the session, type Ctrl-\ followed by C. You are dropped back to the Kermit prompt. Type exit to drop out all the way to the RPi prompt. To help avoid getting that message again, you can create a .kermrc file in the home directory you are working from. Do a sudo nano .kermrc and press enter. Type set carrier-watch off, save and exit from nano. The next time you startup kermit, you will get right in with no carrier watch warning. If you use the ls command, you won’t see the file, you will need to use the ls -all and then it will show up.

There are several commands that you can put in the .kermrc file. You can go here for more information – http://www.columbia.edu/kermit/ckututor.html#commands. I went with the most basic setup for now. Since I may have multiple serial to USB interfaces in place at some point, I wanted to keep the interface specific commands out for now until I get a better understanding of how to use this setup with a multiple USB to Serial cable configuration.

You will notice that I used ZOC as my terminal emulator on the Mac. In this case, it deal with the configuration I needed better than SecureCRT did. If there is interest, I will be happy to do produce other videos like this showing minicom and/or multiple serial devices being supported. Thanks for reading and viewing.

To see more of my posts about the Raspberry Pi, please go to http://www.ronnutter.com/category/raspberry-pi/

Send to Kindle
This entry was posted in Blog Entries, Cisco, Juniper, Raspberry Pi, Video Podcast and tagged . Bookmark the permalink.