Tutorial: End to end firmware update using Device Management Client Lite
Tip: If you cannot access some of the repositories referenced in this section, please contact us to request access.
This section covers updating firmware using Device Management Client Lite.
If you want to update devices using Device Management Client, refer to Device Management Update documentation.
There are two methods for updating the firmware on your device using Device Management Client Lite:
- Through the Device Management Portal.
- Using the RESTful APIs:
- Directly with HTTP APIs.
- Using the Device Management SDK.
- Using the manifest tool.
Both methods use the Update feature built into Device Management Client Lite.
In this guide, we explain how to update the firmware using the manifest tool.
The workflow for this guide is:
- Set up the device to receive firmware updates.
- Update the firmware application remotely using Device Management:
- Create a new update image.
- Upload the new image.
- Create and upload a manifest and key table.
- Create a device filter.
- Create and start an update campaign.
- Monitor the campaign's progress, and confirm its successful completion.
Set up the device to receive firmware updates
To set up your device to receive firmware updates please see the Device Management Client Lite tutorial.
Update the device with new image
Create and upload a update image
Create a new update image with any changes you may require and recompile.
Connect to Device Management Portal and log in with your credentials.
Open the Firmware update menu.
Open the Images menu.
Click Upload image.
Enter a Name and a Description
Click Choose file, and upload the new update image to Device Management. You can see the update image in the output of
mbed compile. For example:
Once your update image upload completes, it is visible in the Images list. Copy the URL of the update image.
Create and upload a manifest
Create a manifest using the command:
manifest-tool create -p <payload file> -u <file url> -o k64_mini-test.manifest --mac --psk-table table.proto --psk-table-encoding protobuf -k .update-certificates/default.master.psk
is the same update image which was uploaded to Device Management Portal.
The file URL is (you got this from Device Management Portal in previous steps when you uploaded the update image) for example:
Upload the manifest and key table to the Device Management Portal. Use the following
curl -H "Authorization: bearer <api key>" -F "datafile=@k64_mini-test.manifest" -F "firstname.lastname@example.org" https://api.us-east-1.mbedcloud.com/v3/firmware-manifests
You can also upload it in Device Management Portal under Firmware update > Manifests.
Create a device filter
Device filters allow you to target specific devices for update. Create a device filter in Device Management Portal now to use it in your update campaign later.
- Open the Device directory menu.
- Click More.
- Click Add another.
- Add a filter on Device name (in this case, the device shown is the only one that has a name).
- To add mode filtering rules, click again Add another.
- Click Save, give your filter a name and click Save filter.
- The new filter is automatically applied to the page, and only devices with the selected attributes appear.
Create and manage an update campaign
Update campaigns combine a device filter and a manifest to advertise an update to your device. Create an update campaign in Device Management Portal:
- Open the Firmware update menu.
- Open the Update campaigns menu.
- Click New campaign.
- Enter a Name and a Description.
- Select the manifest you just uploaded from the dropdown menu.
- Select the filter you created from the filter dropdown menu.
- Click Finish.
- The campaign is in the draft state.
- When you are ready to start the update process, click Start.
- When the update process starts, you see the progress in stages. Wait until your the device is updated. On the device side, you can see the progress and notifications as soon as the firmware update starts.
- When the update completes and the application starts running, the device reconnects and campaign Phase changes to Stopped. The update process is now completed.
You have successfully updated your device's firmware using Device Management Portal.