|
2010-03-28
, 02:25
|
Posts: 45 |
Thanked: 17 times |
Joined on Mar 2010
|
#32
|
|
2010-03-28
, 06:26
|
Posts: 477 |
Thanked: 118 times |
Joined on Dec 2005
@ Munich, Germany
|
#33
|
I saw this thread but immediately saw that it is not going to work unless you use the phone to intiate a reverse ssh tunnel to a remote host, due to most internet connections being NAT.
|
2010-03-28
, 16:41
|
Posts: 82 |
Thanked: 44 times |
Joined on Feb 2010
|
#34
|
3. create a file in /etc/network/if-up.d/ that contains something like:
ssh -o ExitOnForwardFailure=yes -vvnTNx -p 443 -R 22222:localhost:22 user@remotehost
This way, every time it connects to the internet, it will try to create a reverse tunnel to your remote host.
|
2010-03-28
, 20:47
|
Posts: 45 |
Thanked: 17 times |
Joined on Mar 2010
|
#35
|
but it will also open a port in the NAT router so that it can be called.
My question is this - if I only allow the device to connect to the internet via wifi, is there any way that this tunnel could use one of the other interfaces to send/receive data? (they go up, even if they don't get an internet connection, right?),
The Following User Says Thank You to Sonny_Jim For This Useful Post: | ||
|
2010-03-29
, 02:21
|
Posts: 82 |
Thanked: 44 times |
Joined on Feb 2010
|
#36
|
There is a global var that tells you whether you are connected via wlan or gprs, so you can use that to stop it from sending data when it's using GPRS:
if [ "$ICD_CONNECTION_TYPE" != GPRS ]; then
It could quite easily use GPRS and shouldn't use much bandwidth at all unless you use the tunnel.
|
2010-04-02
, 17:45
|
Posts: 1,341 |
Thanked: 708 times |
Joined on Feb 2010
|
#37
|
Now save and run it withCode:... def on_changed(device, data): if not device: return if device.fix: if (device.fix[1] & location.GPS_DEVICE_LATLONG_SET) and (device.fix[1] & location.GPS_DEVICE_TIME_SET) and not (device.status & location.GPS_DEVICE_STATUS_NO_FIX): print "lat = %f, long = %f" % device.fix[4:6] data.stop() ... loop.run()
If everything goes well you'll get a LAT LONG you can plug into google maps.Code:python2.5 gps.py
If it's out of GPS range, you'll have to kill it with CTRL+C.
|
2010-04-06
, 14:08
|
Posts: 22 |
Thanked: 19 times |
Joined on Nov 2009
|
#38
|
How to change that Python script to get altitude also?
(Sowwy for being lazy and not look it up from specs myself.)
$ diff oldgps.py gps.py 14c14 < print "lat = %f, long = %f" % device.fix[4:6] --- > print "lat = %f, long = %f, alt = %f" % (device.fix[4:6] + (device.fix[7],))
|
2010-04-06
, 19:01
|
Posts: 2 |
Thanked: 0 times |
Joined on Apr 2010
|
#39
|
|
2010-04-08
, 09:23
|
|
Posts: 880 |
Thanked: 264 times |
Joined on Feb 2007
@ Cambridge, UK
|
#40
|
1. setup an ssh server on a remote host that is on the internet. I run it on port 443 as it's unlikely that it'll get blocked
only one problem: perl on de n900 seems to lack the sys/hostname.pm module.
so i copied this from my ubuntu box to the n900 , made the configfile in /etc/ddclient, made a /var/cache/ddclient dir and the ddclient is running and updating my ip adress with zonedit
very happy with this..
planning to run it every time the gprs0 goes ip .. if its on wifi i guess remote ssh'ing is useless when stolen, they have to forward all ssh traffic for this to work..