(19 October 2009) I used "system", "administration", "synaptic package manager" to load and install the package "GPSD" version 2.38-lubuntu3. GPSD is a program which runs permanently (i.e. a DAEMON) after the first plugging-in of a GPS device; or at least that is what is supposed to happen. It didn't. Below you will find the fix for the start-up problem i.e. when you plug in a gps receiver gpsd starts up and listens to the receiver, permitting you to use other applications which depend on it. However, for at least the case of receivers emulating character interfaces using USB, unplugging and replugging the receiver will not allow you to continue using gpsd. I have not fixed the problem, but I think I know what the problem is. Below you will find the (lengthy) explanation.
I found GPSD 2.38-lubuntu installation places (amongst lots of other placements) the following files in the associated locations:
the rules in 40-gpsd.rules are fired when USB devices have information corresponding to common GPS devices. They are all "tty" (one character at a time) devices in that file. They cause the creation of a directory entry e.g. "gps1" in /dev and the execution of gpsd.hotplug.wrapper. Unfortunately on my Ubuntu this script fails (work on next version looks as if it may fix these) for 2 reasons:
Both these are easy to fix for yourself for Ubuntu 9.04 a.k.a "Jaunty". Use a text editor (I use the nano editor); For example, in a terminal do "sudo nano /lib/udev/gpsd.hotplug.wrapper" then,
in place of the line:
. /lib/udev/hotplug.functions
put in the following to replace the missing function:
# This was formerly in /lib/udev/hotplug.functions
wait_for_file() {
[ -e "$1" ] && return 0
local count=0
while sleep 1; do
let count=count+1
[ -e "$1" ] && return 0
if [ $count -gt 60 ]; then
return 1
fi
done
}
If you are happy to disobey the "do not edit" instructions try "sudo nano /etc/default/gpsd" and change the word "false" to "true" for both USBAUTO and START_DAEMON variables. Now gpsd should load when you plug in a usb receiver. It will however remain running in the background when you unplug the receiver.
I wanted a "computer illiterate" to be able to plug/unplug the receiver in a car with minimal interaction (e.g. to take the computer into a house without having to reboot). The symptoms of my problems were:
Because I had fixed the "plug in" script I presumed that I had done something to upset the "unplug" scripts. Remember that this explanation applies to Ubuntu Jaunty netbook remix running on an eeepc - your mileage may vary.