Basic Firmware Update#
Remotely update the firmware of your LwM2M device using the Firmware Update Object
- An active Coiote IoT DM user account
- A device which supports Firmware Update Object
Firmware Update Object
The Firmware Update process is defined in the Firmware Update Object
/5. This Object contains Resources which define the update process using 4 Update States (representing the phase of the update process) and 11 Update Results (representing the most common outcomes of the firmware update process).
/5/*/3represents the State
/5/*/5represents the Update Result
||Idle||Before downloading and after successfully updating|
||Downloading||The new firmware is on the way|
||Downloaded||The firmware download is completed|
||Updating||The Client starts updating its firmware, after which it changes its state back to Idle|
||Firmware updated successfully|
||Insufficient flash memory for the new firmware package|
||Out of RAM during downloading proces|
||Connection lost during downloading process|
||Integrity check failure for new downloaded package|
||Unsupported package type|
||Firmware update failed|
||Firmware update cancelled|
||Firmware update deferred|
Learn more about the Firmware Update Object in the OMA LwM2M Object and Resource Registry.
Prepare the Firmware Update#
In the Coiote IoT Device Management platform, go to Device Inventory.
Select the device you want to update by clicking on its endpoint name.
Go to the Data model tab to validate if the Firmware Update Object
/5is present. If so, the Object is supported by the LwM2M Client.
Go to the Firmware update tab.
Click the Update Firmware button.
Select Basic Firmware Update.
Upload the firmware image.
Choose between Pull and Push:
Pull method (recommended): The LwM2M Client receives the URI of the file that is to be downloaded and pulls the file from it.
Push method: The LwM2M Server pushes the firmware file to the device.
Pull supports the following transport types:
Push transmits the firmware over the same transport type as is used for device management, which is
Which transport protocol to choose?
UDPtend to be slow due to the limitation of the maximum CoAP Block size of 1024 bytes and the required acknowledgements for each Block transfer.
HTTP(s)usually results in faster download speeds. However, not every device supports these transport protocols.
Click Schedule Update to trigger the Firmware Update process.
Download & Upgrade Process#
If the Firmware Update is scheduled successfully, the device starts downloading the firmware at the next practical opportunity. The actual firmware update starts once the integrity and authenticity of the firmware image has been validated by the LwM2M Client.
Once executed successfully, the status in the Update list panel changes to
While the device is updating its firmware, it will deregister and reboot using the new firmware. This process may time several minutes.
Monitoring the update process#
During the update process, the status of the firmware update can be monitored by reviewing the Resources State
/5/*/3 and Update Results
To find the Resources, select the Data model tab and open the Firmware Update Object
If no errors occur, the update process follows this pattern:
update result 0
update result 0
update result 0
update result 1
Does the State
0 and the Update Results
1? Congratulations! You've successfully updated the firmware of your device. 🎉
Firmware Update only works over CoAP, not over CoAPs#
For the firmware update over CoAPs transfer to work, the LwM2M Client shall use the same security credentials (i.e. PSK or certificates) as those used for the management interface. This is the default behavior of the Anjay client, but you might need to configure it explicitly when using other LwM2M Client implementations.
Zephyr LwM2M Client configuration instruction
The security tags needs to the same in the "Security tag for FOTA download library" as in the "LwM2M server TLS tag" (e.g. using Nordic's default tag:
To update the security tags, edit the Kconfig in the directory:
Zephyr Kernel > Modules > nrf > Nordic nRF Connect > Networking > Application protocols > LwM2M client utilities library > Security object support > Firmware Update object support
Kconfig editor in nRF Connect for VS Code
- Anjay firmware update documentation
- Anjay SDK
- Anjay Zephyr SDK
- Anjay ESP32 SDK
- OMA LwM2M Object and Resource Registry