Profile | Register | Active Topics | Search | FAQ

Advanced Search
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 GpsGate
 GpsGate for Developers
 GUIDE: Send GPS data using HTTP to your web site
 New Topic  Reply to Topic
 Printer Friendly
Next Page
Digg this
Author Previous Topic Topic Next Topic
Page: of 2

johan
Forum Admin

Sweden
15235 Posts

Posted - 07/08/2007 :  12:06:47  Show Profile  Visit johan's Homepage  Reply with Quote
How to send GPS data using HTTP to a web site

This article is for developers who wants to post GPS data to his own web site using HTTP.

GpsGate 2.5.0 build 207 (and later) can send GPS data over http. Any web server can receive and process the position data sent to it.

Please follow those steps to configure GpsGate.
1. Start GpsGate
2. Open the Settings dialog
3. Go to the Output tab
4. Add a "GpsGate.com (Send)" plugin.
5. Click on "..." (or "More Options..." in the 2.6 Windows version)
6. Change the "Protocol" to "HTTP".
7. Set "Server" to your web server address E.g. www.myaddress.com
8. Set the "File path" to the script address. E.g. /gpsgate.php if /gpsgate.php is the page on your web server to process the requests. Do not forget the first "/".
8. Click OK
9. Now configure in which intervals you want GpsGate to send data to your web site.
10. Click OK.

URL format
The URL posted will have the following parameters:
longitude=34.2333&latitude=23.2222&altitude=34.0&speed=30.3&heading=234.5&date=20070529&time=123445.234&username=myuser&pw=encryptedpassword

longitude: Decimal degrees (WGS84)
latitude: Decimal degrees (WGS84)
altitude: Above sea level in meters.
speed: Speed over ground in knots
heading: Heading in degrees. 0 is north, 90 is east, 180 is south, 270 is west.
date: UTC data in the format: YYYYMMDD
time: UTC time in the format: HHMMSS.sss
username: The username specified.
password: The password specified with a simple encryption. The encryption/decryption algorithm can be found here:
http://forum.gpsgate.com/topic.asp?TOPIC_ID=5638

End user deployment
All configuration in GpsGate are stored in XML files ending with the extension .ggXML, you can use those files for simpler configuration. If you prepare one ggXML file and copy it to the "Chains" folder in the GpsGate root directory, you can have a menu option with your settings ready in GpsGate!

GpsGate for Windows will also allow you to install a ggxml file over the web by clicking on it in a browser (this feature will soon be available in the PPC version as well). In this way you can provide a link to the ggxml file which contains the configuration to send data to your website.

Additional info
Note that you can also send data over TCP/IP and UDP using the "GpsGate.com (Send)" PlugIn.

When you select to send data to another server, no data will be sent to GpsGate.com

Regards,
Johan

Franson Support

tonyh
New Member

5 Posts

Posted - 07/08/2007 :  15:54:31  Show Profile  Reply with Quote
Tack s mycket Johan! Your service is incredible. I wish to express my gratitude by including some of my PHP Server-Side Code for the benefit of all of your GPS Gate customers who want to create dynamic Web services.

(This code is made available per GNU-GPL and, as such, no warranties or support is included or implied.)

Cheers,
Tony




<?
//	SYNOPSIS: Demonstration Consumption of REST HTTP Parameters from
//	Franson GPSGate in to create simple XML database of position
//
//	IMPLEMENTATION NOTES: Server-side: Tested with PHP 5.x on 
//	IIS server with IE client.  Client-side: Tested with Franson 
//	GPSGate v2.5.0.207 on PC running Windows XP SP2.
//	You need to create an empty placeholder file named 
//	position.xml in the same Web-accessible directory
//	as this file (consumeGPSGate.php).  Must grant "modify" 
//	permissions to position.xml on sever.  Use your Web browser to 
//	view position.xml to get the latest position after 
//	GPSGate posts the HTTP REST parameters to this 
//	file (consumeGPSGate.php).  Limitations: Currently stores 
//	only one position based on intervals set at GPSGate client. 
//
//	REDISTRIBUTION: Buy a Franson GPSGate License and feel free to 
//	use this code per GNU GENERAL PUBLIC LICENSE (GNU - GPL) Version 3.0 
//	http://www.gnu.org/licenses/gpl-3.0.txt 
//
//	Thank you Johan and the rest of the franson.com team for helping
//	me out!...8 July 2007 - Tony in San Diego (tonyh on franson.com forum)


//----------------------------------------------
//	Use dummy date to prevent caching of Web page and force refresh
//----------------------------------------------
// 	Date in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); 
// 	always modified
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// 	HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
// 	HTTP/1.0
header("Pragma: no-cache");
 

//----------------------------------------------
//	Set content type for XML
//----------------------------------------------
header("Content-type:text/xml");


//----------------------------------------------
//	REST HTTP Parameters
//----------------------------------------------
//	Decimal Degrees - WGS1984 Datum
$lat = $_GET["latitude"];
$lon = $_GET["longitude"];

//	meters above sea level
$alt_m = $_GET["altitude"];

//	knots
$vel_kt = $_GET["speed"];

//	Degrees
$head = $_GET["heading"];

//	UTC - YYYYMMDD
$date = $_GET["date"];

//	UTC - HHMMSS.sss
$time = $_GET["time"];

$user = $_GET["username"];
$pwd_encry = $_GET["pw"];


//----------------------------------------------
//	SI - English Conversions
//----------------------------------------------
//	Feet above sea level
$alt_ft = 3.2808399 * floatval($alt_m);

//	Miles per hour
$vel_mph = 1.15077945 * floatval($vel_kt);


//----------------------------------------------
//	Date - time parsing and RFC 822 date creation
//----------------------------------------------
//	Set timezone to UTC
date_default_timezone_set("UTC");

$year = substr($date, 0, 4);
$month = substr($date, 4, 2);
$day = substr($date, 6, 2);
$hour = substr($time, 0, 2);
$minute = substr($time, 2, 2);
//	Decimal seconds truncated
$second = substr($time, 4, 2);

//	RFC 822 Format: "Day, DD MMM YYYY HH:MM:SS UTC"
$date_RFC822 = date(DATE_RFC822, mktime($hour, $minute, $second, $month, $day, $year));


//----------------------------------------------
//	Simple dynamic generation of XML document
//----------------------------------------------
//	Declare new XML document
$dom = DOMDocument::loadXML('<positiondatabase/>');
$dom->preserveWhiteSpace = false;
$dom->encoding = "UTF-8";

//	documentElement refers to the root element!
$positiondatabase = $dom->documentElement;

//	Web 2.0 Metadata for reusability using W3 geo:lat and geo:long namespace standards
$positiondatabase->setAttributeNS('http://www.w3.org/2000/xmlns/','xmlns:geo','http://www.w3.org/2003/01/geo/wgs84_pos#');

//	Declare individual XML elements
$position = $dom->createElement("position");
$geolat = $dom->createElementNS("http://www.w3.org/2003/01/geo/wgs84_pos#","geo:lat",$lat);
$geolong = $dom->createElementNS("http://www.w3.org/2003/01/geo/wgs84_pos#","geo:long",$lon);
$alt_meters = $dom->createElement("altitude_m",$alt_m);
$alt_feet = $dom->createElement("altitude_ft",$alt_ft);
$vel_knots = $dom->createElement("velocity_kt",$vel_kt);
$vel_milesperhour = $dom->createElement("velocity_mph",$vel_mph);
$heading = $dom->createElement("heading_deg",$head);
$date_time = $dom->createElement("date_rfc822",$date_RFC822);
$username = $dom->createElement("user_name",$user);
$pwd_encryted = $dom->createElement("user_pwd_encrypt",$pwd_encry);

//	Inserting individual XML elements

//	append child nodes to root element
$dom->documentElement->appendChild($position);

