Can I use AWS IoT Jobs to deploy configuration changes on my devices?

0

Here is the scenario.

We have a few smart light devices that are connected to AWS IoT Core. We are building a web application similar to Fleet Hub but more complicated. These lights should be able to receive an automated scene schedule. We can manually trigger them through MQTT Publish API.

If we wish to send the scene to the device at a later time, what should we do? Can we use scheduled Jobs to send the scene configuration changes to the device? How can we build this with ease?

profile picture
asked 5 months ago158 views
2 Answers
1

It's not clear to me if you want to update configuration one device at a time, or push it to N devices at once. This can be a key decision point because shadows are well-suited for 1:1, but jobs are better for 1:many.

If you want to send the change at a certain time, shadows has no in-built support for that, but jobs do (with the scheduled jobs you mentioned). However, timely delivery depends on the device being online and connected, and actually acting on shadow changes or the queued job. If the scene schedule should reliably become active at a certain time, I think you should plan to send the schedule to the device or devices well ahead of that activation time, and the device itself should probably activate the schedule at the correct time.

profile pictureAWS
EXPERT
Greg_B
answered 4 months ago
  • Hi Greg, thanks for your response. I greatly appreciate your answer.

    We are looking for an alternative approach where the device won't be able to run scheduled scenes at a later time once it receives the payload. Jobs have all the functionality we need, such as scheduling in advance and creation through an API. However, implementing them on the device could be tricky and complicated.

    We considered using EventBridge to schedule scenes and publish them to the devices through a Lambda function. We will maintain a database such as DynamoDB to carry the scene schedules. Do you have any valuable inputs for us?

  • From the device side, jobs aren't heavyweight. What language will you use? Our SDKs have good samples. I'm not sure jobs are the best choice though. Can you please elaborate? How many devices in total? How often is the schedule sent? Is it sent to devices one at a time, or to a group of devices, or to the whole fleet? What is the consequence if the schedule takes several/many seconds (or much longer) to reach a device? Are your devices normally and reliably online, or is their connection intermittment?

  • Hi Greg, allow me to answer all your questions. We will program the devices using Embedded C libraries. There should be around 10,000 devices. The devices shall receive the schedule regularly. Devices receive the schedule one at a time or in a group. There should not be a delay of more than a few minutes. The devices are usually online. There could be a few scenarios where the connection is intermittent.

0

You can make use of AWS IoT device shadows to achieve what you are trying to do. If the app sends a configuration to a device that is offline, you can read the desired state of the device from the MQTT topic, view the delta between the desired and actual states, and update the state. There is an example here that you can try.

AWS
Isaac
answered 4 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