Firmware Upgrade
Firmware Upgrade Progress
Topic: thing/product/{gateway_sn}/events
Direction: up
Method: ota_progress
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| result | Return code | int | 0 for in-progress and successful states; for the failed, rejected or timeout terminal states, the corresponding status code | |
| output | Output | struct | Output of the service execution | |
| »status | Task status | enum_string | {"canceled": "Canceled or Terminated", "failed": "Failed", "in_progress": "In Progress", "ok": "Successful Execution", "paused": "Paused", "rejected": "Rejected", "sent": "Sent", "timeout": "Timeout"} | Task execution status |
| »sub_status | Sub status | enum_string | UNKNOWN: Unknown, VERIFY: Start file verification, VERIFY_SUCCESS: File verification successful, UPGRADING: Upgrading, UPGRADE_SUCCESS: Upgrade successful, UPGRADE_FAIL: Upgrade failed, DOWNLOADING: Downloading, DOWNLOAD_SUCCESS: Download successful, DOWNLOAD_FAILED: Download failed, UPLOADING_DRONE: Uploading upgrade package to devices, VERIFY_FAILED: Verification failed | Firmware upgrade sub-status |
| »progress | Progress | struct | Task execution progress | |
| »»percent | Progress percentage | int | {"max":"100","min":"0","step":"1","unit_name":"Percentage / %"} | Current progress percentage |
| »»step_key | Current step | enum_string | {"download_firmware":"Downloading Firmware", "upgrade_firmware":"Upgrading Firmware"} | Current execution step identifier |
Example:
{
"bid":"8ca0ffa2-5e72-4078-8fa9-dc68216ff5d1",
"data":{
"output":{
"progress":{
"percent":0,
"step_key":"download_firmware"
},
"status":"failed",
"sub_status":"DOWNLOAD_FAILED"
},
"result":0
},
"tid":"74045eba-bd24-4106-b455-d3577f3cbf52",
"timestamp":1707048089244,
"method":"ota_progress"
}
Service
Firmware Upgrade
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: ota_create
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| devices | Firmware Upgrade Devices | array | {"size": 2, "item_type": struct} | List of devices to be upgraded |
| »sn | Device Serial Number (SN) | text | {"length":"10240"} | Device serial number |
| »product_version | Firmware Version | text | {"length":"10240"} | Target firmware version number |
| »file_url | Firmware File Download URL | text | {"length":"10240"} | Firmware file download URL |
| »md5 | Firmware File MD5 | text | {"length":"10240"} | Firmware file MD5 checksum |
| »file_size | Firmware File Size | int | Firmware file size in bytes | |
| »file_name | Firmware File Name | text | Firmware file name | |
| »firmware_upgrade_type | Firmware Upgrade Type | enum_int | {"3":"Regular Upgrade"} | Firmware upgrade type |
Example:
{
"bid":"8ca0ffa2-5e72-4078-8fa9-dc68216ff5d1",
"data":{
"devices":[
{
"file_name":"EvoNest-V1.2.0.69.Encrypt.uav",
"file_size":603696942,
"file_url":"https://storage.example.com/firmware/EvoNest-V1.2.0.69.Encrypt.uav",
"firmware_upgrade_type":3,
"md5":"d1c9dacec124abd350379eb44b9143e5",
"product_version":"1.2.0.69",
"sn":"NM1923221021"
}
]
},
"tid":"74045eba-bd24-4106-b455-d3577f3cbf52",
"timestamp":1654070968655,
"method":"ota_create"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: ota_create
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| result | Return code | int | Non-zero represents an error | |
| output | Output | struct | Output of the service execution | |
| »status | Task status | enum_string | {"canceled": "Canceled or Terminated", "failed": "Failed", "in_progress": "In Progress", "ok": "Successful Execution", "paused": "Paused", "rejected": "Rejected", "sent": "Sent", "timeout": "Timeout"} | Task execution status |
Example:
{
"bid":"149878685687484417",
"data":{
"output":{
"status":"in_progress"
},
"result":0
},
"tid":"5bdd5c11-469c-45d9-afce-d9ec3025f379",
"timestamp":1708573102118,
"method":"ota_create"
}