//	append grandchild nodes to child elements
$position->appendChild($geolat);
$position->appendChild($geolong);
$position->appendChild($alt_meters);
$position->appendChild($alt_feet);
$position->appendChild($vel_knots);
$position->appendChild($vel_milesperhour);
$position->appendChild($heading);
$position->appendChild($date_time);
$position->appendChild($username);
$position->appendChild($pwd_encrypted);


//----------------------------------------------
//	XML Output Processing
//----------------------------------------------
//	Save new XML file output
$output = $dom->save('position.xml');

//	Make output readable
$dom->preserveWhitespace = false;
$dom->formatOutput = true;

//	Print XML file output to client display
print $dom->saveXML();
?>
Go to Top of Page

jpalten
New Member

2 Posts

Posted - 11/29/2007 :  03:56:15  Show Profile  Reply with Quote
Will this also work with the normal,main,global gpsgate.com server? Can my application use this interface to send my position to my buddies?
Go to Top of Page

johan
Forum Admin

Sweden
15235 Posts

Posted - 11/29/2007 :  04:24:50  Show Profile  Visit johan's Homepage  Reply with Quote
Yes, that will work.

Please download "GpsGate.com Client SDK" it has a PDF document which in detail with samples describes how you can send data from a client to GpsGate.com or GpsGate Server:
http://franson.com/gpsgateserver/download.asp

You can send data using TCP/IP, UDP and HTTP. The TCP/IP protocol is very interesting since it support device configuration and track buffering on the client side.

Regards,
Johan

Franson Support
Go to Top of Page

deputydave
Junior Member

USA
11 Posts

Posted - 12/12/2007 :  15:04:08  Show Profile  Visit deputydave's Homepage  Reply with Quote
I am trying to access this page on my 8125 PDA http://deputydave.com/minimap.html what am I missing?
Go to Top of Page

sweber
Starting Member

Denmark
1 Posts

Posted - 04/20/2008 :  02:52:57  Show Profile  Reply with Quote
Hi All

Following the instructions for setting up gpsgate accessing my own php script on myown server. I end up with the error message 404. This usually means that there is something wrong in the url and the url can not be found.
I am using the http protocol, after step 8 I will have the following in the server line "http://myserver.domain.xx/php/gate.php".
myserver.domain.xx is not the correct server name
Executing the test in gpsgate will give the above mentioned error.

Pasting the url above into a browser will give the result I expect, a response from the script gate.php.

If I use default settings and send to gpsgate.com with a usercode/password, I get the correct answer that the usercode/password are invalid.
hope someone can point me in the right direction.
Steen
Go to Top of Page

johan
Forum Admin

Sweden
15235 Posts

Posted - 04/20/2008 :  06:21:57  Show Profile  Visit johan's Homepage  Reply with Quote
Please follow those steps:

1. Open the GpsGate Settings dialog. Go to the "Output" tab
2. Check "Connect to custom GpsGate Server"
3. Click on "More options..."
4. Select HTTP as Protocol.
5. Enter "http://myserver.domain.xx/php/gate.php" as Server address and click OK
6. Click Next in the Wizard. Enter username / password and then "Finish"

You can also verify the connection by clicking "Test".

Regards,
Johan

Franson Support
Go to Top of Page

unicptz
New Member

6 Posts

Posted - 05/15/2008 :  06:30:03  Show Profile  Reply with Quote
All works with custom server, but when I reboot my ppc or exit gpsgate and start again all my properties (server name, protocol, mobile) don't save and become initial.
Go to Top of Page

johan
Forum Admin

Sweden
15235 Posts

Posted - 05/15/2008 :  06:44:02  Show Profile  Visit johan's Homepage  Reply with Quote
This can be because of the language used on your device. Which language is it? Which country are you from?

We have made some improvements on this in the latest release. But there are still some problem when file paths cannot be saved as Latin-1 characters.

Regards,
Johan

Franson Support
Go to Top of Page

unicptz
New Member

6 Posts

Posted - 05/15/2008 :  16:32:14  Show Profile  Reply with Quote
Russian. Windows mobile 5.0
The URL is "http://www.domain.ru/gps/getdata.php"
Go to Top of Page

