User commands instructions
Instructions on how to send commands to EdgeTracker from app or via LoRaWAN communication.
Settings
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.
Change settings via LoRa
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:
Change settings via BT app
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!
Commands
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 via LoRa
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:
Send command via BT app
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
List of commands and their format
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.
A1 - cmd_reset
Reboot tracker.
A2 - cmd_send_all_val
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.
A3 - cmd_send_single_val
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:
A4 - cmd_send_status
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.
A5 - cmd_send_position
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.
A6 - cmd_reset_gps
Reboot Ublox GPS module.
A7 - cmd_send_all_settings
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.
A8 - cmd_send_single_setting
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:
A9 - cmd_reset_initial_position
Reset initial reference position of the tracker to hardcoded position. (not recommended to use)
AA - cmd_reset_initial_time
Reset initial reference time to hardcoded value. (not recommended to use)
AB - cmd_clear_nvs
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!
AC - cmd_reset_to_def_settings
Revert all setting to defoult values. Keep in mind that LR keys are going to be deleted as well!
AD - cmd_send_status_lr
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.
AE - cmd_send_lr_fix
Obtain LR GNSS message and send it via LoRa communication.
AF - cmd_set_location_and_time
Set reference location and time of the tracker.
B0 - cmd_get_rf_scan
Get rf scan - not supported at the moment!
B1 - cmd_get_wifi_scan
Get aggregated data in wifi scan. Tracker will response with "msg_wifi_scan_aggregated" (see next chapter).
B2 - cmd_get_ble_scan
Get aggregated data of BT scan. Tracker will response with "msg_ble_scan_aggregated" (see next chapter).
B3 - cmd_get_almanac_age
Get almanac age - not supported at the moment!
B4 - cmd_get_lr_satellite_data
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.
B5 - cmd_get_ublox_satellite_data
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.
B6 - cmd_almanac_update
Not yet supported
B7 - cmd_get_mac
Get BT MAC addres from the device.
Device responds with "msg_mac_id" (see next chapter).
B8 - cmd_get_ublox_fix
Perform Ublox position fix and returnposition message.
B9 - cmd_reset_lr
Reset LR module.
BA - cmd_flash_clear
Clear all data from external flash.
BB - cmd_flash_get_all
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.
BC - cmd_flash_get_from_head
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.
C4 - cmd_send_lr_message
Send message to device to be send via LR.
Up to 45 bytes are supported.
Message formats
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.
F1 - msg_gnss
Send on port 1. GNSS data message. See ttn-decoder for format.
F2 - msg_ublox_location
Send on port 2. Message containing Ublox GPS fix and additional fix data. See ttn-decoder for format.
F3 - msg_cmd_confirm
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:
F4 - msg_status
Status message, send on port 4. See ttn-decoder for format.
F5 - msg_lr_satellites
Message, containing satellite data, used in GNSS LR position fix. Send on port 5. See ttn-decoder for format.
F6 - msg_ublox_satellites
Message, containing satellite data, used in Ublox position fix. Send on port 9. See ttn-decoder for format.
F7 - msg_wifi_scan_aggregated
Message containing top-3 scanned wifi results. Send on port 6. See ttn-decoder for format.
F8 - msg_wifi_scan
Message containing scanned wifi results from single scan. Send on port 10. See ttn-decoder for format.
F9 - msg_ble_scan_aggregated
Message containing top-3 scanned BT results. Send on port 7. See ttn-decoder for format.
FA - msg_bt_scan
Message containing all results from single BT scan. Send on port 11. See ttn-decoder for format.
FB - msg_rf_scan
Not supported.
FC - almanac_age
Almanac age of the format:
FD - msg_mac_id
Message contating MAC id of the form:
FE - msg_last_position
Message containing last obtained position in the form:
FF - msg_read_flash
Message format for sending flash logs to port 29. See ttn-decoder for format.
Last updated