Quick start guide
GATT server setup from the device settings
Initially, utilize an admin settings template with a minimum version of V8. Then, navigate to GATT server settings:
These are the available options for the GATT server:
Setting | Description |
|---|---|
GATT server enable (required) | Enables the GATT server by starting connectable advertisements. |
Device name (optional) | Device name advertised on the connectable advertisement message which is set up automatically by the firmware. If this field is left blank, the device advertises the packet with no name data type. |
Passkey enable (optional) | Enables the highest level of security and passkey entry when pairing. |
Passkey (required) | Passkey for the GATT server. If passkey is not used, this can be a random value, but it is limited to 100000-999999. This option is recommended for secure transfer of data. |
Command key (required) | Command key for the GATT command service. Must be between 1 and 32 characters. |
GATT command message generation example
To generate a full GATT command message, a few things should be acquired:
Device IMEI -
869738062295360GATT command key -
987654321Command expiry time (decimal) -
1733047200Output ID -
01hOutput data -
1000h
Using BT command serialiser (BT command serializer app )
Execute the bt_command_serialiser.py file with the following arguments in this order:
Device IMEI
869738062295360UTC expiry time in decimal format
1733047200(2024-12-01 12:00)Command key
987654321(from device settings)Output command id and output command data
01010064(Turn on OUT2 for 1s)
This is what the command line command would look like:
python.exe "bt_command_serialiser.py" 869738062295360 1733047200 987654321 01010064The output:
86c40070e00d8cff6a7b3d596630b32277c573c5a5b7f91feaa2712c705af49902040a00a0334c6701b703010064b6
Not using BT command serialiser
Access token generation:
Firstly, IMEI, command expiry time (UTC) and command key must be appended in the said order.
Secondly, HMACSHA256 algorithm must be applied to the data in the earlier step.
This is what the access token should look like with the provided data:
86c40070e00d8cff6a7b3d596630b32277c573c5a5b7f91feaa2712c705af499
Output command generation:
Go to BT IOTM output command generation and fill out the data according to the tables
According to the data provided at the start, this is what an output command would look like:
02040a00a0334c6701b703010064b6
Connecting output command and access token:
The full output command is the access token appended to the output data:
86c40070e00d8cff6a7b3d596630b32277c573c5a5b7f91feaa2712c705af49902040a00a0334c6701b703010064b6
Sending the command:
An appropriate phone app (nRF Connect mobile is recommended) or a different Bluetooth device that supports GATT client functionality must be used to send the command to the device.
The two devices must be connected and paired to send the command.
Find the TX characteristic (
00000101-0000-1000-8000-00805f9b34fb) in the Command service (00000100-0000-1000-8000-00805f9b34fb).Write data to the TX characteristic.
To check if the message is received and executed, either subscribe to the RX characteristic (
00000102-0000-1000-8000-00805f9b34fb) or manually read from it.
Note: MTU exchange must be done before the command is sent.