Serial ports under linux

The first thing is to find out if your computer even has a serial port. These days more and more motherboards are coming out without serial ports. USB replaces serial ports, few people use traditional serial ports. I suppose it is justified.

Look for the usual 9 pin male connector (it may just be pins on the motherboard, requiring a cable to an "optional" 9 pin connector). Then you can determine what name linux gives to it via:

dmesg | grep tty
The computer I am presently using has one serial port called /dev/ttyS0. In the good old days you would have two ports: ttyS0 and ttyS1.

Kermit

Kermit used to be my tried and true software to run some kind of terminal emulator on linux. The problem is that kermit has some oddball licensing scheme that makes it impossible to bundle with standard linux distributions. I don't know what they are thinking, but what I am thinking is that I can no longer be bothered with downloading source code and building kermit. Kermit was nice and pretty simple to use, but the kermit developers were busy trying to make it an alternative to TCP networking, answering a question nobody was asking.

Minicom

The good news is that minicom is still bundled with almost every linux distribution and can fairly easily be pressed into service. It has its own idiosyncracies, which aren't too bad once you find out what they are. It defaults to trying to talk to /dev/modem - which essentially nobody is using these days. You fire it up with the "-s" switch as "minicom -s" and it will present you with a setup dialog. Select "Serial port setup" and specify /dev/ttyS0 and 9600 baud. Then I save the setup as default (dfl), but you can also give a setup a name and then use the name to start minicom as "minicom myname".

Minicom thinks it needs to initialize and reset the modem, which is always total brain damage for what I want to do. The way to fix this is to clear out the modem init and reset strings. Use minicom -s to access the setup menu. Select "Modem and dialing" and then clear the two strings. Be sure and save the setup.

Minicom uses Control-A as its trigger character. Typing Control-A followed by Z gives you help (a menu of letters you can type instead of the Z after the Control-A). One that is worth mentioning is "Q" which tells it to exit without a reset.

On my system, I do all this as root. Trying to run minicom as a regular user encounters permission problems accessing /dev/ttyS0. Running as root works for me, but you may want to investigate fiddling with the permissions on /dev/ttyS0 (which probably involves screwing around with udev setup on a current linux system).


Have any comments? Questions? Drop me a line!

Adventures in Computing / tom@mmto.org