gpsd
Bluetooth connections work with gpsd
by leveraging the
rfcomm serial port emulation. Rfcomm provides a serial port interface
to a BT device and has been designed to allow for automated
connect/disconnect operations over Bluetooth. The steps below will
allow you to use your BT GPS device automatically whenever it is
powered on and gpsd is running.
Note that you must be logged in as root for most of these steps.
If your system comes with Bluetooth tools preinstalled (look for on your status bar) you can probably skip these steps.
First, the Bluez protocol stack must be installed. All the documentation can be found on http://bluez.sourceforge.net/.
Install bluetooth for your device with the "rfcomm" module to allow for serial port emulation.
Next, load the modules:
# modprobe hci_xxx (xxx depend on your type of device) # modprobe bluez # modprobe l2cap # modprobe rfcomm
If the modules have loaded successfully, type "hciconfig" and you should see your BT interface listed under the "hci0" name.
Turn on your BT GPS device and scan for remote BT devices:
# hciconfig hci0 up # hcitool scan
Write down the address of your BT GPS receiver (xx:xx:xx:xx:xx:xx)
Set up rfcomm. Edit /etc/bluetooth/rfcomm.conf to reflect your BT GPS address and to enable binding.
# # RFCOMM configuration file. # # $Id: rfcomm.conf,v 1.1 2002/10/07 05:58:18 maxk Exp $ # rfcomm0 { # Automatically bind the device at startup bind yes; # Bluetooth address of the device device xx:xx:xx:xx:xx:xx; # RFCOMM channel for the connection channel 1; # Description of the connection comment "Your GPS Device Here"; }
Bind rfcomm0 (unless you are planning to reboot, in which case it will be automatically bound).
# rfcomm bind rfcomm0
Under most Linixes, GPSD is by default configured to start gpsd on a hotplug event announcing a USB GPS. You need to reconfigure the GPSD installation so the daemon will be started at boot time listening to /dev/rfcomm0 (it will still work with hotplugged USB GPses after you do this).
Under Debian and Ubuntu Linux, "dpkg reconfigure gpsd"
will start a dialog that will reconfigure the device for you. You
will need to reboot for this change to take effect.
At this point, your system should be configured to use gpsd with your BT GPS device. You should test operation in the normal way described in the Troubleshooting Guide.
On system startup, gpsd starts before rfcomm0 is bound by rfcomm and fails (at least on some systems) - a workaround for this is to add a symlink to the gpsd init.d script to a later runlevel.
# cd /etc/rcS.d/ # ln -s ../init.d/gpsd S89gpsd
In February 2009 it was reported that there are some issues with the Bluetooth stack in Ubuntu Intrepid. This report advocates using a different Bluetooth device manager and describes some additional udev rules.
Jean-Michel Bouffard
Joshua Layne
Lukasz Stelmach
Bertolt Loprets