Upgrade Firmware

The Upgrade Firmware element is a task used to create an OTA task in EnOS for batch firmware upgrades by sending a HTTP request.

As the task would need information about the firmware to be upgraded, you can create a form through a preceding task to gather the required information from users.

Note

You can use a User Task that contains the OTA Firmware Upgrade Status form element to check the status of the upgrade. To determine the downstream path based on the upgrade status, attach the Upgrade Firmware Boundary Event to the User Task.

Properties

The following table describes the properties of the task.

Property Description
Name Specify a name for your own reference.
Firmware Description Specify a name for the firmware upgrade task. You can use a UEL expression to extract the information from a form.
Firmware Specify the firmware ID. You can use a UEL expression to extract the information from the variable of the Firmware Dropdown form element.
Upgrade Strategy Specify the upgrade strategy (snapshot, incremental). You can use a UEL expression to extract the information from the variable of the Static Dropdown form element.
Upgrade Scope Specify the scope of devices to be upgraded (total, partial). You can use a UEL expression to extract the information from the variable of the Static Dropdown form element.
Firmware Version Specify the firmware versions. You can use a UEL expression to extract the information from the variable of the Firmware Version Dropdown form element.
Target Devices Specify the key of the devices to be upgraded. You can use a UEL expression to extract the information from the variable of the Device Dropdown form element.
Upgrade Push Time Range Specify the start and end time of the schedule for pushing upgrade requests. You can use a UEL expression to extract the information from a form.
Enable Device Upgrade Request Specify whether to enable devices to issue upgrade requests. You can use a UEL expression to extract the information from a form.
Upgrade Description Specify a description for the firmware upgrade task. You can use a UEL expression to extract the information from a form.
Result Variable Name Specify a unique name for identifying the JSON variable that is used to store the response parameters. The ID of the created task is stored in the data.jobId parameter.
Status Code Variable Name Specify a unique name for identifying the variable that is used to store the response status code. Status code 0 indicates that the task is successful.


Note

You need to specify the variable names if you want to display or process the task result in a later process element.

Results

The following code shows an example of the result returned when the task is successful.

{
   "code":0,
   "msg":"OK",
   "requestId":"2d0c9305-0877-43fb-9c93-bf1e89fd9546",
   "data":{
      "jobId":"5f18fbbe4f051a001b222f5d"
   }
}

If you specified variable names, all parameters will be stored in the result variable and the code parameter will be stored in the status code variable. You can obtain the parameter values by using the dot notation. For example, if the result variable name is “result”, use ${result.data.jobId} to extract the ID of the created task.


For more information about creating a batch firmware upgrade task in EnOS and the details of each property, see: