Mark J Cox, mark@awe.com  
   
mark :: blog :: gps

[ 1 ]



I'm out on holiday soon to Arizona, so we've been looking for ways to geocode the photos we'll be taking and get a record of our route. I use a Mio A701 phone which has built-in GPS, and this time we'll be using Tom Tom in the USA rather than Mapopolis. The problem with Tom Tom Navigator is that it doesn't keep a track log, and there doesn't seem to be any plugins to allow it to do so. So here is the solution I've been experimenting with over the weekend.

On the PocketPC:

  • Make sure the GPS Intermediate Driver is enabled, on the MIO there is a built-in "GPS Settings" utility where I have it set to COM4 and "Manage GPS automatically"
  • Use the GPS2Blue utility. Make sure it's set to GPS on COM4, 4800 baud, with logging only of GGA/GLL/RMC/VTG NMEA, and select 'Log processed raw data...'. You don't need to enable the "2blue" bit, we're just using it to write the tracklog.
  • Make sure your camera has a date and time that is close to the one being shown by GPS2Blue from the satellites
  • Start TomTom. Make sure it's also set to COM4, 4800 baud. This will work because the GPS Intermediate Driver is opened by GPS2Blue. You can't start TomTom first, but you can exit GPS2Blue and leave TomTom running.
  • After finishing you end up with a NMEA track log with an hour of logging taking up about 1.6Mb. Transfer it to your Fedora machine.

On my Fedora machine:

  • Use gpsbabel to convert the NMEA track log and clean it up a bit. I used:
    gpsbabel -i nmea -f GPS_2008-03-03_122630.log -x discard,hdop=10,sat=5 -o gpx -F out.gpx
    
  • Use gps2photo.pl to add the geocoding to your images. This script looks at the time and date the photo was taken and tries to match it up to an entry in the tracklog, so you may need to play with the timeoffset to deal with timezone differences. Although we have snow, being in the UK in the Winter has it's advantages as we're UTC+0, so I just used:
    gpsPhoto.pl --geoinfo=osm --dir ./ --gpsfile out.gpx --timeoffset 0 \
        --city=auto --sublocation=auto --state auto --country auto --kml out.kml
    

The exif metadata inside each jpeg now contains the approximate co-ordinates of where you were when you took the photo along with a guess of the location (city, country, etc). You can load out.kml into GoogleEarth to see the tracklog and photos on a map. If you've allowed Flickr to read the location data from exif then uploading a geotagged photo will automatically place it on a map. (Make sure you consider the consequences before enabling that option or you may end up unintentionally leaking information like the location of your friends houses or parties you've been to). Here's a quick pic taken in the snow today to test it out:

Test of photo Geocoding output from exiftool:
GPS Position                    : 55 deg 46' 58.21" N, 4 deg 0' 5.50" W
City                            : Motherwell
Province-State                  : Scotland
Country-Primary Location Name   : United Kingdom



When I give presentations I have to find something to display the time (since I never wear a watch), somewhere to put some speaker notes down (since I sometimes forget a useful point), and then I keep knocking it all over everytime I go to the laptop to hit space to get the next slide. I'd quite like to use the laptop display to display my speaker notes and a clock, but OpenOffice doesn't support doing that yet.

I recently changed to using a smartphone to save carrying around and having to recharge lots of gadgets. I bought a Mio A701 which is a nice phone, PDA, and has GPS in one package. Since the Mio also has bluetooth I thought that for my presentations at the Red Hat Summit next week it would be nice to use the PDA to control the presentation, watch my time, and give me any speaker notes.

The smartphone runs Windows Mobile 5, unfortunately and I wanted to set something up quickly and without much effort. I don't mind writing apps for it, but I'd rather avoid it. So my first thought was to use vnc, but the vnc client on the pocketpc wasn't great and kept crashing, and I'd have to create some app to interface with OpenOffice anyway. Once OpenOffice supports multiple displays it may be more useful to revisit doing this via vnc.

My laptop runs Fedora Core 5 with a MSI bluetooth USB dongle plugged in.

Step 1: Get the phone talking to the laptop

This should have been the easiest step, but took an hour to get working right as I originally struggled getting the phone to connect to a 'serial port' service. The commands below were sufficient to advertise a 'dial up network' service and have pppd handle the connection. I didn't bother setting up any IP forwarding as I don't need the phone to be able to use the laptop as a way to get generic network access.

   /sbin/service bluetooth start
   sdptool add --channel=2 DUN
   dund -u --listen --channel=2 --msdun noauth 192.168.1.1:192.168.1.2 \
      crtscts 115200 ms-dns 192.168.1.1 lock
