Galileosky
Example on GitHub (opens in a new tab)
Model
Problem: Suppose you have a Galileosky terminal connected to a car. It is known to transmit the following parameters.
Parameter | Tag |
---|---|
Device ID | 04 |
Date and time | 20 |
Script started (user data) | E2 |
GSM muting (user data) | E9 |
Latitude | 30 |
Longitude | 30 |
Number of satellites | 30 |
Speed | 33 |
Direction | 33 |
Height | 34 |
Power supply voltage | 41 |
Battery Voltage | 42 |
Terminal temperature | 43 |
Sensor 1 | 51 |
Sensor 2 | 52 |
The terminal description also states that it provides a response to the following commands. |
Action | Command |
---|---|
Restart the terminal | RESET |
Unlock | ON |
Lock | OFF |
Activate script | ONGL |
OFF | OFFGL |
Get the state of the outputs | OUT |
Get the state of the inputs | INALL |
Take a picture | MAKEPHOTO |
To connect the vehicle terminal to the platform, create a model for it. Galileosky.
The Galileosky template model has absolutely all the parameters that can coming from the device via the protocol. By searching the pattern, you can figure out where the parameters that your device sends are, and hide the others or delete them.
If you remove all unused parameters, the model will take the following compact form.
There are also examples of several commands in the template model. Form your terminal commands based on them your terminal commands based on them.
For more information on forming Galileosky actions
View a preview of the object with the model you created by clicking the Show preview button. 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 vehicle. Select the model you just created. Then enter the identifier corresponding to the IMEI of the terminal, with the prefix galileosky:. Specify a name for the object.
Once saved, the instructions for configuring the device to the platform will open.
Connection
To connect a car to the platform in the terminal configurator settings specify
- host: dev.rightech.io
- port: 20268
Verify that after saving the settings, 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
Task: Assume that the GSM Silencing parameter is to be monitored. It is allowed that the signal can be lost for up to five minutes in normal situation. If the jamming sensor does not go to the normal state for longer than five minutes, it is necessary to send a notification to the platform.
Create a new automaton.
Since the logic of the automation script calls for cyclic control over the silencing parameter, the automaton will be infinite, final state can be moved out of sight and not used. Create three states of the automaton corresponding to normal operation, muting and prolonged silencing.
Transitions between the states of normal operation and silencing will occur at when certain data is received, so the transition events will be the same - Data Received, but the conditions are different.
The transition from the silence condition to the long silence condition will occur when the timer is triggered. And the transition to normal operation mode from long silence silencing will be the same as the transition from silencing - by the event of data reception with checking of the condition.
Now define what actions should trigger in the states. In normal mode of operation you can do nothing. In silencing mode, you need to start a five-minute timer. If during the time until the timer is triggered, a value comes in, that there is no silencing, then the dispenser will go to the normal operation mode without sending the notification. notification.
If the timer goes off, then there will be a transition to long silencing mode, in which the notification will be sent.
The automaton is ready.
Select the car object and start it.
Now when a positive value is received on the silencing parameter, that remains unchanged for five minutes, a notification is sent to the platform.