Below you will find information about how to use the IoT Bridge to manage and update firmware on devices via LWM2M and the standard firmware update process using object #5.
push
and pull
models for delivering firmware, but in general pull
is the preferred method to use.The LWM2M Inventory is available under the Advanced
menu. It allows you to upload files that can be served to devices through either push
or pull
firmware update operations.
Before you can initiate an update using the built-in hosting service, you must upload files, otherwise you can still use external URLs for your firmware file.
When using the IoT Bridge to initiate and manage a firmware update operation, the flow of events and data will look like this:
lwm2m.firmwareUpdate()
. See the LWM2M documentation for details about the parameters for this function.idle
to downloading
to downloaded
LWM2M FOTA Status
events will be generated to allow triggers to update connected applications with the status of the updates.downloaded
the server will automatically execute the update
resource to initiate the update operation.downloaded
to updating
to idle
LWM2M FOTA Status
events will be generated to allow triggers to update connected applications with the status of the updates.idle
), a LWM2M FOTA Complete
event will be generated.Below you will find instructions to import a Solution Template to demonstrate and lay the foundation for managing firmware updates for LWM2M devices in the IoT Bridge.
Below you will find descriptions of the reports and triggers.
1. LWM2M FOTA Report
This report receives updates from the FOTA triggers and can provide visibility within the IoT Bridge to see the status of firmware update operations. Until devices register to the LWM2M server (after importing the template) the report will not show any data.
The overview shows you several aggregations to help visualize the status of your devices:
You can click on the details button to view more information about the firmware update status. The Details view shows the same aggregations, as well as a table view enabling quick status checks on an ongoing campaign.
It is important to understand that the report is fluid and can be modified to include information relevant to you.
You can edit the firmware report to add additional fields and aggregations depending on what is important for your application. Maybe the manufacturer is the same, but pivoting on model is more important, any resource in the LWM2M model can be used in the report. Additionally you can blend in data from your application to add customers.
1. LWM2M - FOTA - On Register
This trigger collects information from devices when they register to the server and stores it in the report. By default it gathers the manufacturer, model, and version of the device, but can easily be extended to gather other information.
2. LWM2M - FOTA - On Status Update
This trigger fires whenever the firmware state machine for a device advances. The states mostly follow the states defined in the LWM2M specification, however, you may see some other transient states used by the platform to manage the reliability of the firmware update process. You should not need to update this trigger.
3. LWM2M - FOTA - On Complete
This trigger fires when a firmware update completes on a device, this could be a success or a failure. The trigger updates the report accordingly. You should not need to update this trigger.
4. LWM2M - FOTA - Initiate
This is a sample trigger that initiates a firmware update on one or more devices based on either a list of endpoint keys, or a set of search criteria. You may elect to keep this trigger, or implement your own logic based on your application needs. Below you will find some use cases to help rationalize the best approach.
Below you will find some example for how you can initiate an update on one or more devices.
The LWM2M - FOTA - Initiate trigger allows some simple, yet powerful updates to be performed.
{
"keys": [ "key1", "key2"],
"uri": "http://localhost"
}
The LWM2M - FOTA - Initiate trigger allows some simple, yet powerful updates to be performed.
{
"search": {
"connected": true,
"tags": {"version":"1.1.0"}
},
"uri": "http://localhost"
}
These triggers may initiate reads (especially during registration) that are duplicated with other logic. In production, you may elect to merge the functionality of the triggers in this project with other triggers that access the same data to reduce data/power consumption in the device.