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 http://gtm.tel.uva.es/ztep/maps/dmap.htm 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!

Comments

  1. awesome, just what I was looking for!

    unfortunately it doesn't seem to be adding and renumbering the map_koord.txt file for me, but if I do that manually it works a treat!

    ReplyDelete
  2. actually I just didn't have elinks installed, doh!
    works perfectly now!

    AWESOME!

    ReplyDelete
  3. Hi Eloc, thanks for your post. To help you I'd need to know what was going wrong when you run the script. I've stopped maintaining it as I don't use it anymore myself! (the reason being is I use a BlackBerry with GPS and Google Maps for navigation) and don't have time or the inclination for combined WiFi wardriving/GPS tracking. The script is a hack, ideally gpsdrive itself would be trivially extended to download Google Maps tiles (as it does already from Expedia) and this is doable for someone with the right coding skills. But back to the problem. The dmap.htm should contain a bunch of tile URLs, which the script goes and downloads in turn. Does this happen? Run the script with "bash -x /path/to/script" to see. Once downloaded the correct coordinates need to go into the coordinate file. The script might get that wrong, though I tried to make it error free, no glue script (with dependencies) can ever be.
    Nice to see you are using an Eee PC and getting a be- hats off to you!

    ReplyDelete
  4. Спасибо классная статья ;)

    ReplyDelete
  5. Hey,
    can you upload the google-maps-script again?
    the link seems to be broken.

    ReplyDelete
  6. Done, uploaded script and all the other files I'd forgotten about transfering from my old server. That script though is nearly 2 years old and not tested recently.

    Am more interested in plotting wireless info (WLAN, 3G/EDGE/GPRS, even Bluetooth, directly onto Google Maps - will work on that when I get some time.

    ReplyDelete

Post a Comment

Thanks for commenting! Because of so many spam posts, to save us all from them, I've had to regrettably moderate submitted comments. Thanks for your understanding.
Kiat