How To Send GPS Data Using HTTP To A Web Site
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.
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=2
0070529&time=123445.234&username=myuser&pw=encryptedpassword
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
(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"];
// 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);
//----------------------------------------------
// Simple dynamic generation of XML document
//----------------------------------------------
// Declare new XML document
$dom = DOMDocument::loadXML('<positiondatabase/>');
$dom->preserveWhiteSpace = false;
$dom->encoding = "UTF-8";
// 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#');
//----------------------------------------------
// XML Output Processing
//----------------------------------------------
// Save new XML file output
$output = $dom->save('position.xml');
jpalten
Starting Member
1 Posts
Posted - 11/29/2007 : 03:56:15
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?
johan
Forum Admin
Sweden
10759 Posts
Posted - 11/29/2007 : 04:24:50
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
deputydave
Junior Member
USA
11 Posts
Posted - 12/12/2007 : 15:04:08
sweber
Starting Member
Denmark
1 Posts
Posted - 04/20/2008 : 02:52:57
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
johan
Forum Admin
Sweden
10759 Posts
Posted - 04/20/2008 : 06:21:57
Regards,
Johan
Franson Support
unicptz
New Member
6 Posts
Posted - 05/15/2008 : 06:30:03
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.
johan
Forum Admin
Sweden
10759 Posts
Posted - 05/15/2008 : 06:44:02
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
unicptz
New Member
6 Posts
Posted - 05/15/2008 : 16:32:14
johan
Forum Admin
Sweden
10759 Posts
Posted - 05/16/2008 : 03:58:44
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
bveldkamp
New Member
2 Posts
Posted - 05/27/2008 : 08:27:50
Does GpsGate support basic or digest authentication when sending data to an http server?
johan
Forum Admin
Sweden
10759 Posts
Posted - 05/27/2008 : 08:31:01
No, you need to authenticate the request using the username + password you get in the
URL.
Regards,
Johan
Franson Support
rudykstra
New Member
2 Posts
Posted - 06/09/2008 : 14:00:09
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.
Ruurd Dijkstra
johan
Forum Admin
Sweden
10759 Posts
Posted - 06/10/2008 : 04:31:55
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
unicptz
New Member
6 Posts
Posted - 07/09/2008 : 05:11:37
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.
johan
Forum Admin
Sweden
10759 Posts
Posted - 07/09/2008 : 09:03:27
Regards,
Johan
Franson Support
unicptz
New Member
6 Posts
Posted - 07/09/2008 : 17:11:51
quote:
Thanks.
menq
New Member
China
2 Posts
Posted - 08/03/2008 : 21:42:46
thanks!
bveldkamp
New Member
2 Posts
Posted - 09/04/2008 : 05:06:22
Are there any plans to support proper authentication? Personally I'd like to have NTLM, but
basic or digest would be a nice start.
Regards, Berend
quote:
Regards,
Johan
Franson Support
johan
Forum Admin
Sweden
10759 Posts
Posted - 09/04/2008 : 05:55:31
No plans for the moment, but thanks for your feedback! We'll consider this for coming
releases of GpsGate Client.
Regards,
Johan
Franson Support
selphi81
New Member
2 Posts
Posted - 10/29/2008 : 04:37:58
johan
Forum Admin
Sweden
10759 Posts
Posted - 10/29/2008 : 06:49:32
Click on "More options..." next to the field where you enter the server address. Select
"HTTP" as protocol.
Regards,
Johan
Franson Support
selphi81
New Member
2 Posts
Posted - 10/30/2008 : 00:48:51
sputnik2006
New Member
United Kingdom
7 Posts
Posted - 11/21/2008 : 17:12:49
quote:
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.
Regards
johan
Forum Admin
Sweden
10759 Posts
Posted - 11/22/2008 : 14:01:24
In the first step in the Wizard click on "More Options..." then select HTTP as protocol.
Regards,
Johan
Franson Support
bksi
New Member
Bulgaria
2 Posts
Posted - 02/26/2009 : 09:23:59
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.
johan
Forum Admin
Sweden
10759 Posts
Posted - 02/26/2009 : 10:12:54
Regards,
Johan
Franson Support
EXXHAL
Starting Member
1 Posts
Posted - 06/20/2009 : 01:38:42
Hello,
WHen i use my website server, where 2 get or what is the password and username i have 2
use there.
Luis MS
New Member
3 Posts
Posted - 08/28/2009 : 11:31:13
Hi i´m 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
johan
Forum Admin
Sweden
10759 Posts
Posted - 08/28/2009 : 11:57:50
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
Regards,
Johan
Franson Support