Caution! Article for developers

Information on this page is intended particularly for users with advanced technical knowledge.

Update your Treon Industrial Node via Device Management (DM) interface

Aug 29, 2022 · 5 minutes to read

Treon Industrial Node Treon Industrial Node 6

This article describes the process of updating your Treon Industrial Nodes and Industrial Nodes 6 to the latest firmware version via Device Management (DM) interface.

DM commands get, set, and execute are used for this procedure. Val-field content is always in base64 encoded format.

Gateway will acknowledge device management commands with a message containing field “S” (Status). If the status is 0, the command is accepted for execution.

Send the DM messages to:
/treon/devicebound/serialGW

 

1 Set URI

Use the following URI provided to you by support@treon.fi

Message:
{“Ver”: “2”, “Cmd”: “set”,“T”: [33581, 0],“Res”: [1], “Val”: ["Encoded URI"], “I”: 1 }

Expect reply message with “S”:0 indicating success.
{“I”:1,“S”:0,“Type”:“dm”,“T”:[33581,0]}

 

2 Check update state

Check update state regularly until update state is completed by sending this DM message:
{“Ver”: “2”, “Cmd”: “get”,“T”: [33581, 0],“Res”: [3],“I”:2 }

Gateway will reply with status:
{“Val”:[“Ag=="],“I”:2,“Res”:[3],“S”:0,“T”:[33581,0],“Type”:“dm”}
Where Val-field includes base64 encoded update state:

  • Downloading 1 (“S”:1)
  • Downloaded 2 (“S”:2)

Wait for status 2 downloaded. Status 2 indicates that the download is completed, and you can proceed to the next step.

 

3 Execute update

After the firmware package has been downloaded, the actual update process can be started. Execute command requires a set of parameters, see details below.

Firmware update command is sent:
{“Ver”: “2”, “Cmd”: “execute”,“T”: [33581, 0],“Res”: [2], “Val”: ["ENCODED PARAMETER SET"], “I”: 3 }

Example parameter setting for small networks:

  • Using value 0 selects the default value.
  • All data is presented in little‐endian format.
Parameter nameBytesSet valueNotes
Destination0-30x00000000Use default value, that is, BROADCAST. Destination address is Wirepas address, not sensor id. Using the default value 0 is recommended.
Target4-110x1122334455667788Default value for targeting info is Treon Industrial Node. To update Treon Industrial Node 6, use 0x1122334455667766 targeting info.
Tcomplete12-130x0A0010 s delay before sending complete message
Tfrag14-150xC4092500 ms delay between each fragment
Trigger16-170x0000Use default
Twait18-190xB400180 s delay waiting for responses
Tstart20-210x0A0010 s delay after sending start, before first fragment (seconds)
DestinationTargetTcompleteTfragTriggerTwaitTstart
0000000011223344556677880A00C4090000B4000A00
0000000011223344556677660A00C4090000B4000A00
Node versionbytearrayBase64 encoded parameter set
Industrial Node0000000011223344556677880A00C4090000B4000A00MDAwMDAwMDAxMTIyMzM0NDU1NjY3Nzg4MEEwMEM0MDkwMDAwQjQwMDBBMDA=
Industrial Node 60000000011223344556677660A00C4090000B4000A00MDAwMDAwMDAxMTIyMzM0NDU1NjY3NzY2MEEwMEM0MDkwMDAwQjQwMDBBMDA=

Example parameter setting for big networks

  • Depending on the network size, different parameters should be used.
  • For bigger networks, the following parameters are recommend.
Parameter nameBytesSet valueNotes
Destination0-30x00000000Use default value, that is, BROADCAST. Destination address is Wirepas address, not sensor id. Using the default value 0 is recommended.
Target4-110x1122334455667788Default value for targeting info is Treon Industrial Node. To update Treon Industrial Node 6, use 0x1122334455667766 targeting info.
Tcomplete12-130x7800120 s delay before sending complete message
Tfrag14-150x102710 000 ms delay between each fragment
Trigger16-170x7800120 s delay before updating firmware
Twait18-190xB400180 s delay waiting for responses
Tstart20-210x3C0060 s delay after sending start, before first fragment (seconds)
DestinationTargetTcompleteTfragTriggerTwaitTstart
000000001122334455667788780010277800B4003C00
000000001122334455667766780010277800B4003C00
Node versionbytearrayBase64 encoded parameter set
Industrial Node000000001122334455667788780010277800B4003C00MDAwMDAwMDAxMTIyMzM0NDU1NjY3Nzg4NzgwMDEwMjc3ODAwQjQwMDNDMDA=
Industrial Node 6000000001122334455667766780010277800B4003C00MDAwMDAwMDAxMTIyMzM0NDU1NjY3NzY2NzgwMDEwMjc3ODAwQjQwMDNDMDA=

Gateway will acknowledge the command with status reply:
{“I”:3,“S”:0,“Type”:“dm”,“T”:[33581,0]}

 

4 Check update state regularly until update state is completed

The update process may take several hours, depending on used parameters. Meanwhile, you can check the progress by sending this command:
{“Ver”: “2”, “Cmd”: “get”,“T”: [33581, 0],“Res”: [3],“I”:4 }

Reply:
{“Val”:[“AwDYn2y0”],“I”:4,“Res”:[3],“S”:0,“T”:[33581,0],“Type”:“dm”}
Base64 value: AwDYn2y0 decodes to bytes: 0300d89f6cb4
03 ‐ state (updating)
00 ‐ progress percentage
d89f6cb4 ‐ sensor serial number of nodes that have acknowledged the start message, (bytes are in little-endian format)

Wait for state 0 (Idle). State 0 indicates that the installation is completed, and you can proceed to the next step.

 

5 Check update result

You can check the result by sending this command:
{“Ver”: “2”, “Cmd”: “get”,“T”: [33581, 0],“Res”: [5],“I”:5 }

Reply:
{“Val”:[“AdifbLQ="],“I”:5,“Res”:[5],“S”:0,“T”:[33581,0],“Type”:“dm”} Base64 value AdifbLQ= decodes to bytes: 01d89f6cb4
01 ‐ state (firmware upgraded successfully)
d89f6cb4 ‐ sensor serial number (bytes are in little-endian format)

The reply will contain serial numbers of all sensors that successfully updated its firmware. The serial numbers of sensors which were not successfully updated are not included in the reply.

 

6 Check the firmware version of the updated sensor

Send this command:
{“Ver”: “2”, “Cmd”: “get”,“T”: [3, 0],“Res”: [3], “Nid”:[“BROADCAST”],“I”:6 }

Reply:
{“Val”:[“AQMBbWk2YA=="],“I”:6,“Res”:[3],“Nid”:“b46c9fd8”,“S”:0,“T”:[3,0],“Type”:“dm”}

Base64 value AQMBbWk2YA== decodes to bytes: 060f0036903962 The first 3 bytes correspond to version number 6.15.0
The last 4 bytes are an encoded date

 

Treon Customer Support

If you are at any point of the update process unsure how to continue, or you have an issue that could not be solved with the Troubleshooting section, please contact Treon Customer Support.

   


Was this article helpful? Let us know.
Next
Previous