Geolocate Imp

I’ve seen references in the forum to a geolocation api in a pending update, but don’t see it in the official documentation. Is this live?

this could help…

It’s interesting to note that the code given can follow the imp (somewhat) around the wi-fi access point. During testing with my mobile imp (on battery) it was cool to see that actual location (dot on google map) was within 10-25 feet, with varying locations as imp moved around. At very least I could interpret approximate direction (N-S-E-W) and approximate distance (accuracy varied by distance and signal strength). Pretty cool code.

Thanks Chrischi. Is there a way to improve accuracy? I’m getting the right neighborhood, but still off by about 2-3 miles

I’m surprise, @kienng - I found George’s code (and Google’s locator) to be scarily accurate. I may have to consider stopping my base-station broadcasting its SSID…

@kienng - unfortunately geolocating based off of networks is only as accurate as the data will allow (ie - how many networks are around, and how many people near you have allowed google to collect location based data).

@kienng - you lucky guy. This is where George’s Code locates ME:,-121.895

and i’am sitting right now in germany near the border to france.
So @beardedinventor said it already.

Scarily accurate for me - if I zoom right in I get a photo of my house!

Why not read the NMEA output via serial? Most GPS support serial communications.

Here is an Arduino example.

While the Google maps browserlocation api does sometimes return a great result, I normally (>90%) get a status OVER_QUERY_LIMIT as the result, even if I have not queried for days. I think the problem is that all queries from imp agents appear to come from the same IP address and the API imposes a cap on queries from our IP. Makes it a pretty useless API IMHO.

When it is working, it shows my location pretty accurately. Though from this post I hear not all experience the same. Couldn’t help post this pic. The imp is about 10’ from the marker, at my desk. Spooky!

@DrJack, all queries are coming from Electric Imp’s agent server and these forum posts have triggered off a large number of requests. You will probably find that it works again now.

@solarishot, I had the same experience. The marker landed right on my bedroom window.

The geolocation api should be adding X-Forwarded-For (XFF) to the http header to show the source ip of the imp device to the 3rd party service.

imp dev --> imp agent --> geolocation api --> 3rd party service

imp dev --> imp agent --> geolocation api (X-Forwarded-For) --> 3rd party (knows the source ip was the imp device).