maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   N900 physical recovery (Getting your phone back!) [HOWTO] (https://talk.maemo.org/showthread.php?t=47301)

craftyguy 2010-03-13 23:42

Re: N900 physical recovery (Getting your phone back!) [HOWTO]
 
Quote:

Originally Posted by synthaxx (Post 566435)
@craftyguy:

In testing this i was consistently able to setup a connection using the public IP, but this might not work for your provider.
Instead you could go the reverse port forwarding route.
This will require you have an ssh-able server on the other end, not to mention you'd still need some way to consistently reconnect. If someone has a version of autossh that runs on the phone that'd be ideal for this.

As said, this is not meant to be a all inclusive guide, more of a list of pointers and commands that, should your phone be lost, can be used to track it down.


Interesting concept. For the record, I'm on T-Mobile here in the US.

n61adm 2010-03-13 23:51

Re: N900 physical recovery (Getting your phone back!) [HOWTO]
 
Great GUIDE!

synthaxx 2010-03-14 00:02

Re: N900 physical recovery (Getting your phone back!) [HOWTO]
 
Quote:

Originally Posted by TomJ (Post 566259)
I still like the option of setting up a daemon to check a file on a server you have access to for a trigger to send the front cam photo and lat/long to an email address or save it to a server.

As would i, but since it's not available yet i still wanted a way to get it back. Using this guide when a deamon is available will allow you to even install it if it's still lost.
Think of this as a fallback option. That's why it has single line (easily copy+pasted) commands in it.

Crogge 2010-03-14 00:06

Re: N900 physical recovery (Getting your phone back!) [HOWTO]
 
Really useful tutorial, didn't had a clue till now how I can make it vibrating with commands, or how to make a call that way and stuff, thanks :)

The only part which I can't get working is:

Quote:

gst-launch v4l2src device=/dev/video1 num-buffers=1 ! ffmpegcolorspace ! jpegenc ! filesink location=frontcam.jpg
It say's unknown command (Qst-launch)

synthaxx 2010-03-14 00:08

Re: N900 physical recovery (Getting your phone back!) [HOWTO]
 
Quote:

Originally Posted by Crogge (Post 566451)
It say's unknown command (Qst-launch)

That could be the problem ;) (it's gst-launch, also keep in mind that these commands are CaSe SeNsiTiVe :D)

synthaxx 2010-03-14 00:17

Re: N900 physical recovery (Getting your phone back!) [HOWTO]
 
Quote:

Originally Posted by craftyguy (Post 566437)
Interesting concept. For the record, I'm on T-Mobile here in the US.

I'm on T-Mobile Netherlands, and even accessing the webserver on the public IP seems to work. Sucks that it doesn't work the same way for everyone.

It got me thinking though, if instead of the "write ip to a file" line in the if-up script you put a reverse port forward like:
Code:

ssh -R 2210:localhost:22 [yourserver]
would that consistently reconnect an ssh session to your server without any problems?

Might be worth trying out.

TomJ 2010-03-14 08:15

Re: N900 physical recovery (Getting your phone back!) [HOWTO]
 
Quote:

Originally Posted by synthaxx (Post 566447)
As would i, but since it's not available yet i still wanted a way to get it back. Using this guide when a deamon is available will allow you to even install it if it's still lost.
Think of this as a fallback option. That's why it has single line (easily copy+pasted) commands in it.

Oh, I'm not denigrating your good work here, just looking at a next step. You seem to have all the necessary scripts for uploading the recoverry gen; is it possible to trigger them using, frinstance, alarmed?

Aranel 2010-03-14 15:41

Re: N900 physical recovery (Getting your phone back!) [HOWTO]
 
Quote:

Originally Posted by TomJ (Post 566259)
I still like the option of setting up a daemon to check a file on a server you have access to for a trigger to send the front cam photo and lat/long to an email address or save it to a server. This means that if it is out of signal range of any network when you try to get hold of it, it can still get the info to you when it finds a network connection...

And.. Is there any HOWTO available to do it?

ecksun 2010-03-14 19:40

Re: N900 physical recovery (Getting your phone back!) [HOWTO]
 
Excellent collections of one liners synthaxx, here is what I modified:

Writing your IP to a file does not really have anything to do with ping reply, so for better abstraction I created a new file instead of editing /etc/network/if-up.d/00_disable_icmp_echo_reply
I named it /etc/network/if-up.d/10_send_ip
Code:

#!/bin/sh
ifconfig gprs0|awk '/inet addr/ { print $2 }'|awk -F: '{ print $2 }' > /tmp/n900ip

I might also mention that I had some problems SCP:ing the file to my server, considering the script isn't run as my user, my SSH config doesn't get used, add the -F parameter in order to use a specific config file.

Code:

scp -F /home/user/.ssh/config /tmp/n900ip

You can also skip saving the IP to a file by changing the file 10_send_ip to:

Code:

#!/bin/sh
SERVER_HOST=remote.computer.org
LOGGFILE=n900_ip_logg
ip=`ifconfig gprs0|awk '/inet addr/ { print $2 }'|awk -F: '{ print $2 }'`
ssh -F /home/user/.ssh/config $SERVER_HOST "echo `date` $ip >> $LOGGFILE"


synthaxx 2010-03-15 09:47

Re: N900 physical recovery (Getting your phone back!) [HOWTO]
 
@ecksun
Thanks! I was just trying to get this to go directly to an ssh session, and yours works very nicely.

I agree that putting it in the disable echo reply script is not the prettiest method, but since that script will only execute with an external connection it'd do for now.


Got me thinking too. What if you have the script checking for a specific file, something like "stolen" on your server. If that file exists, start a reverse portforward.

That way, if you make that file it'll start an ssh which allows people that don't have direct access to the ssh session via their public ip to still access it remotely.


All times are GMT. The time now is 16:06.

vBulletin® Version 3.8.8