Instructions on how to send commands to EdgeTracker from app or via LoRaWAN communication.
List of settings, tracker supports, is specified in settings.json file, that can be found in latest FW release on GitHub. All available settings are located under "settings" cluster. Each setting is of the form:
where:
id - unique identifier
length - length in bytes
conversion - setting variable type
To change any setting, a custom command can be send via BT app or using LoRa communication.
Port 3 is used for commands handling.
Send downlink message to port 3 of the form:
where data in byte array format needs to be little-endian encoded.
To set the above "settingname" example setting to value 1000, first convert 1000 to byte array: E8 03 00 00 and replace id with 01 and length with 04:
Use "Custom command" field to set settings that are not supported in the user interface. The main change when using the app for sending commands is that port needs to be specified as first value.
App supports commands in hex format with "0x" preamble or in decimal format. The above setting can be send either as:
or as
Spaces need to be added!
Various commands are avaliable for user to interact with tracker. All commands are defined in settings.json file under "commands" cluster. Each command is of the form:
where:
id - unique command identifyer
length - length of additional data send in command
conversion - conversion of additional data send in command
Commands are send in similar way to settings via BT app or using LoRa communication.
Port 32 is used for sending commands.
Send command in the following form to port 32:
Keep in mind that additional value is always litlle-endian encoded. If command length is 0, no additional value needs to be send, hence:
For example to send "cmd_name" test command with value 3, the following string is send to port 32:
Same format as defined above is used. Again port needs to be added as first value in the array. The above command can be send in either of the formats:
or
The following commands are supported at the moment. All need to be send to port 32. Below message formats for using LoRa communication are given. To adjust message format, follow the instructions above.
Reboot tracker.
Tracker will return all values, in stacked format, as described in the following command. Not recomended to use via LR, due to payload size limitations.
Obtain value of a single value field, specified by its id. List of all values can be found in settings.json file under "values" cluster
For example, to get value with id D1 send:
Tracker will respond on port 30 in the format:
Status message will be send via LoRa/BT communication to status port 4. For status message structure, see TTN parser: ttn_decoder.js, addeed to lates release on GitHub or next chapter.
Obtain tracker latest GPS position (lat lon, alt). Send command:
Tracker will respond with "msg_last_position" on port 31. For definition see next chapter.
Reboot Ublox GPS module.
Tracker will return all settings, in stacked format, as described in the following command. Not recommended to use via LR, due to payload size limitations.
Obtain value of a single setting field, specified by its id.
For example, to get "cmd_name" send:
Tracker will respond on port 3 in the format:
Reset initial reference position of the tracker to hardcoded position. (not recommended to use)
Reset initial reference time to hardcoded value. (not recommended to use)
Clear internal storage. All set values are going to be deleted and set to default. Keep in mind that LR keys are going to be deleted as well!
Revert all setting to defoult values. Keep in mind that LR keys are going to be deleted as well!
Status message will be send via LoRa communication to status port 4. For status message structure, see TTN parser: ttn_decoder.js, addeed to lates release on GitHub or next chapter.
Obtain LR GNSS message and send it via LoRa communication.
Set reference location and time of the tracker.
Get rf scan - not supported at the moment!
Get aggregated data in wifi scan. Tracker will response with "msg_wifi_scan_aggregated" (see next chapter).
Get aggregated data of BT scan. Tracker will response with "msg_ble_scan_aggregated" (see next chapter).
Get almanac age - not supported at the moment!
Perform LR GPS scanning and return both GNSS message as well as satellite data message, used in the fix. See next chapter for message definitions.
Perform Ublox position fix and return both position message, as well as satellite data message, used in the fix. See next chapter for message definitions.
Not yet supported
Get BT MAC addres from the device.
Device responds with "msg_mac_id" (see next chapter).
Perform Ublox position fix and returnposition message.
Reset LR module.
Clear all data from external flash.
Get all messages stored on specific port. Use port=0 to get messages from all ports.
Tracker will start to return all available messages from head to tail on port 29 via BT/LoRa. When all messages are send, confirmation message, "msg_cmd_confirm", will be received.
Read specific number of messages, starting from specified message on defined port.
To read 10 messages on port 4, starting from 50th message, send:
Tracker will start to return all available messages from head to tail on port 29 via BT/LoRa. When all messages are send, confirmation message, "msg_cmd_confirm", will be received.
Send message to device to be send via LR.
Up to 45 bytes are supported.
Tracker send various message types via LoRa/BT communication and/or store them to flash. All message types are defined in settings.json fil, under cluster "messages".
Each is of the form:
where:
port - specified port on which message is send. Port names are defined in settings.json file, under the cluster "ports"
id - msg id
length - max length of the message
All messages are following same basic format:
If message is send via BT, port is added as first byte:
Total received message length is tehrefore 2 + length on LoRa communication and 3 + length on BT, due to added port before other values.
Send on port 1. GNSS data message. See ttn-decoder for format.
Send on port 2. Message containing Ublox GPS fix and additional fix data. See ttn-decoder for format.
Confirmation message, send on defoult message port 31. This message is returned after any command that does not evoke any other message send or has failed. Format:
Status message, send on port 4. See ttn-decoder for format.
Message, containing satellite data, used in GNSS LR position fix. Send on port 5. See ttn-decoder for format.
Message, containing satellite data, used in Ublox position fix. Send on port 9. See ttn-decoder for format.
Message containing top-3 scanned wifi results. Send on port 6. See ttn-decoder for format.
Message containing scanned wifi results from single scan. Send on port 10. See ttn-decoder for format.
Message containing top-3 scanned BT results. Send on port 7. See ttn-decoder for format.
Message containing all results from single BT scan. Send on port 11. See ttn-decoder for format.
Not supported.
Almanac age of the format:
Message contating MAC id of the form:
Message containing last obtained position in the form:
Message format for sending flash logs to port 29. See ttn-decoder for format.