I recently had to make use of a GPS logger in Linux. Here’s how I made it work in Karmic, incase any one is interested:

  • First, make sure you have necessary bluetooth packages. If not, install it using:
    sudo apt-get install bluetooth
    sudo apt-get install libbluetooth-dev
  • Switch on the GPS, scan and check if you can find the device:
    sudo hcitool scan

The output would be something like the following:

Scanning ...
00:aa:bb:cc:dd:ee    BlueGPS CCDDEE

We are interested in the channel in which the device operates. Let’s find that out:

    sudo sdptool records 00:aa:bb:cc:dd:ee

This will give you lots of information about the device. Pay attention to the channel. For instance, my device says:

    Service Name: Dev B
    Service RecHandle: 0x10000
    Service Class ID List:
     "Serial Port" (0x1101)
    Protocol Descriptor List:
     "L2CAP" (0x0100)
     "RFCOMM" (0x0003)
     <strong>Channel: 1</strong>
    Language Base Attr List:
     code_ISO639: 0x656e
     encoding:    0x6a
     base_offset: 0x100
  • Use this channel to create an entry in the rfcomm.conf file:
        sudo gedit /etc/bluetooth/rfcomm.conf

enter the following at the end of the file:

    # Bluetooth GPS
    rfcomm2 {
        bind yes,
        device 00:aa:bb:cc:dd:ee,
        channel 1,
        comment "Serial Port",
    }

Once you have done this, you can connect to the device:

    $ sudo rfcomm connect 2
    Connected /dev/rfcomm2 to 00:aa:bb:cc:dd:ee on channel 1
    Press CTRL-C for hangup
        rtkgps -d /dev/rfcomm2 read