Mar

21

Originally I wasn’t going to blog about this but I finally gave in so here it is. This isTracking weather another one of those things that you really just can’t do with your iPhone unless you’ve jailbroken it.

Having the weather on your lock screen is nothing particularly new, there are enough Winterboard themes that allow you to do this. However, this is slightly different. I’ve never really understood why you’d only ever want to know what the weather was like in your home town. What does it matter? That is of course unless you never actually go anywhere. Why not have the weather for where you are? Yes I know you could just look out of the window or actually go outside but that’s beside the point. What I wanted was to have the weather for where I actually am right now. So, as part of my iPhone tracking system I added the ability for the weather to follow me too. The implementation is rather simple.

Since I’m already sending my location and retrieving the wallpaper image I’m also getting an override (overRide.js) for my weather configureMe.js. The overRide.js contains a single line, the location – as per the configureMe.js format:

var locale="Lelystad,NL"

So each time the wallpaper is updated, so is this file. One of the key things you need to do to accomplish this for yourself is what is called reverse geocoding. That is, getting the name of your location from your GPS coordinates.

Now, the best way I’ve found of doing this so far is by using geonames this is a fantastic site that allows you to do the reverse geocoding without even blinking. For example, calling geonames using the url

http://ws.geonames.org/findNearbyPlaceName?lat=50.455&lng=-3

would result in the following xml being returned

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
  <geonames>
    <geoname>
        <name>Seaton</name>
        <lat>50.7049382166946</lat>
        <lng>-3.06999206542969</lng>
        <geonameId>2638278</geonameId>
        <countryCode>GB</countryCode>
        <countryName>United Kingdom</countryName>
        <fcl>P</fcl>
        <fcode>PPL</fcode>
        <distance>28.2265</distance>
    </geoname>
  </geonames>
</xml>

This gives you pretty much everything you could possibly want and for free too. Note the inclusion of your distance between your coordinates and the the coordinates returned (nearest named location).

Now I know what you’re thinking. Why would I retrieve a file with the data in it from my server, why not parse the xml in the javascript on the lock screen. You’re right, I could and you, possibly, should. I don’t because I keep all my GPS data in a database on that server so I update the database with the actual locations too. I don’t parse the xml on the iPhone because I don’t need to.

Of course I haven’t yet tested being in some obscure location that the weather provider doesn’t know about. Incidentally, geonames is so freaking good that, if you want to, you can download a daily dump of the database.

Lock screen weatherLock screen weather, later that day



»crosslinked«

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Tagged with:
March 21, 2009 18:11

Sep

22

Follow Me Wallpaper

17 years ago, at the end of September | 3 Comments

Last night I tried a little experiment on my jailbroken iPhone. Since I’d already started poking about playing with my own Winterboard themes and have been tracking my iPhone’s location for a while now, I thought I’d see what happened if I mixed the two. So, how about wallpaper that followed you? Follow Me It turns out that combining the two is relatively straight forward. Google now provide a mechanism for getting what they call static maps which will allow you to get an image centered on a set of coordinates. You can also add your own markers if you want.

There are some limitations on the number and size of the maps that you can retrieve so I employed a very simple caching mechanism to ensure I didn’t annoy Google. This certainly helps speed things up when testing and also enabled me to identify a small issue I was having.
Read more…



Tagged with:
September 22, 2008 11:50

Jan

23

TrackMe on the Neo

17 years ago, at the end of January | 4 Comments

Remember when I mentioned my tracking application for the TomTom Go? Well last night I found a little bit of spare time so I could port it to the Neo 1973. I say ‘port’, it wasn’t so much Tracker1a port as a ripping out of the TomTom specific stuff and adding a little GTK interface. It’s not massively impressive to look at but it is actually my first GTK application. There is quite a bit of hard coded stuff in there at the moment but I do intend to move this to a config file. Currently, if the distance between the previous and current positions is below a certain threshold, a packet is not transmitted at all and position checks only occur at 15 second intervals. The data that is sent out is encrypted with a very simple algorithm, but I’m more interested in low cpu usage and speed at this point. I’m also going to be fairly honest about the state of the code at the moment, it’s not a pretty sight at all. I need to put together something on the server side to decode the packets, I know I have it somewhere, it’s just a matter of locating it.

