80.firmware-upgrade
Functional Overview
In order to maintain the firmware version of the device, the cloud API allows users to upgrade the firmware of DJI Dock and aircraft through the cloud. Users can implement single upgrade as well as batch upgrade, upgrade prompt, upgrade progress display, etc.
In order to realize the firmware upgrade function, the user needs to download the required firmware installation package on the developer's official website in advance, such as M30 series firmware version package. Users need to maintain the firmware installation package, firmware version and other information in the cloud server by themselves. The firmware properties information reported by the device is compared with the firmware package information in the cloud to determine whether firmware upgrade is required. When issuing a firmware upgrade command on the cloud, you need to supplement the protocol with the serial number of the upgrade device, the firmware version number, the storage address of the firmware upgrade file, and the type of firmware upgrade. The device can get the firmware upgrade progress through the percent and step_key parameters in the firmware upgrade progress command. For details, please refer to the content in Interface Detailed Implementation for detailed review in the cloud API.
Note:
By uploading the properties of the firmware upgrade object model,
firmware_versioncan be compared with the version number of the latest firmware, which can be used to determine whether a general upgrade is required.compatible_statuscan be used to determine whether a consistent upgrade is required.Priority order of upgrades: normal upgrades higher consistent upgrades. A normal upgrade can override a consistent upgrade. Because if the version of the device is consistent with the latest firmware version 1.x, but the firmware of the battery module is low, the device side will report the object model that needs to be upgraded consistently. However, if the latest firmware version is 2.x, which is inconsistent with the version of the device, the battery module with a lower version will be upgraded by the way, and the problem of firmware inconsistency will eventually be resolved.
Interaction Sequence Diagram
sequenceDiagram
participant client as DJI Dock
participant app_server as Cloud Server
client ->> app_server : report device firmware properties
app_server ->> client : create firmware upgrade task<br/>Topic: thing/product/{gateway_sn}/services<br/>Method: ota_create
client -->> app_server : device response<br/>Topic: thing/product/{gateway_sn}/services_reply
loop device upload progress and cloud response
client ->> app_server : report upgrade task progress and status<br/>Topic: thing/product/{gateway_sn}/events<br/>Method: ota_progress
app_server -->> client : Cloud response<br/>Topic: thing/product/{gateway_sn}/events_reply
endDetailed API Realization
Firmware properties report The firmware upgrade function will report two properties fields,
Device firmware version number - firmware_versionandFirmware consistency - compatible_status.firmware_versionis compared with the version number of the latest firmware, which can be used to determine whether a general upgrade is required.compatible_statuscan be used to determine whether a consistent upgrade is required.Issue firmware upgrade task The firmware upgrade API delivered by the cloud needs to complete the filling of the device serial number, firmware upgrade package information, and firmware upgrade type.
Firmware upgrade progress The device reports the firmware upgrade progress to the cloud, and through the acquisition of fields, key information such as upgrade progress, upgrade progress percentage, and current upgrade steps can be displayed on the cloud visualization interface. Use the
ota_progressfield of thefirmware upgrade progressAPI to determine whether the upgrade is in progress.
Last updated