Sun 17 Jun 2007
Got back from hack day a few hours ago (yes I left before the Rumble Strips played, was really tired for some reason even though I’d had a full night’s sleep last night). It was an interesting event, my favourite presentation being “New Geo Services from Yahoo!” presented by Mor Naaman and Tom Coates. They announced a new project from Yahoo! Research called FireEagle. The idea behind it is basically to have a centralised place for storing your current location, and offer an API so that third party services can update or read your location. It’s a great idea, allowing a single API to work with when doing “I’m here!” type apps, and one I’d actually been considering knocking up myself.
I went to the event with a number of other multimappers who all got down to hacking fairly sharpish. I on the other hand just couldn’t think of anything to do, I wasn’t needed on either of their projects and just ended up doing some other coding I’d been meaning to do for a while to help out a friend. While doing this though I was still thinking about FireEagle and about whether there might be something related to that which I could knock up. After going back into London and getting a nice long sleep I went back over to Alexandra Palace this morning and decided that I would knock up a few things to update my location on FireEagle.
The first of these is actually an extension of an existing PHP script that I already had. For a year now I’ve been logging my current location while out and about by using a bluetooth GPS and MobiTrack Pro java software on my mobile phone logging to a PHP script running on my web server. Modifying that script to update my location on FireEagle actually turned out to be ridiculously easy. The biggest problem was getting GPRS turned on for my new mobile phone!
The second thing I knocked up was a way to update my position via DNS. While this may sound like an odd thing to do it’s actually quite useful. Often when you’re connected to a pay-for WiFi service you’ll find that accessing web pages when you haven’t paid for access will take you to an “enter your username and password here and/or pay us some money” page. Usually when this happens though you’ll find that you actually have full access to make DNS queries. Considering that GPS data is essentially just two numbers I thought it would be pretty handy to knock up a DNS server that accepted these two numbers and sent them over to FireEagle, and so that’s what I did.
Fortunately it turned out to be quite simple as I already had an existing perl nameserver script that I could extend, 50 lines of code later and I had a daemon running on one of my server to which I can send lookup requests for hosts like this:
l51d59296.l-0d13174.temppublic.15.nmea.a.example.com
Which results in my location being updated (to Alexandra Palace in this example). It’s actually a fairly simple sequence, the parameters are as follows:
<lat>.<lon>.<userkey>.<counter>.nmea.a.example.com
Latitude and longitude are prefixed by the letter “l” simply to make sure there’s no hyphen at the beginning (as there would be for negative lat/lon), and the decimal point is replaced by the letter “d”. The “user key” is simply looked up in a text file to get the user’s application token from FireEagle and the counter just makes sure the DNS record is never cached.
So I’m quite tempted now to knock these into some sort of service that anyone can sign up for but I’m doubtful of whether there’s much demand. If you think you would use either service then let me know in the comments.
Technorati tags: GPS, hackdaylondon, dns
June 18th, 2007 at 2:33 pm
Yes! this is absolutely brilliant.
Put it up… If you build it, they will come. We’ll feature a gallery pretty soon, so someone may discover your service there and try it.
Mor
June 19th, 2007 at 6:17 pm
That’s freakin’ awesome. Put it up for sure.
June 19th, 2007 at 11:18 pm
[...] updating your location using a DNS query which is free over non-free wifi (via http://simonwillison.net/2007/Jun/19/blog/) (tags: geography dns hacking gps) [...]
June 20th, 2007 at 12:29 am
I’d definitely use it, especially if coupled with (or linking to) a few “user level” applications for various platforms, to cater the hairy bits that go between having location coordinates and sending them your way by dns query.
June 20th, 2007 at 11:40 pm
[...] all ties in with hackday (see my photos)… it seems the done thing to blog about what you hacked so here [...]
June 25th, 2007 at 11:05 am
Users drift, time zones vary
I have still not seen any web site or service that groks that time zone is not a per-author (or sometimes even per-visitor) configuration setting, but a function of present location, which in turn is a variable entity over time. [...]
June 25th, 2007 at 3:33 pm
That looks like something that could interest people interested in OpenStreetMap and similar things.
November 30th, 2007 at 4:58 pm
woow – what an idea to use a DNS-extension to transfer the current position.
I just don’t dare to ask my infantile question but … come on .. everybody started small.
I am looking for an open source mobile app that sends the current position to a php-script. We would like to modify / add / try out our ideas of a mobile game.
Any help? Cheers
Say hello to Tim McAloone if you see him in downtown.
December 1st, 2007 at 1:56 pm
Hi Michael, depends partly on what mobile technology you would want to use. I generally use J2ME so here’s my suggestions for that:
MobiTrack Pro– Unfortunately not available any more. Not OSS, but pretty good and cheap. I regularly use it for sending my position to a server script.Mobile Trail Explorer – Can’t update a server script but can send SMSes.
TrekBuddy – Also can’t update a server script but can send SMSes.
So, unfortunately I can’t recommend any OSS for what you need, but perhaps you could look at modifying one of the apps mentioned above to add it yourself?
(By the way, no idea who Tim McAloone is)
June 21st, 2008 at 9:54 am
[...] by the BBC. I went to the similar “Hack Day” event that they ran last year (and blogged about it) and had a great time. This time I’ll actually be there in a vaguely official capacity as [...]