Then on the Windows Mobile I added a new connection, selected "bluetooth" modem, created a new partnership with the laptop DUN service, any phone number, any username and password (to stop it prompting later), advanced to remove the "wait for dial tone" option. If you're doing this from scratch you'll need to play with settings in /etc/bluetooth/hcid.conf to make sure you set up a PIN for pairing and so on.

Once this is done using the browser on the phone with a URL of http://192.168.1.1/ causes it to connect, pppd starts, and the phone happily can connect to the web server on the laptop. If you want DNS working you'll need to mess with the dns IP above or make sure your laptop DNS server is set up to accept connections on that interface. So far so good.

Step 2: Control the presentation

The next step was to be able to control the presentation. I couldn't see any nice way to remotely control OpenOffice.org, so a colleague suggested finding something that used the xtest extension just to inject keystrokes. the X11::GUITest perl module on CPAN does the job perfectly. So I hacked up a quick perl script you run as your local user that acts as a web server and on certain requests will inject a space character into whatever has focus.

pic of the setup

Step 3: Speaker Notes

Next step is to get the mini perl webserver to display my speaker notes as well as the link to the next slide, although, to be honest, I could probably have committed the notes to memory in the time it took to set this all up.

Download the trivial little perl script



USB Power

I recently picked up a USB "charge anywhere" kit for the iPAQ; it's got a mains adapter with multiple plugs for UK/US/etc with a single little USB socket, and a USB charger lead. It also came with a car ligher adapter which gives a nice regulated 5v to a USB socket. I've already got a USB charger lead for my phone, and I just built one for my bluetooth GPS and it really cuts down on the number of chargers and leads to lug around when travelling. I wonder how long it will be before cars come with little USB sockets to charge and power goodies instead of ligher sockets? Of course all these gadgets violate the USB spec which says that you should only get 100mA unless you've negotiated with the hub for more (500mA). I guess adding the components to regulate and switch power to USB sockets isn't worth the expense or space to most designers, so all those USB lights and fans will probably keep working.

TomTom Navigator vs Mapopolis

I've been using TomTom Navigator 3 with a bluetooth GPS receiver around Scotland and it's been doing a pretty impressive job. Except it once wanted to take me off a motorway by using the private service exits for a service station. And today it sent us the wrong way up a wrong way street. Travelling to the US next week but couldn't get the TomTom add-on maps in the UK, so I ended up buying Mapopolis for about $99 that I could download online, and as well as the US maps downloaded Scotland too for comparison. Mapopolis isn't as polished a product as TomTom by far but it's technically more superiour - it knows the names of the roads and attempts to speak them

TomTom: After 300 yards turn right
Mapopolis: In 300 yards turn right into Cathedral Street. Cathedral Street is next on your right

If you want to drive and not look down, Mapopolis wins as it tells you exit numbers, road names, and so on. But for clarity TomTom wins as they supply really high quality audio for the small selection of possible words; Mapopolis has a primitive speech engine. Anyway I'm going to be driving in Boston with Mapopolis so it'll be interesting to see how it deals with all the buildings and new road layouts. I suspect i'll get used to it telling me to "turn around when possible".



My last week here so decided to go up to the mountains with Bryce who for some reason decided to take his laptop. After my recent fun with cars and Durham Police I let Phil do all the driving, which I don't think he appreciated.

I found a new xsl parser, libxslt and libxml, part of the gnome project, seems to be quicker than Xalan and has the advantage of being in C and not C++ (I'm so used to release engineering for 30 platforms where even a working C compiler is sometimes a stretch). Spent a good 6 hours on Saturday failing to get it working right with Perl the way I want it to, seems to be a strange memory problem that goes away everytime I turn on debugging.

I was going to buy a Earthmate GPS receiver for my laptop until I read that it doesn't output standard NMEA format data so it won't work with Autoroute. I'm still looking for a GPS solution so the next time I'm coming back from Scotland and get stuck for 4 hours on the M6 without a map I can find an alternative route.

[ 1 ]

       


Hi! I'm Mark Cox. This blog gives my thoughts and opinions on my security work, open source, fedora, home automation, and other topics.

pics from my twitter:


popular tags: [all], apache, apachecon, apacheweek, cve, cvss, fedora, financial, geocaching, ha, metrics, microsoft, nashville, north carolina, red hat summit, redhat, security, trips


Subscribe to RSS feed