How to connect Ubuntu laptop to GPS on Android phone

I recently started a small project, that quickly turned out to be a lot harder than I initially thought: Using my Android phone’s GPS from my laptop. I tried to follow almost every guide I could find on the net, but I couldn’t make any of them work with my setup: Laptop running Ubuntu 11.04 and phone is running CyanogenMod 7.1 custom ROM based on Android 2.3.

In the end it turned out to be much simpler than any of the guides would suggest:

  • On the phone: Install the free GPS over BT from the Android Market.
  • On the computer you install the GPS service daemon gpsd and the gpsd-clients: sudo apt-get install gpsd gpsd-clients. Next I installed the Blueman Bluetooth Manager to set up the connection to the phone: sudo apt-get install blueman.

To configure the GPS daemon: sudo dpkg-reconfigure gpsd. Most of the settings you can just leave at the defaults, but notice that the GPS receiver should be attached to /dev/rfcomm0. Under options you just enter -b -n, then you should be ready to go.

  • Open GPS over BT on your phone and make the phone discoverable from your computer.
  • On your computer, open Blueman and select Setup new device, then pair it with your phone.

Then your phone will show up as paired, but not connected, and in GPS over BT on your phone the blue-tooth connection will be listed as working but not connected having a pale green color.

To establish the connection you right-click on your phone in Blueman and select Setup, then a dialog pops up where you select to connect to the Serial Port. Then you will see a confirmation that the device was added and connected succesfully, and a small notification will pop up telling that the serial port is connected and available via /dev/rfcomm0.

When the phone is connected you will see a green dot on the Blueman icon in the panel, and on your phone in GPS over BT the blue-tooth connection now have a clear green collor.

Now you’re ready to fire up your favorite GPS program. I like FoxtrotGPS, it is available in the Ubuntu repositories, but to get the latest version for Natty you should add the Ubuntu Finland PPA to your sources.list: sudo add-apt-repository ppa:ubuntu-fi/ppa

That’s it. You can now enjoy using the GPS on the bigger screen of your laptop.

Leave a comment