Skip to content

Trigger on Absence of Information from AWS IoT

0

My greengrass core device runs a component that sends MQTT messages at set intervals. These messages go to an IoT Rule, then on to a sitewise dashboard.

Is there an easy way to trigger on the absence of the message for a particular time ? E.g. no message has been sent for 10 minutes, send an event/trigger some action.

I understand that I could send the messages to a dynamos DB/some persistent storage, then trigger a lambda at certain intervals to check the last timestamp.

But is there a natively supported IoT way to check that, between alarms/metrics ? It would be nice to be able to do it all within AWS IoT.

2 Answers
0
Accepted Answer

Yes, you can use AWS IoT to check for the absence of messages for a particular time. One way to do this is by using IoT Rules and IoT Events.

First, you can create an IoT Rule that listens for the MQTT messages from your Greengrass core device. In the rule, you can specify a condition that checks the timestamp of the message and compares it to the current time.

Next, you can use the IoT Events service to detect when the condition specified in the IoT Rule is not met. To do this, you can create an IoT Event detector that checks the output of the IoT Rule and triggers an action when the rule's output is "false" or "absent".

You can also use the IoT Events service to specify a "Missing message" detector that checks whether a message has not been received for a certain period of time. You can set the detector's parameters to detect when the message is missing for a specific time, e.g. 10 minutes, and then trigger an action when this condition is met.

Finally, you can use the IoT Action service to trigger an action when the detector finds a missing message. This action can be a Lambda function, an SNS topic, or a SQS queue, among other things.

By using this approach, you can set up an IoT-native solution that checks for the absence of messages and triggers an action when this condition is met, all within the AWS IoT service.

answered 3 years ago
0

To check if a message has not been received for a certain time you can use IoT Events. You create a detector that on reception of a message starts/re-starts a timer. When the timer runs out you trigger the notification.

This detector model is part of the templates provided by IoT Events, and is called Device HeartBeat. Select this link to Create a new detector model, then select Browse and select template and Device HeartBeat.

Note that you can either reuse the Input created by the template and adapt your message to it (generating the fields value and heartbeat_id) or create a new input matching your message and modify the detector accordingly.

AWS
EXPERT
answered 3 years 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.