Home About Archives Contact Guest Post Privacy Policy  
 

Find Your Lost Pre With GPS Tracking

All info can be found here: GPS Tracking @ Pre Dev Wiki

This little modification will allow you to track your Palm Pre
if it ever gets lost or stolen.  Just ask this guy what he thinks
about GPS tracking on his iPhone.

After implementing this GPS tracking method, your Pre will
email you updates with GPS coordinates based on a predefined
schedule. 

The email you receive will contain the Pre's battery
information as well as a Google Maps link of where the GPS coordinates
are pointing to.

pre gps track gmail emails

pre gps track gmail emails google maps

To start, you'll need to have a rooted Pre with SSH access.

Instructions:

1. Mount the file system with read-write access.

mount -o remount,rw /

2. Make a directory for the GPS tracking script we're about to make.

mkdir /home/scripts

3. Add the code below to the beginning of the /etc/event.d/crond to enable the
cron daemon at startup.

start on stopped configure
stop on runlevel [!2]
description "crond"

4. Create a crontab entry and schedule the tracking script to run. NOTE: I'm
using nano as the text editor. If you do not have nano, you can install it using
the Optware package feed, or just use vi as the editor.

mkdir -p /etc/cron/crontabs
nano -w /etc/cron/crontabs/root

Add the following to /etc/cron/crontabs/root:

*/5 * * * * /home/scripts/track.sh

The */5 means the script will run every time the number of minutes
is divisible by 5. E.g. at 5, 10, 15 minutes, etc.  Increase the denominator
for less frequent updates.

5. Finally, create the track.sh script in the /home/scripts directory created in
step 2.

nano -w /home/scripts/track.sh

Copy/paste the code below, but be sure to edit line 2 to include your email
address

#!/bin/sh
DEST=YOUR_USERID@DOMAIN.com

pos=$(luna-send -n 2 palm://com.palm.location/startTracking
'{"appId":
"ILovePalm", "subscribe": true}' 2>&1 | tail -1 | cut -d,
-f4,5,8 |
sed -r 's/[^-\.0-9,]//g')

lat=$(echo $pos | cut -d, -f1)
lon=$(echo $pos | cut -d, -f2)
spd=$(echo $pos | cut -d, -f3)
bat=$(grep BATTERY: /var/log/messages | tail -1 | awk '{print
$8}' |
sed 's/%,//')

now=$(date)

# Enable this below if you want to keep logs - not sure where
to write
them /var/home/root not the best place.
# echo $now,$lat,$lon,$spd,$bat >>mygpsdata.log

#Build a message variable for all the data to be logged.
msg=$(echo $now,$lat,$lon,$spd,$bat )

#Build message content to be sent
msg2=$(echo $now Speed:$spd  Battery Level:$bat  URL http://maps.
google.com/maps?q=$lat%2C$lon)

ret1=$(luna-send -n 1 palm://com.palm.messaging/sendMessageFrom
Compose '{"recipientJSONArray": [{"value": "'${DEST}'", "contact
Display": "'${DEST}'", "prefix": "to$A", "identifier": "palm_anon_
element_8"}], "messageText": "'"$msg2"'"}' 2>&1)

exit

6. Reboot your phone to start the cron daemon and you're finished. 

You should now see emails coming into your inbox with the GPS
coordinates of your Pre.  I just archive the emails in Gmail to keep my inbox from becoming cluttered.

Here's the tracking in action:

pre gps track google maps

 

Copyright © 2010 IsYouGEEKedUp.com All Rights Reserved