FORUMS
Remove All Ads from XDA

TrackMe's web development and user plugins. Developers welcome!!

2,559 posts
Thanks Meter: 129
 
Post Reply Email Thread
As some people suggested I'm creating an specific thread for TrackMe's web development.

TrackMe is a free GPS/WiFi/Cell ID tracking tool. You can watch your tracks (saved or live) with Google Earth, Google Maps (or any tool that accepts KML or GPX files). It also includes many other options and features.
You can also watch your tracks from the web. This thread is focused on that part.

TrackMe is available for Android, Windows Mobile and Windows Phone 7. Check my signature for support for each version.

Visit TrackMe's web page


If you are interested you can contribute working on one of the existing viewers or creating one of your own.


OFFICIAL RELEASE

Authors
pammetje, mcross, jcleek and Staryon (only TrackMe client<->server communication)

Database
MySQL

Language
PHP

Download
Press here to download the latest version

Screenshots

The Following User Says Thank You to _LEM_ For This Useful Post: [ View ] Gift _LEM_ Ad-Free
 
 
30th January 2009, 06:27 PM |#2  
_LEM_'s Avatar
OP Senior Member
Thanks Meter: 129
 
Donate to Me
More
Here is some description for the TrackMe-Server communication

Requests.xxx file
Code:
All requests
------------

Result:1 User correct, invalid password.
Result:2 User did not exist but after being created couldn't be found.
Result:3 User or password not specified.
Result:4 Unable to connect database.
Result:5 Incompatible database.


Action="delete"
---------------

Result:0 OK


Action="deletetrip"
-------------------

Result:0 OK
Result:6 Trip not specified.
Result:7 Trip not found


Action="addtrip"
----------------

Result:0 OK
Result:6 Trip not specified.


Action="renametrip"
------------------

Result:0 OK
Result:6 Trip not specified.
Result:7 New name not specified.


Action="findclosestbuddy"
-------------------------

Result:0|DISTANCE|DATEOCCURRED|USERID              
Result:6 User has no positions.
Result:7 No positions from other users found.



Action="gettriplist"
------------------

Result:0|NAME1|DATE2\nNAME2\DATE2\n ...  
Result:6 Trip not specified.
Result:7 New name not specified.



Action="geticonlist"
------------------

Result:0|ICON1|ICON2|ICON3 ...



Action="upload"
------------------

Result:0 OK
Result:6 Trip didn't exist and system was unable to create it.
Result:7|SQLERROR   Insert statement failed.


Action="sendemail"
------------------ 

Result:0 OK



Action="updateimageurl"
------------------ 

Result:0 OK


Action="findclosestpositionbytime"
----------------------------------

Result:0|POSITIONID|DATEOCCURRED
Result:6 Date not specified
Result:7 No position for user found.


Action="findclosestpositionbyposition"
--------------------------------------

Result:0|POSITIONID|DATEOCCURRED|DISTANCE
Result:6 Position not specified
Result:7 No position for user found.


Action="gettripinfo"
--------------------

Result:0|totalmiles|startdate|enddate|totaltime|totalpositions|maxspeed|avgspeed|maxaltitude|avgaltitude|minaltitude
Result:6 Trip not specified
Result:7 Trip not found


Action="gettriphighlights"
--------------------------

Result:0|Latitude1|Longitude1|ImageURL1|Comments1|IconURL1\nLatitude2|Longitude2|ImageURL2|Comments2|IconURL2\n ...
Result:6 Trip not specified
Result:7 Trip not found
I will be adding the rest of the files later...
30th January 2009, 06:28 PM |#3  
_LEM_'s Avatar
OP Senior Member
Thanks Meter: 129
 
Donate to Me
More
Plugins


1. TrackMe (NMEA records) to OziExplorer (.plt) converter by tahdor

Description:
Simple perl script which takes the TrackMe (NMEA records) and put them as OziExplorer (.plt) format. Then you can open the .plf record in GpsVp to view the track.

Code:
# TrackMe.To.GpsVp.pl
#

$pll_ifname = "/Program Files/TrackMe/gpspositions.txt";
$pll_ofpath = "/Storage Card/Maps gpxVPTracks/";
#$pll_ifname = "gpspositions.txt";
#$pll_ofpath = "";

$pll_ofname = "gpspositions.plt";
$pll_ofname_date = "";
$maxtrack = 12;

sub pls_open_infile {
	local ($pll_ifname, *PLL_F_IN_FPTR) = @_;
	if (! open (PLL_F_IN_FPTR, "$pll_ifname")) {
		warn "$pll_ifname: $!\n";
		return -1;
	}
	return 0;
}

