Skip to content

Device Client Design for IoT Software Package Catalog

0

My intention is to deliver firmware to an IoT client.

I am familiar with the documentation for the IoT software package catalog . However, all resources seem to describe the AWS/core side of operations, rather than the device clients. Any documentation/samples for device clients I found use a custom job for firmware delivery rather than the package catalog mechanisms; most examples pre-date the existence of the software package catalog.

Question What interactions with IoT Core should a device perform during the delivery of firmware?

For example, should this be treated exactly like a regular job? Can I follow the jobs sample code and just update the job status? Or are there added permissions/activities required for the client?

From the device perspective my understanding is that it is a regular job. Specific to the firmware scenario it will need custom permissions to access the firmware in an s3 bucket.

As long as the reserved named shadow ($package) is managed by the core (as recommended), it seems the device never needs permissions to device shadow topics. If the device is not managing the shadow, the device would need to update this shadow with the correct firmware version on completion.

asked a year ago117 views
1 Answer
3
Accepted Answer

From the device perspective, delivering firmware using the AWS IoT Software Package Catalog is indeed very similar to handling a regular AWS IoT job. You can follow the general approach outlined in the jobs sample code, with a few considerations specific to firmware delivery:

  1. Job Document: The job document for a firmware update will contain information specific to the software package, including the package name, version, and potentially a URL to download the firmware from an S3 bucket.

  2. S3 Access: As you correctly noted, the device will need permissions to access the S3 bucket where the firmware is stored. This typically involves using AWS IoT credentials or other secure methods to authenticate and download the firmware.

  3. Job Execution: The device should follow the standard job execution flow:

    • Receive the job notification
    • Download the job document
    • Parse the document to extract firmware details
    • Download the firmware from S3
    • Install/update the firmware
    • Update the job status (IN_PROGRESS, SUCCEEDED, or FAILED)
  4. Reserved Named Shadow ($package): You're correct that if the $package shadow is managed by AWS IoT Core (which is the recommended approach), the device doesn't need to interact with it directly. The shadow will be automatically updated based on the job execution status.

  5. Shadow Updates: If, for any reason, you decide to manage the $package shadow from the device side, you would indeed need to update it with the correct firmware version upon successful completion. This would require additional permissions for the device to publish to the shadow topics.

  6. Error Handling: Implement robust error handling for scenarios such as download failures, installation issues, or version conflicts.

  7. Version Verification: After updating, the device should verify that the new firmware version is correctly installed and functioning.

In summary, while the Software Package Catalog provides enhanced management capabilities on the AWS side, from the device's perspective, the process is largely similar to handling a standard IoT job. The main differences lie in the job document structure and potentially in how you handle the $package shadow if you choose to manage it from the device side.

Remember to thoroughly test your implementation, especially the error handling and recovery processes, to ensure reliable firmware updates across your device fleet.

Sources
Getting started with Software Package Catalog - AWS IoT Core
Preparing to use Software Package Catalog - AWS IoT Core
Preparing AWS IoT Jobs - AWS IoT Core

answered a year ago
EXPERT
reviewed a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.