johan
Forum Admin

Sweden
15235 Posts

Posted - 05/16/2008 :  03:58:44  Show Profile  Visit johan's Homepage  Reply with Quote
Yes, there is some problems to save Unicode paths in the settings files. We are aware of this limitation, and will try to fix it as soon as possible.

Try the latest version (build 321) it should improve things, and be less likely to fail saving the settings, even though it doesn't solve all known problems related to this.

Regards,
Johan

Franson Support
Go to Top of Page

bveldkamp
New Member

2 Posts

Posted - 05/27/2008 :  08:27:50  Show Profile  Reply with Quote
Does GpsGate support basic or digest authentication when sending data to an http server?
Go to Top of Page

johan
Forum Admin

Sweden
15235 Posts

Posted - 05/27/2008 :  08:31:01  Show Profile  Visit johan's Homepage  Reply with Quote
No, you need to authenticate the request using the username + password you get in the URL.

Regards,
Johan

Franson Support
Go to Top of Page

rudykstra
New Member

2 Posts

Posted - 06/09/2008 :  14:00:09  Show Profile  Reply with Quote
First of all, many thanks for this fantastic and stable program. I tried earlier versions which wouldn't work quite right, but this one is wordth every penny (or Euro)

My question;

I'm usig gps-gate client to send my position by HTTP to my own database. I've tried it for a day with an interval of 5 minutes. When I came home i found the interval to be quite big when I'm driving fast. However, for my occupation I have to wander (survey) distances of about 5 kilometrs per day and I want this logged as well. Therefore it is not a suitable option for me to switch to the 'log every fixed distance' option.

Can you tell me how big (how much data) the HTTP-calls to my database (website) are? If I know the amount of data a request aqcuires, I can calculate the most efficient settings for the interval.

Thanks in advance and kind regards,

Ruurd Dijkstra
Go to Top of Page

johan
Forum Admin

Sweden
15235 Posts

Posted - 06/10/2008 :  04:31:55  Show Profile  Visit johan's Homepage  Reply with Quote
The HTTP request is about 0.5 kB.

The reason you miss position updates when driving fast can be that GPRS will not always work completely stable when roaming between base stations, something that happens often when driving fast. The result will be that data is lost and some HTTP requests fails.

If no data may be lost you need to use the TCP/IP options which can handle bad connections without loosing data. It will also consumke less band width, but it will not work with a web server.

Regards,
Johan

Franson Support
Go to Top of Page

unicptz
New Member

6 Posts

Posted - 07/09/2008 :  05:11:37  Show Profile  Reply with Quote
quote:
Originally posted by johan

Yes, there is some problems to save Unicode paths in the settings files. We are aware of this limitation, and will try to fix it as soon as possible.

When are you going to solve this problem?
Go to Top of Page

johan
Forum Admin

Sweden
15235 Posts

Posted - 07/09/2008 :  09:03:27  Show Profile  Visit johan's Homepage  Reply with Quote
We don't have a fix yet, but it is on our radar.

Regards,
Johan

Franson Support
Go to Top of Page

unicptz
New Member

6 Posts

Posted - 07/09/2008 :  17:11:51  Show Profile  Reply with Quote
quote:
Originally posted by johan

We don't have a fix yet, but it is on our radar.

Thanks.

Maybe is it possible to write properties directly to file in program's directory?
Go to Top of Page

menq
New Member

China
2 Posts

Posted - 08/03/2008 :  21:42:46  Show Profile  Reply with Quote
thanks!
Go to Top of Page

bveldkamp
New Member

2 Posts

Posted - 09/04/2008 :  05:06:22  Show Profile  Reply with Quote
Are there any plans to support proper authentication? Personally I'd like to have NTLM, but basic or digest would be a nice start.

If not, are there any known workarounds?

Regards, Berend

quote:
Originally posted by johan

No, you need to authenticate the request using the username + password you get in the URL.

Regards,
Johan

Franson Support

Go to Top of Page

johan
Forum Admin

Sweden
15235 Posts