sub pls_open_outfile_overwrite {
	local ($pll_outfname, *PLL_F_OUT_FPTR) = @_;
	if (!open (PLL_F_OUT_FPTR, ">$pll_outfname")) {
		warn "$pll_outfname: $!\n";
		# die "$pll_outfname: $!\n";
		return -1;
	}
	return 0;
}


sub pls_open_outfile_append {
	local ($pll_outfname, *PLL_F_OUT_FPTR) = @_;
	if (!open (PLL_F_OUT_FPTR, ">>$pll_outfname")) {
		warn "$pll_outfname: $!\n";
		# die "$pll_outfname: $!\n";
		return -1;
	}
	return 0;
}

if (&pls_open_infile($pll_ifname, PLL_F_IN_FPTR) < 0) {
	die "couldn't open output file $pll_ifname\n";
}
if (&pls_open_outfile_overwrite($pll_ofname, PLL_F_OUT_FPTR) < 0) {
	die "couldn't open output file $pll_ofname\n";
}


sub output {
	if ("$lat_rmc" ne "0") {
		print PLL_F_OUT_FPTR sprintf ("%2.7f,%2.7f,0,%3.1f,%d,%s,%s\n", $lat_rmc,
			$long_rmc, $alt_gga * 3.2808399, 0, $date, $time_rmc);
	}
}

sub latitude {
	my ($deg, $min) = unpack "a2a*", $_[0];
	my $lat = $deg + $min / 60;
	$lat = - $lat if $_[1] =~ /[Ss]/;
	return $lat;
}

sub longitude {
	my ($deg, $min) = unpack "a3a*", $_[0];
	my $long = $deg + $min / 60;
	$long = - $long if $_[1] =~ /[Ww]/;
	return $long;
}

while ($line = <PLL_F_IN_FPTR>) {
	chomp($line);
	@field = split /[,*]/, $line;
	SWITCH: {

		# recommended minimum specific GPS/Transit data
		if ($field[0] =~ /GPRMC/) {

			# $time_rmc = join ':', unpack "a2" x 3, $field[1];
			$time_rmc = join '.', unpack "a2" x 3, $field[1];
			$ok_rmc = $field[2];
			$lat_rmc = latitude(@field[3..4]);
			$long_rmc = longitude(@field[5..6]);
			$speed = $field[7];
			$cmg = $field[8];
			#$date = join '-', unpack "a2" x 3, $field[9];
			$date = substr($field[9],4,2) .'-'. substr($field[9],2,2) .'-'. substr($field[9],0,2);
			$mvar = $field[10] . $field[11];
			# field[12] is checksum


			if ($date ne $pll_ofname_date) {
				$pll_ofname = $pll_ofpath . "Tm.$date.$time_rmc.plt";
				$pll_ofname_date = $date;
				if (&pls_open_outfile_overwrite($pll_ofname, PLL_F_OUT_FPTR) < 0) {
					die "couldn't open output file $pll_ofname\n";
				}
				print PLL_F_OUT_FPTR "OziExplorer Track Point File Version 2.1\n";
				print PLL_F_OUT_FPTR "WGS 84\n";
				print PLL_F_OUT_FPTR "Altitude is in Feet\n";
				print PLL_F_OUT_FPTR "Reserved\n";
				print PLL_F_OUT_FPTR "0,2,128,,0,0,2,0\n";
				print PLL_F_OUT_FPTR "1\n";
			}

			output();
			last SWITCH;
		}
	
		# GPS fix data
		if ($field[0] =~ /GPGGA/) {
			$time_gga = join ':', unpack "a2" x 3, $field[1];
			$lat_gga = latitude(@field[2..3]);
			$long_gga = longitude(@field[4..5]);
			$fixqual = $field[6];
			$nsat = $field[7];
			$hdop_gga = $field[8];
			$alt_gga = $field[9];
			# $field[10] is altitude units (always M)
			$gheight = $field[11];
			# $field[12] is geoid height units (always M)
			$DGPS_age = $field[13];
			$DGPS_ID = $field[14];
			# field[15] is checksum;
			last SWITCH;
		}
	}
}


2. User limitation for web viewer access by Real_Justus

Description:
Limit access to Web viewer for servers running in public mode

I was wondering how I could limit the access to my server. I wanted a group of users to be able to track all TrackMe clients via GoogleMaps.
The attached three files will enable a simple authorization for users. The server has to be installed accessable for everyone (public).
To create the authorziation, you have to edit .htaccess and htpasswd from the ZIP attached as follows:
1: Open .htaccess with the texteditor.
2: In the line "AuthUserFile" you have to add the WHOLE path to .htpasswd.
3: .htpasswd contains the users. The username is just plain text. The password is ht-encrypted. You can encrypt passwords here.
4: When both files are modifyed for your needs, upload them to the TrackMe directory on your server. If this is done correctly, a simple authorization is required for opening the webinterface for your TrackMe-server. All valid users can Track all clients.

