Reply
Thread Tools
Posts: 455 | Thanked: 278 times | Joined on Dec 2009 @ Oregon, USA
#11
Originally Posted by synthaxx View Post
@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.
 

The Following User Says Thank You to craftyguy For This Useful Post:
Posts: 53 | Thanked: 14 times | Joined on Mar 2010
#12
Great GUIDE!
 
Posts: 27 | Thanked: 74 times | Joined on Nov 2009
#13
Originally Posted by TomJ View Post
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.
 
Posts: 543 | Thanked: 151 times | Joined on Feb 2010 @ Germany
#14
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:

gst-launch v4l2src device=/dev/video1 num-buffers=1 ! ffmpegcolorspace ! jpegenc ! filesink location=frontcam.jpg
It say's unknown command (Qst-launch)
 
Posts: 27 | Thanked: 74 times | Joined on Nov 2009
#15
Originally Posted by Crogge View Post
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 )
 
Posts: 27 | Thanked: 74 times | Joined on Nov 2009
#16
Originally Posted by craftyguy View Post
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.
 

The Following 2 Users Say Thank You to synthaxx For This Useful Post:
TomJ's Avatar
Posts: 505 | Thanked: 665 times | Joined on Oct 2009
#17
Originally Posted by synthaxx View Post
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?
__________________
Want to know how to add public holidays to your device calendar? See the instructions wiki page.

Want to improve the location bar's search capabilities? there's a wiki page for that too...
 
Aranel's Avatar
Posts: 301 | Thanked: 227 times | Joined on Nov 2009 @ Turkey
#18
Originally Posted by TomJ View Post
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?
 
Posts: 22 | Thanked: 19 times | Joined on Nov 2009
#19
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"
 

The Following User Says Thank You to ecksun For This Useful Post:
Posts: 27 | Thanked: 74 times | Joined on Nov 2009
#20
@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.

Last edited by synthaxx; 2010-03-15 at 09:55.
 
Reply


 
Forum Jump


All times are GMT. The time now is 14:47.