How sending commands to a tracker works over GPRS

Sending GPRS commands

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.

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.

How do we send commands to the trackers

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

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

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

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

Read a related topic about GPRS billing

How to send a command over GPRS when the tracker connects?

Some trackers connect 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 link.