If you don´t know the exactly path, upload phpinfo.php from the ZIP attached to the TrackMe directory on your server and open the file in your browser. (http://www.yourserver.com/TrackMe/phpinfo.php). Search for "Document_ Root" The path might be something like: /var/www/user/html/YourTrackMe/Directory. Insert the path in .htaccess

!!!Make sure to delete the phpinfo.php after use!!!

Files: Download



3. Plugin that allows you to assign multiple pictures to a single position by ElHozo

Description:
I've made a change in tod files of the server to allow view of multiple pictures in on dialog ballon. This (at least for me) is very usefull when you want to take many pictures from one place (no position change)


You have to edit to files

in request.php make this change to allow having multiples images in one single position record


Code:
if($action=="updateimageurl")
    {
    $imageurl = urldecode($_GET["imageurl"]);
    $id = urldecode($_GET["id"]);

    $iconid='null';
    $result=mysql_query("Select ID FROM icons WHERE name = 'Camera'");
    if ( $row=mysql_fetch_array($result) )
        $iconid=$row['ID'];

    /* HOZO 20/Jun/2009 : Esta es la modficacion que permite poner mas de una
     * imagen en un solo punto, pone las url una atras de otra saparadas por un
     * espacio. la linea que queda comentada es la original.
     * Ver en index.php el cambio que las muestra en el globo del dialogo */
    // BEGIN ORIGINAL CODE - MUST BE COMMENTED
    //mysql_query("update positions set imageurl='$imageurl',fk_icons_id=$iconid where id=$id");
    // END ORIGINAL CODE
    // BEGIN NEW CODE
    mysql_query("update positions set imageurl=CONCAT_WS(' ', imageurl, TRIM('".$imageurl."')), fk_icons_id='".$iconid."' where id='".$id."'");
    // END NEW CODE

    echo "Result:0";
    die();
    }
in index.php change this to show multiple images in one dialog balloon

Code:
     if($row['ImageURL'])
                        {
                           /* HOZO 20/Jul/2009 : Agregar este pedazo de codigo en reemplazo del orginal,
                           * la ultima linea que esta comentada es la orgiinal.*/
                          // BEGIN NEW CODE

                            // Por las dudas me aseguro de eliminar espacios duplicados
                            $row['ImageURL'] = eregi_replace ("  ", " ", $row['ImageURL']);
                            $row['ImageURL'] = eregi_replace ("  ", " ", $row['ImageURL']);
                            $stFotos = explode (" ", trim($row['ImageURL']));

                            // Armo la cantidad de columnas y tamaño de la imagen del globo
                            // de acuerdo a la cantidad de fotos que haya para mostrar
                            if (count ($stFotos) == 1)
                                {
                                $inFotosCols = 1;
                                $inImgWidth = 200;
                                }
                            else
                                {
                                $inFotosCols = count ($stFotos);
                                if ($inFotosCols > 16)
                                    $inFotosCols = 5;
                                else if ($inFotosCols > 9)
                                    $inFotosCols = 4;
                                else if ($inFotosCols > 3)
                                    $inFotosCols = 3;
                                $inImgWidth = ( 400 / $inFotosCols ) - 5;
                                }

                            $html .= "<tr><td>";
                            $html .= "<table>";
                            $inFotoIndex = 0;
                            while (list ($inKey, $szData) = each ($stFotos))
                                {
                                if ( ($inFotoIndex % $inFotosCols) == 0)
                                    $html .= "<tr>";
                                $inFotoIndex++;
                                $html .= "<td><a><img></a></td>";
                                if ( ($inFotoIndex % $inF";
                                }
                            $html .= "</tr>";
                            $html .= "</table>";
                            $html .= "</td>";
                            $html .= "</tr>";
                            // END NEW CODE
                            // La que sigue es la linea orignal de codigo
                            // BEGIN ORIGINAL CODE - MUST BE COMMENTED
                            //$html .= "    <tr><td><a><img></a></td></tr>";
                            // END ORIGINAL CODE
                        }
Know issues : The filed imgeurl in DB is limited to 255 chars, is better if you change this value to something bigger to fit more images urls.
I have included a ZIP with the two modified files

Files: Download
30th January 2009, 07:19 PM |#4  
WatskeBart's Avatar
Senior Member
Flag AMS-IX
Thanks Meter: 8
 
More
Great new thread!
Let the development begin!
30th January 2009, 08:56 PM |#5  
Member
Flag Magny les Hameaux
Thanks Meter: 1
 
More
With the advice of timoline I'm playing (and I'm trying to understand) with open-flash-chart.
Here is my first try :


When you move the mouse on the graphic, there is a sticker with the speed.
I'm trying to add the altitude on red with the Y axis right. But It doesn't works for now.

Thanks for your advice Timoline .
31st January 2009, 10:05 AM |#6  
Junior Member
Thanks Meter: 0
 
More
Is there some sort of ocumentation about the TrackMe <-> Webserver communication? It would be nice if you can write a little about this.

I point as I browsed the source I saw that the password was transmit unencrypted maybe you can change that to md5 or somthing similar?

Btw. Trackme is a great App
31st January 2009, 01:40 PM |#7  
_LEM_'s Avatar
OP Senior Member
Thanks Meter: 129
 
Donate to Me
More
Quote:
Originally Posted by Diggen

Is there some sort of ocumentation about the TrackMe <-> Webserver communication? It would be nice if you can write a little about this.

I point as I browsed the source I saw that the password was transmit unencrypted maybe you can change that to md5 or somthing similar?

Btw. Trackme is a great App

Thanks.

Unfortunately there is not doc about the server-client communication.
However, feel free to ask any questions about that here.

Regarding the encrypted pass... yes, that's in the to-do list (actually it has been there for a long time) but there is something that I want to ask.

Let's suppose that from the client I do $encrypted = encode_md5(password)
And now that's what I send to the server.
On the server side, should I do $pass = decode_md5 ($encrypted) ?
or it's not necessary because I am going to store the pass already encrypted in the database?

And one more thing, what's really the purpose of that encoding? If somebody has access to the encrypted password, wouldn't he be able to do the same things than if it is not encrypted?
I mean if I my password is role392 and the encryped one is sadj2jkfDk43j54... what's really the difference? Both are like regular passwords.

I hope it makes sense.
31st January 2009, 11:39 PM |#8  
Junior Member
Thanks Meter: 0
 
More
It makes more or less sense
Normal a webapp stores the password 'encrypted' with md5 in its Database. From the Login it gets clearly send per Post and the server will 'encrypt' it. Then it verfy it against the md5 hash in the db. You will be still able to sniff it but if the DB gets hacked you will only have the md5 values which can't be decoded. Also because of the Post-Method the Pass is not clearly visible in the URL.

Thats not much secruity but a little more. Maybe you can XOR the md5 with the actuall hour/minute at the client side and send it. At server-side you will do the same with the saved md5 an look if they are the same. This is a little more secure but not much.
I hope you understand me and my 'broken' Englisch


For the Docs I will have a look at the code when there is Time because I'am on a tenancy changeover(?).
1st February 2009, 04:30 PM |#9  
WatskeBart's Avatar
Senior Member
Flag AMS-IX
Thanks Meter: 8
 
More
Smile Language Update
I've updated the dutch part in the language.php from jcleek's web viewer.

See attachment:
Attached Files
File Type: zip language.zip - [Click for QR Code] (6.0 KB, 130 views)
1st February 2009, 10:04 PM |#10  
Junior Member
Thanks Meter: 0
 
More
I've been working on my own server development, at the moment I have:

1. Weather at the persons current or last postion.
2. Address of the persons current or last position (I think US only)
3. Geofence option that texts whoever the user wants to text when the user has entered a predefined area.
4. Ability to place markers on the map for whatever purpose the user chooses, business, personal or otherwise.
5. The server stores the mileage driven in each state or country if the user chooses for fuel tax or other reasons.
6. Server is not just limited to Trackme, it can also be an alturl for Mologogo, and a custom server for GPSGate. Server still retains all Trackme functionality.

http://fleettracking.fleettrack.net/maps.php

The frontend is still a little "raw", as I am concentrating on the back end for the moment.
2nd February 2009, 04:42 PM |#11  
_LEM_'s Avatar
OP Senior Member
Thanks Meter: 129
 
Donate to Me
More
Quote:
Originally Posted by Diggen

It makes more or less sense
Normal a webapp stores the password 'encrypted' with md5 in its Database. From the Login it gets clearly send per Post and the server will 'encrypt' it. Then it verfy it against the md5 hash in the db. You will be still able to sniff it but if the DB gets hacked you will only have the md5 values which can't be decoded. Also because of the Post-Method the Pass is not clearly visible in the URL.

Thats not much secruity but a little more. Maybe you can XOR the md5 with the actuall hour/minute at the client side and send it. At server-side you will do the same with the saved md5 an look if they are the same. This is a little more secure but not much.
I hope you understand me and my 'broken' Englisch


For the Docs I will have a look at the code when there is Time because I'am on a tenancy changeover(?).

Thanks a lot for the detailed explanation!!
I think I will start by encoding it in MD5 only in the database. I may add the XOR later.

Regards
Post Reply Subscribe to Thread

Tags
cell id, gps, tracking

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes