# Send messages

{% hint style="success" %}
Contact us, when missing a specific message you want to apply to your devices. You can also compose your own message templates.&#x20;
{% endhint %}

{% hint style="info" %}

### Messaging through API <a href="#trackers-api" id="trackers-api"></a>

Independent from sending [commands through the UI of the tracker management](https://docs.racemap.com/tracker-management/messages) dashboard you can use message templates to integrate command sending into your system eg. to level up the automatization of your processes.

**URL** `https://racemap.com/api/v1/trackers/messages` \
**Method** Send \
**Sample message template** - Set report interval - for Queclink GL3xx GPS trackers: \
<https://racemap.com/admin/message-templates/6613c31ad019cb0ece29e251>&#x20;

Get the required `deviceId`(s) from the [current API](https://docs.racemap.com/api/current).&#x20;
{% endhint %}

{% content-ref url="trackersapi" %}
[trackersapi](https://docs.racemap.com/tracker-management/trackersapi)
{% endcontent-ref %}

### Basics

* Identify and select the GPS trackers to which you want to send commands. The tracker management targets the commands to all devices in the above list.
* Ensure that the devices are switched on and currently connected with Racemap to receive commands.&#x20;

<figure><img src="https://1672210197-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LSRNxaH2Ju9Flr7JhJD%2Fuploads%2FVYFoocaaoDqNb85M9UhG%2Fscreenshot-racemap.com-2024.01.08-13_37_55%20(1).png?alt=media&#x26;token=715007e4-ff92-46a1-8237-2971341e4ff3" alt=""><figcaption><p>Selected devices in above table, 11 GPS trackers are connected with Racemap</p></figcaption></figure>

* Monitor the acknowledgment from each device to confirm the successful receipt of the command.&#x20;
* Check the messages timeline for each device to track the progress of sending commands. Inspect the message details to gather additional information on each device's response.&#x20;

<figure><img src="https://1672210197-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LSRNxaH2Ju9Flr7JhJD%2Fuploads%2FpE85rWW4ituTwVvMkdS7%2Fscreenshot-racemap.com-2024.01.08-13_49_48.png?alt=media&#x26;token=e372ae66-a5f8-4391-8fe7-97d3083f35ee" alt=""><figcaption><p>Messages timeline of specific device. </p></figcaption></figure>

<figure><img src="https://1672210197-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LSRNxaH2Ju9Flr7JhJD%2Fuploads%2F6nC0EJqMUwHShI0WTM4L%2Fscreenshot-racemap.com-2024.01.08-14_04_56.png?alt=media&#x26;token=3c232299-7956-4357-9547-5f695605aa56" alt=""><figcaption></figcaption></figure>

#### Options sending commands:&#x20;

* **Time:** Send the message right away ("Now") or schedule the time frame ("Not before" and "Not after") in which Racemap attemps to send the command to the device.&#x20;
* **Command:** Select the command. \
  ![](https://1672210197-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LSRNxaH2Ju9Flr7JhJD%2Fuploads%2FN6ZM89WVmcgxWJWkCuUD%2Fscreenshot-racemap.com-2024.01.08-14_13_57.png?alt=media\&token=6360cd59-4732-4edf-a3ef-040434d6cd6d)
* **Transport:** By default, messaging with GPS trackers works via TCP connection. However, if you're running the devices with our M2M SIM cards, you can choose to send messages as SMS instead. \
  To receive an SMS, the device must not have an open socket connection with RACEMAP server. This provides the alternative to sending SMSs to devices that are not connected, making it useful for tasks like rebooting the device or requesting the last known location. \
  ![](https://1672210197-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LSRNxaH2Ju9Flr7JhJD%2Fuploads%2FLCvkpUHUXXNZ90oLcpgh%2Fscreenshot-racemap_com-2024_09_26-14_46_03.png?alt=media\&token=a138e705-a9f8-49c2-bfe8-2815c652bf04)

{% content-ref url="sim-cards" %}
[sim-cards](https://docs.racemap.com/tracker-management/sim-cards)
{% endcontent-ref %}

### Schedule commands&#x20;

You can schedule commands for a group of GPS trackers to automatically adjust the devices' settings according to the time.&#x20;

A couple of days before the race:&#x20;

* Switch on all devices manually.
* Place devices for a good connection.&#x20;
* Select all devices in tracker management.
* Check connection and location in tracker management.&#x20;
* Clear undelivered commands from messages timeline before scheduling new commands with the "Revoke all messages" function. &#x20;

<figure><img src="https://1672210197-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LSRNxaH2Ju9Flr7JhJD%2Fuploads%2FpYPh2HmSh4nBUD6hviC4%2Fscreenshot-racemap.com-2024.01.08-15_25_06.png?alt=media&#x26;token=c0b5ee8d-4efa-40c6-b39c-da6a1dd8b329" alt=""><figcaption></figcaption></figure>

* Schedule commands according to SLEEP, AWAKE and RACE profile.&#x20;
* Don't switch devices off after you have scheduled commands.

**SLEEP profile:** "heartbeat", every 10 to 20 min refreshes the connection to Racemap, if there is reception

<table data-full-width="false"><thead><tr><th width="81">#</th><th width="269">Command</th><th width="257">Parameter</th><th>Time</th></tr></thead><tbody><tr><td>S1</td><td>GPS Module</td><td>mode: 1</td><td>Now</td></tr><tr><td>S2</td><td>GPS Report Interval</td><td>3600; 3600</td><td>Now</td></tr><tr><td>S3</td><td>Non-Movement Detection</td><td>10; 3600; 3600</td><td>Now</td></tr></tbody></table>

{% hint style="info" %}

* Participants must not use the power button! When deploying the devices to participants the devices are turned on already.&#x20;
* Devices lose about 5 to 7 % battery level in 24 hrs.&#x20;
  {% endhint %}

**AWAKE profile:** It takes up to 60 min until all devices receive the new configuration. Check the tracker management if there is a device that does not establish a connection. The participant might have turned the device off. You still have time to change the device before the race starts.&#x20;

<table><thead><tr><th width="77">#</th><th width="260">Command</th><th>Parameter</th><th>Not before</th><th>Not after</th></tr></thead><tbody><tr><td>A1</td><td>GPS Report Interval</td><td>180; 180</td><td>4 hrs before race starts</td><td>3 hrs before race starts</td></tr><tr><td>A2</td><td>Non-Movement Detection</td><td>10; 180; 180</td><td>4 hrs before race starts</td><td>3 hrs before race starts</td></tr></tbody></table>

**RACE profile:** It takes up to 10 min until all devices receive the new configuration. &#x20;

<table><thead><tr><th width="84">#</th><th width="258">Command</th><th width="134">Parameter</th><th>Not before</th><th>Not after</th></tr></thead><tbody><tr><td>R1</td><td>GPS Module</td><td>mode: 0</td><td>1 hr before race starts</td><td>no entry</td></tr><tr><td>R2</td><td>GPS Report Interval</td><td>10; 10</td><td>1 hr before race starts</td><td>no entry</td></tr></tbody></table>

{% hint style="info" %}

* Devices lose about 5 % battery level every 1 hr.&#x20;
* With 60; 60 parameter setting, devices lose about 2 % battery level every 1 hr.&#x20;
  {% endhint %}

For stage events you can schedule subsequent SLEEP and RACE profiles for each stage.&#x20;

After the race: Use the "Shut down" command to remotely switch devices off. When the device has received the shot down it must be switched on manually. There is no possibility to remotely turn on a device.&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.racemap.com/tracker-management/messages.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
