Firmware Upgrade

2023-07-18
No Rating

Event

Firmware upgrade progress

Topic: thing/product/{gateway_sn}/events

Direction: up

Method: ota_progress

Data:

ColumnNameTypeconstraintDescription
statusMission statusenum{"sent":"sent","in_progress":"in progress","ok":"success","paused":"paused","rejected":"rejected","failed":"failed","canceled":"canceled or stopped","timeout":"timeout"}
progressprogressstruct
»percentpercent of progressint{"min":"0","max":"100","unit":"%","unitName":"percent","step":"1"}
»step_keyCurrent stepenum{"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:

ColumnNameTypeconstraintDescription
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:

ColumnNameTypeconstraintDescription
devicesDevice set of firmware upgradearray{}
»[array_item]Elements in arraystruct{}{"size": "2"}
»»snDevice serial numbertext{"length":"10240"}
»»product_versionFirmware version numbertext{"length":"10240"}
»»file_urlFirmware file download addresstext{"length":"10240"}
»»md5Firmware file md5text{"length":"10240"}
»»file_sizeFirmware file sizeint
»»file_nameFirmware file nametext
»»firmware_upgrade_typeFirmware upgrade typeenum{"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:

ColumnNameTypeconstraintDescription
statusMission statusenum{"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"
		}
	}
}
If you have any comments or confusion about our documentation, you can click here to give feedback and we will get back to you as soon as possible.