It’s becoming increasingly common for laptops and other mobile devices to incorporate GPS facilities, and for more and more software applications—both installed on the machine, and Web-based—to have the ability to make use of positioning data.
From time to time, since I acquired my Eee 701, I’ve thought how it might be handy to link it up to a GPS receiver, as even a 7″-wide screen is larger than the display on my Nokia N95 GPS-equipped “smartphone” (which I’ve used for navigation until now). Seeing as the 701 obviously doesn’t have GPS built-in—and I’m not the type to start “modding” my Eee to put a GPS unit in!—this obviously leaves me with a few options for external GPSes:
- A USB GPS “dongle”—these can be found for under £20 if you search online, but they require physical connection to the computer, and you’d probably need a USB extension cable to place the unit where it can get a position fix.
- A “proper” GPS unit (e.g. the Garmin eTrex)—far more likely to get a “lock” on the satellites quickly (and keep it), but they cost more, and many of these units have only a serial (RS232) port for a cable connection, so a USB-serial adapter cable would probably be required.
- A Bluetooth GPS receiver—these have come down in price (under £30 online) and are often small enough to fit on a keyring, but I have read that they are barely better than a mobile phone in terms of acquiring and holding a position fix.
None of these options were really ideal for me, not least because I didn’t think I could justify buying any of them. Then, not so long ago, I realised I had been overlooking the obvious: is there a way to access my phone’s position data from my Eee, as if the Nokia were a dedicated GPS unit?
With my Nokia N95, the simple answer is: yes, but not out of the box (at least, not that I was able to find). Thanks to Ken Murray’s excellent HOWTO “How to share the GPS in your N95 with your laptop via Bluetooth in Linux” (from which I took quite a few tips for this article), I found Symarctic ExtGPS, a Java applet which works perfectly on the N95. In short, ExtGPS hooks into the phone’s GPS receiver and basically turns it into a Bluetooth GPS unit.
For what follows, I’m going to assume you have the following hardware:
- An Eee (or other laptop) running Linux—obviously, I have an Eee 701SD running Eeebuntu v3 at time of writing, but most of the following is probably transferable with some effort.
- I’m also assuming that you have some experience with using Bluetooth on your machine, and that the Bluetooth software stack is running with no problems.
- If your Linux system doesn’t already include it (as Eeebuntu v3 doesn’t, though Eeebuntu 4 and Ubuntu Lucid Lynx do), I strongly recommend installing Blueman (a Bluetooth manager for GNOME) via your package manager, as it improves massively over
bluez-gnome(the default in Eeebuntu 3) in many ways, and will simplify the Bluetooth part of the setup considerably. The instructions below will tell you how to connect the Eee to the N95’s GPS using Blueman; if you prefer to use the command line, Ken Murray’s HOWTO above gives you further details.
- A Symbian-based mobile phone with GPS capability, such as my Nokia N95—again, you may be able to do the following with another phone platform like Android, but you’re on your own working that out 😉
- A Bluetooth adapter—I’m using a cheap “nano”-type dongle, but it works well enough.
Using the package installation method you prefer (I go for apt-get or Synaptic), first install the
gpsd (the GPS ‘daemon’, or server) and
gps-clients packages, as these are the minimum requirements for most of what we’re going to do here. In a (technical) nutshell,
gpsd reads the data from the GPS receiver, and makes it available to applications on TCP port 2947. Amongst other benefits, this means that instead of one app hogging the GPS data, you can have multiple programs accessing it at once.
Now reach for your phone, and activate Bluetooth if it is not already running. Assuming you have downloaded and installed ExtGPS on your phone, start the program from the “Applications” menu. The phone will take a few moments to lock onto the GPS signals and acquire a fix, at which time the “middle” of the three status readouts will show a green “light”, and a message along the lines of
Satellite: Fix NMEA-0183.
Go back to the Eee and start Blueman (or check whether there’s a Bluetooth icon in the top panel), then left-click on the icon to bring up the Blueman interface window. Your machine should scan the local area for Bluetooth devices; when it locates your phone, right-click on it in the list and select “Refresh Services”. This tells your computer to retrieve the list of Bluetooth services your phone advertises.
Now, right-click again on your phone, and bring up the “Serial Ports” sub-menu. If all is well, you should see “Symarctic GPS” in the list; if not, refresh the services list again. Select “Symarctic GPS”, and a Bluetooth connection will be made between your computer and the phone’s GPS receiver. (Blueman should display a message like “Serial port connected to /dev/rfcomm0”; remember the latter detail, as this is the virtual serial port you’re connected to, and you’ll need it in a moment.)
Whilst you could connect directly to this port if your application allows it, most Linux apps which use GPS prefer to connect to
gpsd, so we need to start this daemon. This is done like so:
sudo gpsd -N /dev/rfcomm0
-N flag means “run this in the foreground”; I suggest keeping this open in a terminal window as long as you need it, then use Ctrl-C to stop
gpsd when you’ve finished.
To test whether GPS data is being received from the phone, you can either telnet to port 2947 (
telnet localhost 2947) and look at what appears in the terminal, or you could launch
xgps (which is installed with
gps-clients) and achieve the same effect in marginally more style 😉
Phew—if you’ve made it this far and have positioning data streaming from your phone to your Eee over Bluetooth, congratulations! In the next instalment in this series, I’ll suggest some Linux apps for making practical use of this data, whilst concentrating on the one I personally find most useful.
Until next time…