Posted - 09/04/2008 :  05:55:31  Show Profile  Visit johan's Homepage  Reply with Quote
No plans for the moment, but thanks for your feedback! We'll consider this for coming releases of GpsGate Client.

Regards,
Johan

Franson Support
Go to Top of Page

selphi81
New Member

2 Posts

Posted - 10/29/2008 :  04:37:58  Show Profile  Reply with Quote
7. Set "Server" to your web server address E.g. www.myaddress.com
8. Set the "File path" to the script address. E.g. /gpsgate.php if /gpsgate.php is the page on your web server to process the requests. Do not forget the first "/".
------------------------------------------------------------------
hi,i can't find "File path" in the 2.6 version,and the "server address" following "/GpsGate.aspx " can't delete.I'm looking foward to your support,thanks!
Go to Top of Page

johan
Forum Admin

Sweden
15235 Posts

Posted - 10/29/2008 :  06:49:32  Show Profile  Visit johan's Homepage  Reply with Quote
Click on "More options..." next to the field where you enter the server address. Select "HTTP" as protocol.

Regards,
Johan

Franson Support
Go to Top of Page

selphi81
New Member

2 Posts

Posted - 10/30/2008 :  00:48:51  Show Profile  Reply with Quote
thanks a lot for your support!
Go to Top of Page

sputnik2006
New Member

United Kingdom
7 Posts

Posted - 11/21/2008 :  17:12:49  Show Profile  Reply with Quote
quote:
Originally posted by johan

How to send GPS data using HTTP to a web site

This article is for developers who wants to post GPS data to his own web site using HTTP.

GpsGate 2.5.0 build 207 (and later) can send GPS data over http. Any web server can receive and process the position data sent to it.

Please follow those steps to configure GpsGate.

7. Set "Server" to your web server address E.g. www.myaddress.com
8. Set the "File path" to the script address. E.g. /gpsgate.php if /gpsgate.php is the page on your web server to process the requests. Do not forget the first "/".
8. Click OK
9. Now configure in which intervals you want GpsGate to send data to your web site.
10. Click OK.




Don't understand step 7 and onwards, how can I do this?

Regards
Go to Top of Page

johan
Forum Admin

Sweden
15235 Posts

Posted - 11/22/2008 :  14:01:24  Show Profile  Visit johan's Homepage  Reply with Quote
In the first step in the Wizard click on "More Options..." then select HTTP as protocol.

Regards,
Johan

Franson Support
Go to Top of Page

bksi
New Member

Bulgaria
2 Posts

Posted - 02/26/2009 :  09:23:59  Show Profile  Reply with Quote
Hi, all. This is very nice service, but I have one problem. The local service on http://localhost:12175/ does not return any coordinates on my mobile device. I'm using windows mobile v6. What would be the problem? I tried this html on IE and Opera mobile.
Go to Top of Page

johan
Forum Admin

Sweden
15235 Posts

Posted - 02/26/2009 :  10:12:54  Show Profile  Visit johan's Homepage  Reply with Quote
Pocket IE will not work. Opera Mobile will work.

Regards,
Johan

Franson Support
Go to Top of Page

EXXHAL
Starting Member

1 Posts

Posted - 06/20/2009 :  01:38:42  Show Profile  Visit EXXHAL's Homepage  Reply with Quote
Hello,

WHen i use my website server, where 2 get or what is the password and username i have 2 use there.

I get a 404 at random name and passw.
Go to Top of Page

Luis MS
New Member

3 Posts

Posted - 08/28/2009 :  11:31:13  Show Profile  Reply with Quote
Hi im new on these and i have a question, in order to be able to send information from a vehicle tracker application yo need to have the gpsgate server installed on your server or it can be done if i just have the subscription?

Best Regards

Luis
Go to Top of Page

johan
Forum Admin

Sweden
15235 Posts

Posted - 08/28/2009 :  11:57:50  Show Profile  Visit johan's Homepage  Reply with Quote
You can fetch positions from a GpsGate hosted or self hosted server using "SOAP Platform Kit". More info here:
http://franson.com/forum/topic.asp?TOPIC_ID=8097

