The Location Data

So after looking at a couple examples of a working "Whereabouts Clock" I decided that I wanted to try to make my own. After all, it's really cool! Before I spent any money buying parts and diving into the mechanics of it all, I really wanted to nail down the location data. Other examples use a Twitter feed and keyword searching to grab the locations, but I wanted mine to be fully automatic requiring nothing from me.
My wife and I both have iPhones, so I figured "how hard could it be?"
I started thinking about this project over 5 months ago and wanted to start with the location data. I browsed around the App Store looking for some way to grab the location data off my phone periodically and upload it to my home server. I found a couple examples that I purchased and found that the folks over at device-locater.com had a really cool product. I downloaded the App and configured it on my phone along with its server. Ta-Da! I now had a way to get the location data from my phone periodically.
I messed around with the device-locater app for a while. I hooked it into my Google Latitude account, and with their API was able to collect my location data pretty reliably. Then, Google released its own Latitude App for free that did the same thing as the device-locater App. I tried Latitude for a while, and it was nice, but periodically it would say I was a good 5 miles from where I actually was, so I gave up on it.
The device-locater app actually has a way to call out to your own server to push the data to, so with a little PHP script I was able to get data from my phone, through the device-locater site, into my server. Great!
There was only one little problem. I have an iPhone 4, which has some semblance of multi-tasking. My wife has my old iPhone 3G (not 3Gs), so she has NO multi-tasking. The Latitude and device-locater apps worked fine, as long as she clicked on the app and manually had it update with her location. This was not going to work.
Then, with the release of iOS4, Apple made the "Find My iPhone" feature of MobileMe free to everyone with an iPhone and an iTunes account. Hurrah! I quickly downloaded the app onto our phones and added them to my account. Now I could see my phone and my wife's just by going to the MobileMe site. Now...how to get that data to my server??
It turns out that this is not a unique problem, and for the time being has been solved by Tyler Hall. Essentially he's created a PHP object that is an API for the MobileMe find my iPhone. With a little PHP scripting, I was able to pull the data from MobileMe onto my home server. I set up my script as a cronjob to run every 1/2 hour and grab our locations. I could do it more frequently, but the more often you check the worse the battery life on the phones are.
Hooray! I've been collecting our locations every 1/2 hour for almost 4 months now without a problem. Here's hoping that Apple doesn't shutdown the Sosumi project.

Comments

Popular posts from this blog

V-22 Osprey Project - Design Changes for v3

Whereabouts Clock Update

Whereabouts Clock: New Clock Mechanism