Firmware Upgrade
Event
Firmware upgrade progress
Topic: thing/product/{gateway_sn}/events
Direction: up
Method: ota_progress
Data:
Column | Name | Type | constraint | Description |
---|---|---|---|---|
status | Mission status | enum | {"sent":"sent","in_progress":"in progress","ok":"success","paused":"paused","rejected":"rejected","failed":"failed","canceled":"canceled or stopped","timeout":"timeout"} | |
progress | progress | struct | ||
»percent | percent of progress | int | {"min":"0","max":"100","unit":"%","unitName":"percent","step":"1"} | |
»step_key | Current step | enum | {"download_firmware":"Download firmware","upgrade_firmware":"upgrade firmware"} |
Example:
{
"method": "ota_progress",
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp:": 1654070968655,
"data": {
"result": 0,
"output": {
"status": "in_progress",
"progress": {
"percent": 10,
"step_key": "download_firmware"
}
}
}
}
Topic: thing/product/{gateway_sn}/events_reply
Direction: down
Method: ota_progress
Data:
Column | Name | Type | constraint | Description |
---|---|---|---|---|
result | 返回码 | int | 非0代表错误 |
Example:
{
"method": "ota_progress",
"tid": "6a7bfe89-c386-4043-b600-b518e10096cc",
"bid": "42a19f36-5117-4520-bd13-fd61d818d52e",
"timestamp": "1234567890123",
"data": {
"result": 0
}
}
Service
Firmware upgrade
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: ota_create
Data:
Column | Name | Type | constraint | Description |
---|---|---|---|---|
devices | Device set of firmware upgrade | array | {} | |
»[array_item] | Elements in array | struct | {} | {"size": "2"} |
»»sn | Device serial number | text | {"length":"10240"} | |
»»product_version | Firmware version number | 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 | {"2":"Consistent firmware update","3":"Normal firmware update"} | Consistent firmware update: A consistent firmware update is required when the firmware versions of some modules of the aircraft are inconsistent with the compatible version of the system. For example, the drone and RC have been updated to newest version, but the used batteries is not updated. Then the Consistent firmware update will be prompted. Normal firmware update: Developers update all modules of drone to selected firmware version. |
Example:
{
"method": "ota_create",
"timestamp:": 1654070968655,
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"devices": [
{
"sn": "drone_sn",
"product_version": "1.00.223",
"file_url": "https://s3.com/xxx.zip",
"md5": "abcdefabcdefabcdef",
"file_size": 653467234,
"file_name": "wm245_1.00.223.zip",
"firmware_upgrade_type": 2
},
{
"sn": "dock_sn",
"product_version": "1.00.223",
"firmware_upgrade_type": 3
}
]
}
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: ota_create
Data:
Column | Name | Type | constraint | Description |
---|---|---|---|---|
status | Mission status | enum | {"sent":"sent","in_progress":"in progress","ok":"success","paused":"paused","rejected":"rejected","failed":"failed","canceled":"canceled or stopped","timeout":"timeout"} |
Example:
{
"method": "ota_create",
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp:": 1654070968655,
"data": {
"result": 0,
"output": {
"status": "in_progress"
}
}
}