Template Commands
What is a command?
A command is an instruction sent from a server or platform to a GPS tracker in the field, telling it to do something or change how it behaves. A tracker mostly sends data up, like position, speed and ignition status. Commands go the other way, down to the device. Depending on the tracker model, they usually travel over the mobile data connection (GPRS/TCP) or as an SMS. Each manufacturer has its own command syntax, so the tracking platform usually turns a simple action, such as clicking "Immobilize", into the exact message that model understands.
Common types of commands
- Configuration: change the reporting interval, set the server IP and port, or adjust the APN.
- Requests: ask for the current position right away, or check the firmware version or device status.
- Output control: switch a relay on or off, for example to cut the engine (immobilization) or unlock the doors.
- Maintenance: reboot the device, reset the odometer, or start a firmware update.
Why they are useful
- Remote management: reconfigure trackers without physically reaching each vehicle. Across a large fleet, that saves a lot of time and money.
- Security: locate a stolen vehicle on demand and, if the device supports it, immobilize it safely.
- Flexibility: balance data detail against cost. For example, a vehicle can report more often while it's moving and less often when it's parked, which saves data and battery.
- Troubleshooting: check a device's status or reboot it remotely, which often fixes a problem without a site visit.
- Automation: trigger commands with rules. For example, a vehicle that leaves a geofence after hours can be immobilized automatically.
In this guide, you'll learn how to set up command templates so you can send them to your tracker right away. Template Commands let you create commands that can be sent from GpsGate to your assets in many ways. To learn how a command reaches the tracker, read How sending commands to a tracker works over Internet.
Where you can send commands from
- Manually from the Asset panel, using Command Groups.
- Automatically, from an Event Rule, for example when an event occurs (e.g. SOS).
- Manually, from the Fleet App.
- Manually, from the Terminal Window.
- In batches, using the Device Manager.
Creating the command
Command templates are created in the application. You need the Site Admin privilege Device Command Templates.
1. Go to Main Menu > Tracker Configuration > Device Command Templates.
The window lists all commands with their protocol and rights. Use the protocol filter or the search field to find a command, the copy button to duplicate one, or the delete button to remove one. Commands that come from a plugin or are managed by GpsGate can't be deleted.
2. Click New command.
3. Under General, select the Protocol of your tracker and enter a Name for your command. The name can't be changed after saving. You can also add a Description.
4. Keep Queueable turned on (recommended, on by default). Turn on Administrators only if only administrators may send this command.
5. Under Steps, enter the command in Template and choose the sending method in First attempt and, optionally, Second attempt. Click Available variables to see the variables you can use, and Preview to see the template filled in with sample data. Use Add step for commands with several steps, and Show advanced to set an expected reply or a timeout.
6. Under Device types, select which model/s you want this command to be available to.
7. Click Save.
Command 'Queueable' behaviour:
- Duplicate commands: You cannot send the same command if an identical one is still pending or being processed. Once the previous command completes or times out, the system will allow a new one.
-
Timeouts:
- For non-queueable commands, the default timeout is 10 seconds (unless customized).
- For queueable commands, the default timeout is longer (up to 48 hours).
- Command templates: If a command template contains multiple steps, the timeout applies per step, not for the whole template.
- Different commands: You can send a different command while another one is being processed. If the previous command is still pending, the new command will simply be placed in the queue.
Notes
- To send commands over SMS, you need to enable an SMS provider.
- GpsGate does not provide you with commands or configuration software for your trackers.
- We recommend verifying your tracker documentation or check with your tracker support which is the right command to configure your trackers to point to your newly installed GpsGate IP and port.
- For a command that comes from a plugin, you can only change its description and the Administrators only setting. Commands managed by GpsGate can't be changed.
Commands history
All the commands history can be found on Main Menu > Platform Settings > Diagnostics > Device commands.