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.

Installation

If your system comes with Bluetooth tools preinstalled (look for on your status bar) you can probably skip these steps.

  1. First, the Bluez protocol stack must be installed. All the documentation can be found on http://bluez.sourceforge.net/.

  2. Install bluetooth for your device with the "rfcomm" module to allow for serial port emulation.

  3. Next, load the modules:

    	# modprobe hci_xxx (xxx depend on your type of device)
    	# modprobe bluez
    	# modprobe l2cap
    	# modprobe rfcomm
    

  4. If the modules have loaded successfully, type "hciconfig" and you should see your BT interface listed under the "hci0" name.

Configuration

  1. Turn on your BT GPS device and scan for remote BT devices:

  2. 	# hciconfig hci0 up
    	# hcitool scan
    
  3. Write down the address of your BT GPS receiver (xx:xx:xx:xx:xx:xx)

  4. Set up rfcomm. Edit /etc/bluetooth/rfcomm.conf to reflect your BT GPS address and to enable binding.

  5. 	#
    	# 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";
    	}
    
  6. Bind rfcomm0 (unless you are planning to reboot, in which case it will be automatically bound, but there is really no reason to reboot).

  7. 	# rfcomm bind rfcomm0
    
  8. Edit /etc/init.d/gpsd so that it automatically starts up listening to /dev/rfcomm0

    	...
    	#GPS_DEV="/dev/ttyS3"
    	GPS_DEV="/dev/rfcomm0"
    	...
    
  9. Restart gpsd to apply the change above

    	# killall -HUP gpsd
    
  10. Connect to gpsd to test

    	# telnet localhost 2947
    	# r
    

    You should see NMEA sentences stream by. Close telnet.

    	# ^c
    	# e
    

At this point, your system should be configured to use gpsd with your BT GPS device!

Known Issues:

Contributors: