webOS Nation Forums >  Homebrew >  webOS Homebrew Apps > JSON Location Tracker
JSON Location Tracker
  Reply
 
Thread Tools Display Modes
Old 01/18/2010, 01:46 PM   #1 (permalink)
Member
 
spottedkangaroo's Avatar
 
Posts: 20
JSON Location Tracker

I wanted a really generic location posting mechanism that could be tuned to taste. There's not a lot more to say than that. This app is a single card that controls all the aspects of posting location data to a website: the post URL, the speed of GPS reading collection, and the size of the buffer.

This is in the early stages, so although it seems to work solidly; it could use a few more examples If you're willing to donate example CGI/FastCGI applications, fork
the project at github and post away!

-----------------------

This isn't really meant for tracking yourself, but for others to track you. There does need to be a web component set up. The Prē app is just the part that posts data to a website.

I only provided a Perl example. I'd be thrilled if people provided examples in other languages. I mean to try to do Ruby and Python, but I really don't know the best practices for those languages, so it's tricky to write code I can be proud of.

The HTML and javascript posted at Github should work with any JSON back-end.

Here is the CGI dir there:

http://github.com/jettero/jlt/tree/master/cgi/

And the protocol description for the JSON POSTs:

http://db.jgps.me/protocol#input

Last edited by spottedkangaroo; 04/27/2011 at 10:06 PM. Reason: changelog is in the app now, removed frmo post
spottedkangaroo is offline   Reply With Quote
Thanked by spiregrain, sudoer
Old 01/19/2010, 05:47 PM   #2 (permalink)
Member
 
Posts: 15
Great! Am itching to try this, but access to the CGI bits of my website are down at the moment. (Thanks to ISP incompetence.)
spiregrain is offline   Reply With Quote
Old 01/20/2010, 11:32 AM   #3 (permalink)
Member
 
mu7efcer's Avatar
 
Posts: 915
You have this categorized as "Location and Travel", but for someone who doesn't code for WebOS I don't see how I would use this to track my location while traveling. Obviously there must be a corresponding web based service available to post to. But it's really not obvious from your description how someone would make use of this app. Any chance you can include a bit more in the app description to help clarify how this app might be useful to someone?
__________________
Twitter: dullgeek
mu7efcer is offline   Reply With Quote
Thanked By: spottedkangaroo
Old 04/06/2010, 08:10 PM   #4 (permalink)
Member
 
Posts: 2
I love the idea behind this app, but it's driving me crazy that it posts once a second. I don't walk all *that* fast....how do you feel about turning the frequency down - once a minute would probably be plenty - or at the very least making it a configurable option?
BreadJedi is offline   Reply With Quote
Old 04/07/2010, 07:05 AM   #5 (permalink)
Member
 
spottedkangaroo's Avatar
 
Posts: 20
Quote:
Originally Posted by BreadJedi View Post
I love the idea behind this app, but it's driving me crazy that it posts once a second. I don't walk all *that* fast....how do you feel about turning the frequency down - once a minute would probably be plenty - or at the very least making it a configurable option?
I suggest you turn down the post frequency then. By default, it posts as fast as it receives GPS readings, but if you turn off the tracker and switch continuous to off you'll have a slider regarding sample frequency.

Cheers!
spottedkangaroo is offline   Reply With Quote
Old 07/07/2010, 10:27 PM   #6 (permalink)
Member
 
Posts: 2
Thanks for the app, first of all, but I'm having trouble getting it to work.

It finds and reads the GPS signal just fine and it posts to my webserver, where I can see it being dumped to a logfile nicely. I reply with the first timestamp of the message, wrapped in JSON.

The app on the palm shows the blue and green lights flashing, never a red flash / error occuring. So far, so good. But what's happening: The app is posting once per second, no matter which interval I selected. Even weirder, per second the posts counter increases by exactly 13.

So after a while the app status looks like this: "10 reads, 1300 posts" (e.g.).

Any clue what's going on? Isn't it supposed to only do one post per GPS fix?

Thanks in advance,
Chris
mueslix is offline   Reply With Quote
Old 07/08/2010, 05:10 PM   #7 (permalink)
Member
 
spottedkangaroo's Avatar
 
Posts: 20
I think this issue has been fixed in the latest release. I was having that problem myself, but made fixes that seemed to resolve it. Please make sure you're on the latest version and report back if you're having that problem still.
spottedkangaroo is offline   Reply With Quote
Old 08/20/2010, 12:41 PM   #8 (permalink)
Member
 
Posts: 3
Based on your CGI examples, I'm trying to write my own script to receive the JLT posts. I've logged requests in the form of:

[{"t": [1282314804562, 1282314804562, 1282314804562, 1282314804562, 1282314804562, 1282314804562], "ll": [40.768383, -73.984798], "ha": 220, "va": 0, "al": 0, "vv": [0, 0]}]

