User avatar
johan
GpsGate
Posts: 14152
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

GUIDE: Template Commands

Wed Jul 15, 2009 3:41 pm

Template Commands

"Template Commands" will allow you to in a simple way create commands that can be sent from GpsGate Server to the tracker using SMS or GPRS.

Template Commands make it possible to send all kinds of configuration commands to most trackers independent on the protocol they use. Take a look in the manual for the tracker to find out the command syntax.

To send commands over SMS, you need to enable SMS on your server. More info: http://forum.gpsgate.com/topic.asp?TOPIC_ID=7829

You create "Template Commands" under Devices -> Commands in SiteAdmin. Instructions are available on that page.

Send command

Right click on a device to send a command. Or use any of the methods listed below.

Send command from Mobile interface:
http://gpsgate.com/blogComment/send_commands_to_your_devices_using_the_mobile_interface

Using the "Terminal" you can access any tracker in your system. Send commands, and monitor communication. This is a great tool for trouble shooting and advanced device management. More info:
http://forum.gpsgate.com/topic.asp?TOPIC_ID=10740

Use the "Device Manager" to send a command to a batch of GPS trackers:
http://forum.gpsgate.com/topic.asp?TOPIC_ID=14318

Send Template Command when Event Rule is triggered
http://forum.gpsgate.com/topic.asp?TOPIC_ID=14834

Sending binary data

Binary data is represented as hex values inside brackets like this [0x00]

A sequence of binary 0x01, 0x02 is represented as [0x01][0x02]

Sending CR + LF - Carriage Return + Line Feed

CR + LF is represented as [0x0D][0x0A]

Example: Hello[0x0D][0x0A] sends back a "Hello" + CR + LF to the device.

Checksum and other wrapping data

If the device protocol requires checksums on commands, GpsGate will add this automatically. You can verify this in the Terminal. If you have a protocol which requires checksum, but GpsGate fails to add it, please contact support @ gpsgate . com

Regards,
Johan

Franson Support

User avatar
johan
GpsGate
Posts: 14152
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

RE: GUIDE: Template Commands

Fri Feb 19, 2010 4:49 pm

Can I send commands from the server to the GPS tracker over GPRS?

This is a very common question, and I will explain how it works here.

In most cases a GPS tracker in a mobile network does not have a public IP address. This means that something from the Internet, for example your GpsGate Server, cannot connect to your GPS tracker over GPRS (TCP/IP or UDP).

But if the GPS tracker has made a connection to the server, the server can send back commands on this opened connection.

OK, so what we need to understand is that since there is no public IP address for the tracker, the server cannot initiate the connection. The GPS tracker must initiate the connection. But once the connection is opened both parties can send data.

Now when we understand that, how do we go about to send commands to the tracker?

1. The most common way is to use SMS to send commands from server to GPS tracker, since SMS works both ways always.

2. Another common way is to make sure that the tracker keeps the connection opened. This is often called "heart beat", "sync" or similar. A mobile network will typically close a GPRS session that has been idle for 3 minutes, therefor the tracker needs to send small amounts of data to keep the connection opened. Another alternative is to have a position update rate faster than once per 3 minutes.

3. Buy a special SIM card that do support a static public IP addresses. In this case the server can initiate the connection to the GPS tracker over GPRS.

All trackers does not support all methods. Most trackers however support SMS. Only very few trackers support static public IP.

Here is a related topic about GPRS billing:
http://franson.com/forum/topic.asp?TOPIC_ID=10379

How to send a command over GPRS when the tracker connects

Some trackers connects over GPRS once in a while to see if the server has some configuration to send back. You can create a Template Commands which sends back a command when the tracker connects.

When creating the "Template Command", leave the "Template" field for Step 1 empty. Leaving it empty will make GpsGate skip that step and wait for the tracker to connect or send data again before step 2 is sent.

Here is a detailed guide on how to create a command that is sent when the device is online http://forum.gpsgate.com/topic.asp?TOPIC_ID=16352

Regards,
Johan

Franson Support

Return to “GpsGate Server - How to setup and use”