maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   SMS-based stolen phone locator (https://talk.maemo.org/showthread.php?t=60516)

AlexV12 2010-08-18 18:09

Re: SMS-based stolen phone locator
 
Quote:

Originally Posted by boxhead (Post 790669)
What happens when you run:

python /usr/sbin/sms.py --sendinfo phone_number 120 000 "alert"
(replace phone_number with your #)


My GPS icon appears. it's flashing, but no solid connection after 1 minute

boxhead 2010-08-18 18:16

Re: SMS-based stolen phone locator
 
Quote:

Originally Posted by AlexV12 (Post 790829)
My GPS icon appears. it's flashing, but no solid connection after 1 minute

Sometimes, you'll have to wait 5-10 min. But it's good that the GPS is flashing -- we know the python script is working. We just need to get the banana script running properly on all devices, which Sonny is working on.

Caballero 2010-08-18 18:18

Re: SMS-based stolen phone locator
 
They have something like this in Firefox https://addons.mozilla.org/en-US/firefox/addon/51329/ Who wants to try and report back if its any good. I will try it in Minefield or Fennec mobile if they have for it.

digitalvoid 2010-08-18 18:26

Re: SMS-based stolen phone locator
 
Quote:

Originally Posted by boxhead (Post 788860)
This script was born out of my rage of having my N900 stolen earlier this year. I wanted a simple SMS-based solution for retrieving my new N900 if it were ever stolen again. I used some python code for SMS send/recv and GPS tracking from the wiki and put it together for this.

...

I made a two part Python script for the CLI (control app & background daemon) which does just the same and more...

Control app:

Code:

Nokia-N900:~# smscon
== smscon - remote control utility ==
Options:
  -start  : start smscon
  -stop    : stop smscon
  -boot    : set start at device boot
  -unboot  : remove start at device boot
  -status  : get smscon_daemon status
  -log    : show the logfile
  -clear  : erase the log file
  -help    : this help menu

It also creates a log file:

Code:

Nokia-N900:~# smscon -log
(Tue Aug 17 13:28:05 2010) START: smscon_daemon active
(Tue Aug 17 13:28:05 2010) DAEMON: no arguments passed for daemon
(Tue Aug 17 13:28:05 2010) DAEMON: reading valid IMSI code (XXXXXXXXXXXXXXX) from file
(Tue Aug 17 13:28:05 2010) DAEMON: authorized IMSI code found
(Tue Aug 17 13:28:05 2010) DAEMON: smscon autoloads at boot

I can send specific SMS messages to my phone and so can control my phone with it.

The current functions are: reboot, shutdown, show remaining battery charge, send current gps coordinates, send frontcam picture to my own server, set up ssh connection with available connection (WLAN/GPRS) to my own server)

Sonny_Jim 2010-08-18 18:29

Re: SMS-based stolen phone locator
 
Quote:

Originally Posted by boxhead (Post 790804)
What does 'export' do? Also, is it working with upstart now?

No, not yet. I'll let you know when it does

Quote:

If so, could you attach your file to the post so I can test it and update the zip. Thx.
Don't take this the wrong way, but why are you using .zip files? The better way to do it would be with tar:

tar cvjf thief-be-found.tar.gz /etc/event.d/banana /usr/sbin/sms*

Which would package them all up in a friendly manner so a user can unpack with this:

tar xvjf thief-be-found.tar.gz -C /

No need for changing directories or chmod.

@digitalvoid:
Yeah, well I drive a ferrari and shag a supermodel, fancy sharing your code or what?

Laughing Man 2010-08-18 18:41

Re: SMS-based stolen phone locator
 
Quote:

Originally Posted by Sonny_Jim (Post 790670)
The only issue I see is if the thief decides to wipe the OS, but I don't think the average crim is going to be bothered enough to do that, probably too busy looking through all your photo's and music!

But good work! Even if it saves just one N900 from the crack heads then it has to be worth it.

The positive and negative side of having an N900..

Most people can't use it. Especially if they're looking for the user friendliness of an iPhone or Android device. I keep forgetting how to reflash my device myself once in a while.

Heck install openssh, create a reverse tunnel and you'll be able to mess with the thief's head by using command line commands to make the device do what you want. =P

AlexV12 2010-08-18 18:42

Re: SMS-based stolen phone locator
 
Quote:

Originally Posted by digitalvoid (Post 790854)
I made a two part Python script for the CLI (control app & background daemon) which does just the same and more...

Control app:

Code:

Nokia-N900:~# smscon
== smscon - remote control utility ==
Options:
  -start  : start smscon
  -stop    : stop smscon
  -boot    : set start at device boot
  -unboot  : remove start at device boot
  -status  : get smscon_daemon status
  -log    : show the logfile
  -clear  : erase the log file
  -help    : this help menu

It also creates a log file:

Code:

Nokia-N900:~# smscon -log
(Tue Aug 17 13:28:05 2010) START: smscon_daemon active
(Tue Aug 17 13:28:05 2010) DAEMON: no arguments passed for daemon
(Tue Aug 17 13:28:05 2010) DAEMON: reading valid IMSI code (XXXXXXXXXXXXXXX) from file
(Tue Aug 17 13:28:05 2010) DAEMON: authorized IMSI code found
(Tue Aug 17 13:28:05 2010) DAEMON: smscon autoloads at boot

I can send specific SMS messages to my phone and so can control my phone with it.

The current functions are: reboot, shutdown, show remaining battery charge, send current gps coordinates, send frontcam picture to my own server, set up ssh connection with available connection (WLAN/GPRS) to my own server)

