BluetoothGPS

BluetoothGPS on *ubuntu

To get your Bluetooth GPS receiver to work on ubuntu, we need to install some packages:

sudo aptitude install bluez-pin bluez-utils gpsd gpsd-clients gpsdrive

Edit the bluetooth config file:

sudo vim /etc/bluetooth/hcid.conf

Overwrite the content (delete everything in the file) and insert the following:

#
# HCI daemon configuration file.
#

# HCId options
options {
        # Automatically initialize new devices
        autoinit yes;

        # Security Manager mode
        #   none - Security manager disabled
        #   auto - Use local PIN for incoming connections
        #   user - Always ask user for a PIN
        #
        security user;

        # Pairing mode
        #   none  - Pairing disabled
        #   multi - Allow pairing with already paired devices
        #   once  - Pair once and deny successive attempts
        pairing multi;

        # PIN helper
        pin_helper /usr/bin/bluepin;

        # D-Bus PIN helper
        #dbus_pin_helper;
}

# Default settings for HCI devices
device {
        # Local device name
        #   %d - device id
        #   %h - host name
        name "Nino's Laptop";

        # Local device class
        class 0x3e0100;

        # Default packet type
        #pkt_type DH1,DM1,HV1;

        # Inquiry and Page scan
        iscan enable; pscan enable;

        # Default link mode
        #   none   - no specific policy 
        #   accept - always accept incoming connections
        #   master - become master on incoming connections,
        #            deny role switch on outgoing connections
        lm accept;

        # Default link policy
        #   none    - no specific policy
        #   rswitch - allow role switch
        #   hold    - allow hold mode
        #   sniff   - allow sniff mode
        #   park    - allow park mode
        lp rswitch,hold,sniff,park;

        # Authentication and Encryption (Security Mode 3)
        #auth enable;
        #encrypt enable;
}

Restart the bluetooth services:

sudo /etc/init.d/bluez-utils restart

Under Kubuntu it is this command instead:

sudo /etc/init.d/bluetooth restart

Now scan for present devices:

hcitool scan

It should output the bluetooth receiver like this:

elav1@elav1-desktop:~$ hcitool scan
Scanning ...
        00:0A:3A:1F:C9:C9       BT GPS

Save the 12 digit MAC address! - You will need it later in this howto!

Find out with channel the serial port is located at:

sdptool browse 00:0A:3A:1F:C9:C9

It should output something like this:

Browsing 00:0A:3A:1F:C9:C9 ...
Service Name: Bluetooth Serial Port
Service RecHandle: 0x10007
Service Class ID List:
  "Serial Port" (0x1101)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 1
Language Base Attr List:
  code_ISO639: 0x656e
  encoding:    0x6a
  base_offset: 0x100
Profile Descriptor List:
  "Serial Port" (0x1101)
    Version: 0x0100

In the above case, it's on channel 1 (see line 9) - If you don't get any output, just try channel 1!!!

Now edit the rfcomm config:

sudo vim /etc/bluetooth/rfcomm.conf

Add this to the bottom of the file:

rfcomm4 {
        bind yes;
        device < GPS MAC ADDRESS>;
        channel 1;
        comment "Serial Port";
        }

Establish a connection:

sudo rfcomm release 4
sudo rfcomm connect 4

This wikipage is not done... Follow this howto instead:

http://ubuntuforums.org/showthread.php?t=200142

BluetoothGPS (last edited 2008-08-06 16:34:55 by localhost)