GPS, Wi-Fi, UMTS and Google maps with gpsdrive on Linux

Just a quick post on my gpsdrive setup. I hadn't used it for a couple of years, but that didn't matter really as it hasn't changed much in that time either. The realtime downloadable map support is still only expedia.{de,com} but it would be cool to add in google too. I found a Spanish website where someone has done all the hard work generating a grid of google map URLs and I wrote a script to download and apply them to the coordinates file.

All the networking hardware was bought from Solwise, I wrote a script which automates the downloading and adding grids of google maps to gpsdrive. Next I want to plot position by GPS in real time within Google maps itself within firefox and upload WLAN APs dynamically, which will require a mobile internet connection, thereby an interesting alternative to gpsdrive. Would be cool to be able to run that in offline mode too. Will upload scripts, photos, screenshots etc of my current setup soon.

One time setup

  1. Configure system to connect to the GPS. If using bluetooth, see gps-start for details, configuring rfcomm.conf. Test: turn on GPS, as root run gps-start and "cat /dev/rfcomm1" should show NMEA sentences streaming by.

  2. Configure gpsd. If the gspdrive's gpsd is not working properly try the latest gpsd. Test: "telnet localhost 2947" and issue
    commands like "p" for position (the gpsd man page has details) and check reponses

  3. Configure the Wi-Fi card to use an appropriate driver which supports monitor mode (e.g. hostap, madwifi, ...). Test: change to monitor mode and check with iwconfig

  4. Configure Kismet (kismet.conf) for the card (e.g. "source=hostap,wlan0,wlan0", "waypointdata=%h/.gpsdrive/way_kismet.txt" and "suiduser=$your_username". Test: run kismet and check WLAN info

  5. Configure mysql for the database gspdrive will use to store WLAN AP and Geo data: using the create.sql script from gpsdrive makes it easier. Test: check with some mysql queries, e.g. echo "select * from waypoints limit 3" | mysql -u gast -pgast geoinfo

  6. Save and edit the scripts in appropriate locations: /root/bin/gps-start and ~/.gpsdrive/google-maps-script

  7. Configure gpsdrive to read the file kismet is writing to "way_kismet.txt"

Starting session

  1. Turn GPS on and run gps-start as root: screenshot

  2. Run kismet as root. screenshot

  3. Run gpsdrive as your regular (unprivileged) user that you also configured kismet for. screenshot

Adding Google maps

  1. Best to not have gpsdrive running

  2. Go to and browse to the area you want. I tend to set the zoom between 12-17 to get 8x10 maps in a grid, overlap 10% (rather than the default 5%) to guarantee decent overlap, and of course toggle to gpsdrive. Here is an screenshot of one of my configurations. Once the maps are generated, save the page which doesn't need to be rendered fully by your browser so no need to wait for all the thumbnail images to load.

  3. Run the google-maps-script which I've put in ~/.gpsdrive for testing, but ~/bin is prob better. This scripts auto downloads and adds the multiple google maps for gpsdrive to use. I decided to stop using Expedia completely (such ugly maps!) and edited them out of ~/.gpsdrive/map_koord.txt and currently have 865 Google maps there from approx 12 runs of this.

  4. Start gpsdrive and you should be able to navigate to your new Google maps

Have fun!