And I send a response:

{"fix_tlist":[1282314804562]}

But the JLT app keeps saying "1 reads, 0 posted", "2 reads, 0 posted", etc. Is that right? Is there something missing from my response?

SJW
psycomp is offline   Reply With Quote
Old 08/21/2010, 07:25 AM   #9 (permalink)
Member
 
spottedkangaroo's Avatar
 
Posts: 20
Quote:
Originally Posted by Psycomp View Post

But the JLT app keeps saying "1 reads, 0 posted", "2 reads, 0 posted", etc. Is that right? Is there something missing from my response?
That should work. If it doesn't I would very much like to know why. I have some ideas, but I couldn't say. Any debug work you could do would be appreciated as I'm going to be at the hospital all weekend after the birth of my newest baby (hehe). I rarely check these forums, so it would also be helpful (although certainly not necessary) if you would open a ticket on github and we could discuss it there.

Currently I'm using this:

Code:
        try {
            var rt = (js = transport.responseText.evalJSON()).fix_tlist;

            // the code here will crash if rt isn't an array
            // see: http://bit.ly/jlt429
        }
Maybe the evalJSON() fails for some reason? Since it's in a try block, it will log things, and if it doesn't log things it should blink the red and green "lights" for a long-ish interval.

Code:
        catch(e) {
            Mojo.Log.info("ControlPanel::postFixesSuccess, error processing js: %s", e);
            this.blinkRedLED(medium_blink);
            this.blinkGreenLED(medium_blink);
        }
spottedkangaroo is offline   Reply With Quote
Old 03/27/2011, 04:30 PM   #10 (permalink)
Member
 
Posts: 30
First of all, congratulation on the new baby! Here's a toast to him.
Second, I was looking for a long time for something that runs in the background and logs the position of the device so that if it is lost (or stolen) I can find it. The app works fine for me, but I there are a few features that are needed so it can be used as I described:
1) When you load the device, it starts with tracking off. Can you add an option to have it start with tracking enabled (or a "remember last position" option)?
2) Can you have an option to push it to the background, either to the notification tray of completely in the background?
3) Auto start on device restart. This is not so important, since I can always use mode-switcher, but it could be nice.
4) On the site I saw an option to see the location on a map. Is there a way to get the raw GPS location? I didn't see such an option.

I know you are doing this on your own (limited) free time, so anything you do implement will be very welcomed.

Thanks!
Kilrah_il is offline   Reply With Quote
Old 03/27/2011, 10:03 PM   #11 (permalink)
Member
 
spottedkangaroo's Avatar
 
Posts: 20
Hi thanks for the gratz. He's doing quite well and getting huge.

1. I hadn't given much though to options. So few people express any interest at all on this app that I'm just thrilled to get a comment. I think this is certainly doable.

2. backgrounding is an issue. I've not looked into it very much as your goal of stolen phone tracking isn't something I had really considered. Personally, I can ssh into my pre and the IP address would probably be enough if they haven't webos doctored it yet. I suppose it would be really hard to get the police to care though, perhaps that's a foolish notion on my part. I do know that (rumor has it) it's not possible to background an app using the official API so I couldn't release that particular feature in the app store... I'm wary of the idea of having two versions of the app; but it *is* open source and could be forked by someone else... I'll have to give this some thought so nobody beats me to it.

3. This is something that, again, I don't think is possible with the official API. I think mode switcher is probably the best way to do it anyway. We know that's stable already and they've worked out the kinks.

4. Yes. Click the map pin. It barfs up all the details of the fix. I suppose that's not at all clear is it. I should create a UI hint somewhere.
spottedkangaroo is offline   Reply With Quote
Thanked By: Kilrah_il
Old 03/28/2011, 07:45 AM   #12 (permalink)
Member
 
Posts: 30
Thanks for the quick reply. Regarding point 2, I understood from the thread about the Homing Device app that a complete background app is problematic from an API POV, but the app can be reduced to the notification try, right?
Kilrah_il is offline   Reply With Quote
Old 03/28/2011, 08:07 AM   #13 (permalink)
Member
 
spottedkangaroo's Avatar
 
Posts: 20
Oh, sure, if the notification tray is alright, I'm very sure I can get that going. I've never used the ntray, but I don't expect it's terribly difficult.
spottedkangaroo is offline   Reply With Quote
Old 04/27/2011, 10:08 PM   #14 (permalink)
Member
 
spottedkangaroo's Avatar
 
Posts: 20
I did implement some of this. I regret that it took a whole month to get to it. The class I just finished demanded literally all of my freetime plus a little. I'm going to try to figure out this notification tray stuff soon-ish.
spottedkangaroo is offline   Reply With Quote
Reply

 

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0