Exclude thingGroup from FreeRTOS OTA update

0

Is it possible to exclude certain thingGroups from a FreeRTOS OTA update job?

As an example: Say I have thingGroups: "production", "beta", and "internal". Some things may belong to multiple groups.

I might want to roll out an update to the beta group first and then at some later time, deploy the update to all production devices.

When I go to make the job to deploy to the production group, can I exclude the beta group from this job? I know that those things have already received the update, so I don't need them to go through the process of re-downloading the update and rejecting it because it's already on the device.

asked 2 months ago112 views
2 Answers
1

Dynamic thing groups are the right tool to manage this, and it's the kind of scenario the feature is designed for. You can have devices report their firmware version in a device shadow (or perhaps use the package catalog feature and reserved shadow). You can include the shadow in the fleet indexing and then use the firmware version to create dynamic groups. For things, their group membership will automatically change as their firmware version changes, ensuring they are no longer targeted by jobs (OTA updates) once they have received the update.

So you could still have static thing groups for beta and production. Imagine all devices are currently running firmware 1.0, and this is reported in the firmware field of the classic (un-named shadow). You can create two dynamic groups ahead of performing your updates:

beta-1.0

thingGroupNames = beta and shadow.reported.firmware = 1.0

and

production-1.0

thingGroupNames = production and shadow.reported.firmware = 1.0

You create an OTA update targeting the beta-1.0 group, upgrading the things in that group to 1.1. As each thing updates, it exits the beta-1.0 group, but it ALSO exits the production-1.0 group. Now you create an OTA update targeting the production-1.0 group. This group will not include any devices that have already upgraded to 1.1.

This is just one way. Instead of static thing groups, you could use Thing attributes to denote beta and production devices. There are many possibilities.

profile pictureAWS
EXPERT
Greg_B
answered 2 months ago
  • I should have clarified my set up a little more, but this sounds on the right track.

    My things have attributes that are assigned dynamically based on their user profile in my application. So a given thing may have attributes like:

    beta: true
    environment: production
    

    Then the thingGroups I have defined are dynamic based on those attributes. Given this extra information is the only real way to filter out things to update by using the thing's current firmware version?

  • A job targets things and thing groups. So the way to remove things is to change group membership. Firmware version wouldn't be the only way. But you need some way of knowing whether a device is already updated. Knowing it's current version would generally be a very good way.

0

Per my info unfortunately, FreeRTOS OTA currently doesn't provide a direct mechanism to exclude specific thing groups from an update job.

The primary reason for this is that OTA updates are typically designed to target a specific software version or a set of devices based on their firmware version. While you can filter devices based on these criteria, excluding devices based on custom tags or groups like "beta" or "production" is not directly supported.

While not ideal , a potential workaround you can consider: 1/ Assign unique firmware versions to devices in different thing groups. 2/ Create OTA update jobs targeting specific firmware versions. 3/ This approach requires careful management of firmware versions and can become complex with frequent updates.

profile pictureAWS
cloudyy
answered 2 months 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.

Guidelines for Answering Questions