The Cranky Sysadmin A world of technology, fun, and ignorant rants.

May 25, 2009

Bluetooth GPS with Ubuntu 9.05

Filed under: System Administration — Cranky Sysadmin @ 12:09 pm

While going through my junk throwing stuff out or making excuses for not throwing stuff out, I came across a bluetooth GPS unit which I had forgotten about. This unit is the Holux GPSlim 240. It’s compact and it picks up sattelites pretty quickly. I decided to try connecting it to my laptop which runs Ubuntu 9.04. The most useful references I found were this Ubuntu forum post and this post for a holux specific problem. Below are the steps I took to get everything working:

Get the packages:

~$ sudo apt-get install gpsd gpsdrive

Turn on your gps unit and wait a few seconds (5 for the GPSlim 240). Run the following to discover the device:

~$ hcitool scan
Scanning …
00:0B:0D:6D:BC:5E    HOLUX GPSlim240

Save the address. It will be differentt then mine. Run the following command with your address and look for the channel number:

~$ sdptool browse 00:0B:0D:6D:BC:5E
Browsing 00:0B:0D:6D:BC:5E …
Service Name: SPP slave
Service Description: Bluetooth SPP V1.52
Service RecHandle: 0x10000
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

Append the following to /etc/bluetooth/rfcomm.conf. Replace the device address with yours from the “hcitool scan” command above. Replace the channel with the yours from the spdtool command above.

rfcomm4 {
bind yes;
device 00:0B:0D:6D:BC:5E;
channel 1;
comment “GPS”;

Restart bluetooth. For some reason, I have to stop it, wait a few seconds and restart it. A standard restart may work for you.

~$ sudo /etc/init.d/bluetooth stop
(wait a few seconds)
~$ sudo /etc/init.d/bluetooth start

Reconfigure the gpsd package to use our new device. For my Holux device, I need to set gpsd to use read-only (the -b switch), otherwise the gps unit stops functioning.

~$ sudo dpkg-reconfigure gpsd
Start gpsd automatically on boot?
Device the GPS receiver is attached to:
Should gpsd handle attached USB GPS receivers automatically?
Options to gpsd:

Run xgps to see if you can fix your location and see the satellite aquisition. Run gpsdrive for a map view. I leave actually using the data from the GPS as an exercise for the reader.


  1. I tried the above with my ALTINA GBT-709 GPS. after the 1st step when i type $ sdptool browse 00:0A:3A:24:AE:60, I only get
    Browsing 00:0A:3A:24:AE:60…

    Nothing further happens. Can you help?

    Comment by goile — July 27, 2009 @ 12:44 pm

  2. The only things I can think of are:
    1) ensure that your GPS is awake and not in some power save mode.
    2) make sure your computer’s bluetooth adapter hasn’t gone into some power save mode.
    3) restarting the bluetooth service may clear the problem.
    4) pretend the hang never happened and skip that step. In the next step, try to use Channel 1 as in the example above. If it still doesn’t work and you have the time, try a few other channels (2,3, etc).

    I don’t think I have any other suggestions at this point.

    Comment by John Jorgensen — July 27, 2009 @ 1:42 pm

  3. Thank you for the aforementioned suggestions.

    I tried them out but they didn’t work. I tried but couldn’t install bluez-pin (see below)

    ~$ sudo apt-get install bluez-pin
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    E: Couldn’t find package bluez-pin

    I then installed blueman 1.10-1~ppa3j, and ran it.

    In the device setup menu, I connected the GPS to serial port. I get a confirmation that the notebook is successfully connected to the serial port. The blinking light on the GPS also stops blinking and becomes steady – which indicates the GPS is sending information to the notebook. (It however does not identify the port number). However when I run xgps or gpsdrive there is no GPS information available.

    When I run the same Bluetooth GPS in Win-XP, and connect with SPP slave, it always connects hrough COM port 8, and the blinking light steadies as soon as GPS information begins showing on the notebook in the navigation software (SOBvMAX).

    I ran the same software (SOBvMAX) through WINE in Ubuntu 9.04, but again there is no GPS information available.

    Could it be possible that the GPS is sending information to the notebook, but I have not identified the port? If so how can I identify and configure the port?

    Where am I going wrong?

    Comment by goile — July 28, 2009 @ 11:59 am

  4. Thanks for your help.

    Further to my above;

    I disconnected from blueman and followed your advice from point “4” above, i.e. pretended the hang never happened and went on to the next step

    I used “rfcomm0”

    I have managed to get xgps and Gpsdrive working

    However when I run SOBvMAX through WINE, there is no GPS input to the program despite the steady light showing the GPS is connected to the notebook.

    SOBvMAX shows that ports COM 1, 2, 3, 4 are detected but no GPS input.

    Would appreciate some help with this specific problem.

    Comment by goile — July 30, 2009 @ 1:17 pm

  5. I haven’t used my GPS with wine, but here is a post from a guy who has:

    He makes a link in ~/.wine/dosdevices/ to rfcomm0 and wine apparently can use this to communicate with the GPS.

    Comment by John Jorgensen — July 30, 2009 @ 2:11 pm

  6. Thanks for the above. I also have seaclear working now (through wine). Still no success with SOBvMAX.

    Comment by goile — August 2, 2009 @ 4:11 am

  7. Thanks for the info. I also have a Holux GPSlim 240, and I am running Ubuntu 9.10. I followed the instructions, but GpsDrive doesn’t seem to capture the GPS data. It always shows “no gps data”. I look into the /dev/ directory but I don’t see ‘rfcomm4’. Additionally, by default, gpsd also adds “-F /var/run/gpsd.sock” as additional arguments.

    I ran the previous commands successfully with almost identical output (except for the device address, of course).

    Comment by Sparta — December 16, 2009 @ 8:24 pm

  8. Anyone tried this with 10.04? And a Holux M-1000?

    Manually setting up rfcomm port and giving gpsd the -b option as above, gets me the M-1000 device recognised under bluetooth manager. This is progress, but despite device being configured ‘successfully’ and selecting it for use with geo-location services, alas, neither xgps nor tangogps seem to recognise it exists….. :(

    M-1000 works perfectly with my nokia e51, so must be on ubuntu side. A few others out there struggling with this too it seems.

    Comment by steve — September 19, 2010 @ 10:46 am

  9. One extra line seems to be needed:

    sudo rfcomm connect 4 (or 0, or whatever number you selected in rfcomm.conf)

    The blue light on your M-1000 will flash every 3secs indicating connection established, after which both xgps and tangogps should show you something interesting :)


    Comment by steve — September 19, 2010 @ 11:23 am

  10. One last tip – if you copy / paste the rfcomm.conf entry above, watch out in case the quotes are pasted wrongly going from browser to terminal window. You might get ‘syntax error line 22’ when trying to connect, in which case delete the quotes and type them in via the keyboard).

    Comment by steve — September 19, 2010 @ 11:26 am

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress