Teltonika
Example on GitHub (opens in a new tab)
Model
Problem: Suppose you have a standalone personal tracker TMT250 running Teltonika protocol, which you intend to use to ensure the safety of workers in hazardous industrial areas. You know that, in addition to the basic values defined in the protocol, it transmits the following additional parameters.
Parameter | Parameter ID in AVL package |
---|---|
Battery Level | 113 |
Battery Voltage | 67 |
Battery Current | 68 |
Movement | 240 |
Data Mode | 80 |
GSM Signal | 21 |
Sleep Mode | 200 |
GNSS Status | 69 |
GNSS PDOP | 181 |
GNSS HDOP | 182 |
Instant Movement | 303 |
Charger Connected | 116 |
Axis X | 17 |
Axis Y | 18 |
Axis Z | 19 |
Alarm | 236 |
ManDown/FallDown | 242 |
Movement Event | 310 |
Button Click | 389 |
Power Event | 390 |
Tamper detection Event | 520 |
BLE Temperature #1 | 25 |
BLE Battery #1 | 29 |
BLE Humidity #1 | 86 |
You also stipulate that the on_demand_tracking# command be sent to the terminal. |
Action | Command |
---|---|
Stops tracking | on_demand_tracking0 |
Starts tracking | on_demand_tracking1 |
To connect the tracker to the platform, create a Teltonika model for it.
There are many parameters in the template model. By searching through the model, you can understand which parameters are already present, and which ones you need to add yourself.
Parameter | Parameter ID in AVL package |
---|---|
Battery Level | 113 |
Battery Voltage | 67 |
Battery Current | 68 |
Movement | 240 |
Data Mode | 80 |
GSM Signal | 21 |
Sleep Mode | 200 |
GNSS Status | 69 |
GNSS PDOP | 181 |
GNSS HDOP | 182 |
Instant Movement | 303 |
Charger Connected | 116 |
Axis X | 17 |
Axis Y | 18 |
Axis Z | 19 |
Alarm | 236 |
ManDown/FallDown | 242 |
Movement Event | 310 |
Button Click | 389 |
Power Event | 390 |
Tamper detection Event | 520 |
BLE Temperature #1 | 25 |
BLE Battery #1 | 29 |
BLE Humidity #1 | 86 |
Remove or hide unnecessary parameters from display, and add missing parameters. Parameters can be arranged and grouped at your discretion, but the model will look as follows. the model will be as follows.
For more information on Teltonika argument formation
There are also examples of several commands in the template model, form your tracker commands based on them. commands for your tracker.
For more information on forming Teltonika actions
View a preview of the object with the model you created by clicking Show preview. preview**.
If you wish, select an icon to display the object on the map, or upload your own image.
Model to import (opens in a new tab)
Object
Create an object for your tracker. Select the model you just created. Then enter the identifier corresponding to the tracker's IMEI, ** prefixed with teltonika:**. Specify a name for the object.
Once saved, the instructions for configuring the device to the platform will open.
Connection
To connect the tracker to the platform, specify in the settings of its configurator
- host dev.rightech.io
- port 21451
Make sure that after saving the settings, the data from the device is sent and are displayed in the interface. After receiving the coordinate packet, the object should be displayed on the map.
Send commands and check that the connected device responds to them.
Logic
As an example of interaction of several devices in one automaton let's consider the following problem.
Task: Suppose that a scooter, whose connection is discussed in the following example, needs to send a command to turn on a flashlight if an employee presses the alarm button on their tracker.
In this case, the automaton will contain only one state: waiting for the press of the button. Transition from this state will take place in the same state.
Create a new automaton. Choose two models: a tracker and a scooter, as the automaton will organize interaction between two objects with these objects. automaton will organize interaction between two objects with these models. models. Events will come from the tracker, and commands will be sent to the scooter.
Since the logic of the automation script calls for a cyclic control over pressing the button, the automaton will be infinite, the final state is can be moved out of sight and not used. Create one state of the automaton.
The transition from this state to the same state will occur on receipt of an event about receiving the alarm button press data. Note that when tracker model is active when selecting events, because the events received from it will serve to trigger the alarm. events received from the tracker will be used to trigger the transition.
Now add a command to turn on the flashlight. So that the sending of the command doesn't happen at the very first moment of time, when the automaton is just started, add it not on the entry to the state, but on exit from it. Note that when selecting the action, the scooter model must be active, as the command will be sent to the scooter. it.
The automaton is ready. Select the objects and run it.
Now when the alarm button on the tracker is triggered, the scooter is now sent a a command to turn on the headlight.