Firmware Upgrade
Event
Firmware Upgrade Progress
Topic: thing/product/{gateway_sn}/events
Direction: up
Method: ota_progress
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| result | Return code | int | Non-zero represents error | |
| output | Output | struct | ||
| »status | Task status | enum_string | {"canceled":"Canceled or terminated","failed":"Failed","in_progress":"In progress","ok":"Execution successful","paused":"Paused","rejected":"Rejected","sent":"Sent","timeout":"Timeout"} | |
| »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:Upload upgrade package to device, VERIFY_FAILED:Verification failed; | |
| »progress | Progress | struct | ||
| »»percent | Progress percentage | int | {"max":"100","min":"0","step":"1","unit_name":"Percentage / %"} | |
| »»step_key | Current step | enum_string | {"download_firmware":"Download firmware","upgrade_firmware":"Update firmware"} |
Example:
{
"bid":"8ca0ffa2-5e72-4078-8fa9-dc68216ff5d1",
"data":{
"output":{
"progress":{
"percent":0,
"step":1,
"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 device collection | array | {"size": 2, "item_type": struct} | |
| »sn | Device serial number (SN) | text | {"length":"10240"} | |
| »product_version | Firmware version | text | {"length":"10240"} | |
| »file_url | Firmware file download address | text | {"length":"10240"} | |
| »md5 | Firmware file MD5 | text | {"length":"10240"} | |
| »file_size | Firmware file size | int | ||
| »file_name | Firmware file name | text | ||
| »firmware_upgrade_type | Firmware upgrade type | enum_int | {"2":"Consistency upgrade","3":"Normal upgrade"} |
Example:
{
"bid":"8ca0ffa2-5e72-4078-8fa9-dc68216ff5d1",
"data":{
"devices":[
{
"file_name":"EvoNest-V1.2.0.69-20231215094829.Encrypt.uav",
"file_size":603696942,
"file_url":"http://192.168.1.1:9000/public/EvoNest-V1.2.0.69-20231215094829.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 error | |
| output | Output | struct | ||
| »status | Task status | enum_string | {"canceled":"Canceled or terminated","failed":"Failed","in_progress":"In progress","ok":"Execution successful","paused":"Paused","rejected":"Rejected","sent":"Sent","timeout":"Timeout"} |
Example:
{
"bid":"149878685687484417",
"data":{
"output":{
"progress":{
"percent":0,
"step":1,
"step_key":""
},
"status":"sent",
"sub_status":""
},
"result":0
},
"tid":"5bdd5c11-469c-45d9-afce-d9ec3025f379",
"timestamp":1708573102118,
"method":"ota_create"
}