(Please start a new Topic for new questions.)

Regards,
Johan

Franson Support
Go to Top of Page

holysaint
Average Member

29 Posts

Posted - 11/04/2011 :  03:26:36  Show Profile  Reply with Quote
is this working at this time?
Go to Top of Page

holysaint
Average Member

29 Posts

Posted - 11/04/2011 :  05:04:43  Show Profile  Reply with Quote
Hi Johan,

is there any updates for sending GPS data using HTTP to a web site?..

thanks
Go to Top of Page

johan
Forum Admin

Sweden
15235 Posts

Posted - 11/04/2011 :  05:20:40  Show Profile  Visit johan's Homepage  Reply with Quote
This information is 4 years old, and has worked the same during that time.

If you have specific questions, please post NEW topics. And describe what you do, and what your problem is.

Regards,
Johan

GpsGate Support
Go to Top of Page

napster
New Member

6 Posts

Posted - 11/08/2011 :  04:46:38  Show Profile  Reply with Quote
Hello,

are codes above still working for sending GPS data using HTTP to a web site?
Go to Top of Page

johan
Forum Admin

Sweden
15235 Posts

Posted - 11/08/2011 :  06:52:10  Show Profile  Visit johan's Homepage  Reply with Quote
Yes, please test.

Post new questions to new topics in the forum.

Regards,
Johan

GpsGate Support
Go to Top of Page

sg09
Average Member

96 Posts

Posted - 06/23/2012 :  04:24:33  Show Profile  Reply with Quote
Hi,
is it possible to send additional data using HTTP (like analog inputs or digital inputs) ?
Go to Top of Page

johan
Forum Admin

Sweden
15235 Posts

Posted - 06/23/2012 :  05:27:34  Show Profile  Visit johan's Homepage  Reply with Quote
Please take a look at TrackerOne, which also supports HTTP
http://gpsgate.com/developer/gpsgate_trackerone

Regards,
Johan

GpsGate Support
Go to Top of Page

grigor
Average Member

Albania
65 Posts

Posted - 06/26/2012 :  06:46:01  Show Profile  Reply with Quote
hello,

please can anyone help, i dont find the link donwload for "GpsGate.com (Send) plugin" :(

Thanks
Go to Top of Page

johan
Forum Admin

Sweden
15235 Posts

Posted - 06/26/2012 :  06:52:42  Show Profile  Visit johan's Homepage  Reply with Quote
GpsGate Client is a program you install on your laptop. It is used to share a GPS connected to your laptop between multiple applications. You can also use it to send GPS data over a network, e.g. to GpsGate Server.

More info about GpsGate Client here:
http://gpsgate.com/products/gpsgate_client

GpsGate Client is not a plugin to GpsGate Server, it is a separate application.

Regards,
Johan

GpsGate Support
Go to Top of Page

brizey02
New Member

5 Posts

Posted - 08/26/2012 :  10:59:15  Show Profile  Reply with Quote
Load into postgis?

<?php
// attempt a connection
$dbh = pg_connect("host=5.5.5.5 dbname=geoserver user=****");
if (!$dbh) {
die("Error in connection: " . pg_last_error());
}

// escape strings in input data
$lat = pg_escape_string($_REQUEST['latitude']);
$lon = pg_escape_string($_REQUEST['longitude']);
$kt = pg_escape_string($_REQUEST['speed']);
$unit = pg_escape_string($_REQUEST['username']);

// execute query
$sql = "UPDATE gpsreports SET lat = '$lat', lon = '$lon', speed = '$kt', the_geom = PointFromText('POINT(' || lon || ' ' || lat || ')',4326) where imeix = '$unit'";
$result = pg_query($dbh, $sql);
if (!$result) {
die("Error in SQL query: " . pg_last_error());
}

echo "Data successfully inserted!";

// free memory
pg_free_result($result);
// close connection
pg_close($dbh);

?>
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
GpsGate Forum © 2014 GpsGate AB Go To Top Of Page