I did wonder if the application should have an interface at all or if it should just run in the background, ‘secretly’ so that if someone stole your Neo you might actually be able to trace it.

The one thing that this did show me, however, is that you can’t actually run gllin for a particularly long time. I think it’s a minor fix but it does tend to fill up the free space on the Neo with its log data. I guess just disabling this might help, though I haven’t actually bothered to poke around with that just yet.

The other news is that to build this application I used the new toolchain and I have to say it makes life a whole lot easier. As a result I will also be building the toolchain at regular intervals and providing downloads via my buildhost. Sorry, but I can only build 32 bit versions at this time.



[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Tagged with:
January 23, 2008 14:53

Nov

21

Here I am, right here

18 years ago, mid-November | 7 Comments

Some time ago I wrote what I called the “Ramius” edition of my tracker application for the TomTom Go. The limitations of the Go SDK caused more than its fair share of grief and I shelved the project, hoping to revive it later. Now I’m thinking that it’s time to bring it back to life.

At the moment I’m selling my house in The Netherlands and moving back to the UK. Until the house sells I flit between the UK and Holland every couple of weeks. I’ve taken to using the Chunnel for this because it means I can drive through the night rather than have to bend to the ferry or flight schedules. The trouble is, my wife gets worried that I’m going to crash and burn. She does this every time I do the trip, in either direction. She wont go to bed until she knows that I’ve at least got to the Tunnel.

I brought the original code out of my archive and started looking at it, removing anything that was TomTom specific. I’m pretty sure that I’ll have a workable solution fairly soon, I may butcher the openmoko-agpsui2 application a bit too, just to add a face to the tracker application code. Obviously, it will need a network connection of some sort so I’ll be looking at starting and stopping a gprs connection, or using wifi when the GTA02 arrives.

On the topic of gprs and network connections, I was mulling over some points in my mind about this. Nobody wants their Neo to pull an iPhone, and give us all large bills because of roaming, so there needs to be some mechanism where the user can deny or allow access to things like gprs connections. These could be based on dates, times, even locations with the built in gps. The problem is not that it is difficult to do, the problem is that we need to be able to force applications to use an API to open gprs and wifi conections, and possibly even access the gps. There’s a whole kettle of fish here. Openmoko is opensource, not the Google kind of ‘opensouce’, the real kind. That in itself poses a few questions and perhaps some not so nice answers.

If we want to force people to use an API, then we have to make sure that they can only use the API and not bypass it. If they can bypass it, it’s useless because the malicious ‘l33t h4x0r’ is going to abuse your connection. The problem is, since we are opensource, the same abuser can simply replace the API. Sure you still have to install the application, but just think about it. Right now how many places do you update your Neo from with ipkg? If any one of those gets compromised or the owner deliberately alters packages, the first you’ll know of it is when you bill hits the mat with a thud rather than the usual ‘ftht’.

We can think about signed images or signed packages etc but that is not really going to help, this is opensource. As an application developer I’m going to want to publish applications, I don’t really want to have to get them certified or signed by someone else just so other people can use them. If you alert the user that an application or package is not signed, you know that they’ll just click ‘ok install it anyway’ and ignore it.

I think I’m going to have to ponder this one a little longer.



[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Tagged with:
November 21, 2007 14:49

Current Electricity Use (15min)


iPhone/Webkit RSS Reader

Links


Tags

1-Wire android api Apple arduino currentcost DDAR development DVD FIC freerunner G1 google Google Phone gphone gprs GPS hardware image image builds inspiration iphone jailbreak kiosk linux Mac monitoring Music neo 1973 Nokia openmoko opensource OSX Pachube personal qtopia rhubarb rikki Rio slimp3 slimserver software tracking Trolltech u-boot


Twitpic


Graphy Stuff






Nasty Spam Monkeys