maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Web Tracking/Anti theft/loss Tool (https://talk.maemo.org/showthread.php?t=51027)

Luke-Jr 2010-08-12 20:38

Re: Web Tracking/Anti theft/loss Tool
 
should be trivial to setup a python script that sends a UDP stream of GPS data somewhere

n900-dk 2010-08-12 22:28

Re: Web Tracking/Anti theft/loss Tool
 
The GPS tracker is only using the last known GPS data, right? - or is GPS turned on in the scripts?

If not, would it then be possible to turn on the GPS with out any icon showing up on the desktop, so you could track the phone, even if the thief is not using GPS applications on the phone?
Otherwise it could be hard tracking the phone with some old GPS data.

grog 2010-08-13 17:38

Re: Web Tracking/Anti theft/loss Tool
 
Quote:

Originally Posted by benh_n900 (Post 784616)
Sorry - I have been away and without decent internet access for the last month...

No need to apologize. We all unfortunately have other stuff in our lives to do :)

Quote:

The delete button doesn't delete it? What browser are you using?
I just tried both Firefox 3.6.8 & IE 6.0 under Windows, neither work. Haven't tried it at home on my Linux box yet.

Quote:

This is the password you set for the device (optional) when you press the actions button.
Ah, that's what I was missing, to set it in the Actions. Works now, it updates. The SMS & email functions work really well, but I get errors when I check 'Get Location' :

Code:

$ /home/opt/n900tracker/getactions.py
Call http://tracking.isgreat.org/api?IMEI=MYIMEI&IMSI=MYIMSI&Pass=MYPASSWORD
mode is location
Checking if location was requested
Starting Location finder
Getting Location from GPS
Call http://ws.geonames.org/findNearestAddress?lat=49.8794868775&lng=-97.1204716712
Traceback (most recent call last):
  File "/opt/n900tracker/whereami.py", line 82, in <module>
    addr=get_addr_from_xml(addrxml)
  File "/opt/n900tracker/whereami.py", line 14, in get_addr_from_xml
    addressobj=xmldoc.firstChild.childNodes[1]
IndexError: list index out of range
Checking if ssh was requested
Checking if SMS was requested

When I hit the URL from the previous command:
Code:

This XML file does not appear to have any style information associated with it. The document tree is shown below.
     
<geonames/>

Is all that's returned, so I'm guessing it's a site/API issue(?)

Next I'm going to play around with activating the ssh tunnel, THAT's a kewl option.

TX

n900-dk 2010-08-13 17:51

Re: Web Tracking/Anti theft/loss Tool
 
Quote:

Originally Posted by grog (Post 785515)
...
Code:

Getting Location from GPS
Call http://ws.geonames.org/findNearestAddress?lat=49.8794868775&lng=-97.1204716712
Traceback (most recent call last):
  File "/opt/n900tracker/whereami.py", line 82, in <module>
    addr=get_addr_from_xml(addrxml)
  File "/opt/n900tracker/whereami.py", line 14, in get_addr_from_xml
    addressobj=xmldoc.firstChild.childNodes[1]
IndexError: list index out of range
Checking if ssh was requested
Checking if SMS was requested

When I hit the URL from the previous command:
Code:

This XML file does not appear to have any style information associated with it. The document tree is shown below.
     
<geonames/>

Is all that's returned, so I'm guessing it's a site/API issue(?)
TX


The 'findNearestAddress' from geonames.org works only in the US, guess you are not there? But I have modified the 'whereami.py', so it will just return the GPS coordinates, and in the webservice at http://whereismydevice.com/devices, you will then have a link to Google Maps for this position. Works fine for me here in Denmark :)

grog 2010-08-13 19:43

Re: Web Tracking/Anti theft/loss Tool
 
Quote:

Originally Posted by n900-dk (Post 785526)
The 'findNearestAddress' from geonames.org works only in the US, guess you are not there?

Nope. But close, Canada :)

Quote:

But I have modified the 'whereami.py', so it will just return the GPS coordinates, and in the webservice at http://whereismydevice.com/devices, you will then have a link to Google Maps for this position. Works fine for me here in Denmark :)
Ooo!! Shiny. :cool: Gimmee! Gimmee! Please! PLEASE!! :)

One more thing. Running getactions.py while selecting the ssh tunnel action gave the error "/bin/sh: ssh.sh not found". This led me to make a few corrections to the getactions.py script so the path would be prepended properly:

Code:

$ diff getactions.py getactions.py.001
45c45
<    script += "whereami.sh"
---
>    script = "whereami.sh"
54c54
<    script += "ssh.sh"
---
>    script = "ssh.sh"

I also changed the call to the repeating location script, although I hadn't tested that yet but it seemed right. As well in the ssh.sh script I had to change the output redirection from /dev/NULL to /dev/null.

After that, works beautifully. :) :)
Much appreciated.
TX

n900-dk 2010-08-13 19:57

Re: Web Tracking/Anti theft/loss Tool
 
1 Attachment(s)
Quote:

Originally Posted by grog (Post 785646)
Ooo!! Shiny. :cool: Gimmee! Gimmee! Please! PLEASE!! :)

Sure, see attached files :)

Quote:

Originally Posted by grog (Post 785646)
One more thing. Running getactions.py while selecting the ssh tunnel action gave the error "/bin/sh: ssh.sh not found".

Code:

$ diff getactions.py getactions.py.001
45c45
<    script += "ssh.sh"
---
>    script = "ssh.sh"

54c54

You are right, actually I just typed in the whole path for the scripts like:
script = "/home/opt/n900tracker/ssh.sh" but maybe the + will do the trick..

benh_n900 2010-08-14 13:45

Re: Web Tracking/Anti theft/loss Tool
 
Quote:

Originally Posted by n900-dk (Post 785526)
The 'findNearestAddress' from geonames.org works only in the US, guess you are not there? But I have modified the 'whereami.py', so it will just return the GPS coordinates, and in the webservice at http://whereismydevice.com/devices, you will then have a link to Google Maps for this position. Works fine for me here in Denmark :)

Aha that's good to know ... The address lookup isn't that important when you are looking at the position through the webservice, but it's nice if you are sent it by SMS, because then you get a rough idea of the address right there in the SMS. If anyone knows of a webservice that will do reverse geocoding globally and has an easy API to integrate, please let me know, or update the script and post it, then I will update the script on the site.

Also Grog - thanks for noticing the script error in getactions.py - I have updated the scripts on the site to have += instead of = as per your diff. I have also changed NULL to null in ssh.sh and whereami.sh :)

Cheers,

Ben

Devrim 2010-08-15 00:03

Re: Web Tracking/Anti theft/loss Tool
 
Hi,

Are you ever gonna give the code for the site up so we can run it on our own servers?

chrisp7 2010-08-15 00:42

Re: Web Tracking/Anti theft/loss Tool
 
this is a great idea! :) - wish we could get it as a deb - it looks really complicated to install.

benh_n900 2010-08-15 07:34

Re: Web Tracking/Anti theft/loss Tool
 
Quote:

Originally Posted by Devrim (Post 786638)
Hi,

Are you ever gonna give the code for the site up so we can run it on our own servers?

I don't have plans to, but if you want to implement the same for yourself it's not that complicated to create - it just waits for the n900 to load the api page (which is a simple http get, same as you would do in a browser), logs the call and returns a list of actions.


All times are GMT. The time now is 05:32.

vBulletin® Version 3.8.8