perhaps ik would be good to combine your programs? sounds like you could help each other allot!

Sonny_Jim 2010-08-18 18:43

Re: SMS-based stolen phone locator
 
You are far, far more likely to have a cell connection than a wifi connection if the phone is stolen, so it's best to use the GSM side rather than relying on the thief to connect to the internet.

boxhead 2010-08-18 19:10

Re: SMS-based stolen phone locator
 
Quote:

Originally Posted by Sonny_Jim (Post 790858)
Don't take this the wrong way, but why are you using .zip files? The better way to do it would be with tar:

tar cvjf thief-be-found.tar.gz /etc/event.d/banana /usr/sbin/sms*

Which would package them all up in a friendly manner so a user can unpack with this:

tar xvjf thief-be-found.tar.gz -C /

No need for changing directories or chmod.

That works great. Maybe archiving it this way will fix the possible file formatting issues. I've updated the OP with the new file.

Sonny_Jim 2010-08-18 19:16

Re: SMS-based stolen phone locator
 
There's other issues as well, like you don't need the tmp file. Here is what I have at the moment:

#!/bin/sh
VALID_IMSI=
SEND_TEXT_INTERVAL=120.0
HOME_PHONE=
TIME_WAIT_TO_CALL=60
ALERT_CODE=""
imsiNum=`dbus-send --system --type=method_call --print-reply --dest=com.nokia.phone.SIM /com/nokia/phone/SIM Phone.Sim.get_imsi | grep string | cut -f 2 -d '"'`
echo $imsiNum
if [ $imsiNum -ne $VALID_IMSI ]; then
python /usr/sbin/sms.py --sendinfo $HOME_PHONE $SEND_TEXT_INTERVAL $imsiNum $ALERT_CODE
python /usr/sbin/sms.py --listen 0 $SEND_TEXT_INTERVAL $imsiNum $ALERT_CODE &
sleep $TIME_WAIT_TO_CALL
run-standalone.sh dbus-send --system --type=method_call --print-reply --dest=com.nokia.csd.Call /com/nokia/csd/call com.nokia.csd.Call.CreateWith string:"$HOME_PHONE" uint32:0
else
python /usr/sbin/sms.py --listen 0 $SEND_TEXT_INTERVAL $imsiNum $ALERT_CODE &
fi


Notice that you don't need to write/read a tmpfile, you can just use a backtick. But for some really annoying reason it still isn't working,

p.s You didn't just copy and paste my tar command? I think you might have picked up sms-manager with the wildcard if you did.


All times are GMT. The time now is 13:02.

vBulletin® Version 3.8.8