Psion serial port programs not allowing access to Garmin connection

Q I have only one serial port on my motherboard; I also have a Psion 5 and a Garmin Geko 201, both with serial connections. It seems that the programs associated with the Psion run in the background even if the Psion is not connected, and prevent the Garmin (and software, including GPSman) from accessing the serial port. Under Linux (Kubuntu Edgy) the top command doesn't bring up any Psion-related apps that I recognise, and neither does ps -aux. Could you tell me which processes might be hogging the port while KPsion is installed, and how to shut them down without removing the KPsion packages? If all else fails I suppose I could just buy a PCI serial card!

A Remember the Unix mantra 'everything is a file'? Well it works here, because your serial port can be treated as a file and the lsof command lists open files. With no arguments, it lists all open files on your system, and you'll probably be surprised how many there are on a running Linux system (over 7,000 as I type this). You can narrow things down by specifying the name of the file; in your case, this is probably /dev/ttyS0, the first serial port. Take a look at the following code:

sudo lsof /dev/ttyS0
COMMAND PID USER FD TYPE DEVICE
SIZE NODE NAME
belkin 9758 nut 4u CHR 4,64                 5134 /dev/ttyS0

This example shows that my serial port is used by the monitoring software for my UPS. In your case it will show the program that has a lock on the port, preventing anything else from using it, which is probably something to do with KPsion. It is possible that the program is using a symlink to /dev/ttyS0, such as /dev/modem or /dev/psion. You can see what links to /dev/ttyS0 with

ls -l /dev/ | grep ttyS0

Try running the links through lsof too. It is also worth checking to see just what is being run automatically when you boot. The Ubuntu variants, like most Debian derivatives, use runlevel 2 by default, so

ls -1 /etc/rc2.d

will show which programs are being started. If you want to add a serial port, the cheapest (and often easiest) way is to buy a USB-to-serial adaptor. These are available on eBay for a few pounds and generally 'just work' when you plug them in. Some even advertise Linux compatibility on eBay no less!

Follow us on Identi.ca or Twitter

Username:   Password:
Create Account | About TuxRadar