Send data from cloud to aws iot thing

2019-08-17 03:58发布

问题:

I am trying to a reliable way to send data from aws lambda function to a aws iot thing. The thing is basically a raspberry pi which is located remotely.

I have seen aws iot topics, but they don't seem to be reliable for my use case.

So far I have found the following functionalities about topics

Topics:

  • Topics are asynchronous.
  • When something is added to topic all and only currently listening devices will receive the update.
  • There is no queueing.
  • No delivery notification for the publisher.

In my use case I need to know if the delivery is made(retry otherwise), but if the device is not connected, the topic might lose the write.

Is there a way to solve this issue. Any help is much appreciated.

Edit:

What I am trying to do is send data about a user who can interact with the device from a remote server.

To over come the limitation of topic for my use case I came up with the following solution.

Step 1: Dynamo -> lambda1 -> sqs -> topic1 -> remote device

Step 2: remote device(after getting the data) -> topic2(acknowledgement) -> lambda2(delete message from sqs) -> Update DB about action

Does this solution seem reliable?

Edit 2:

Basically I am trying to send all the updates made to a DB to IOT Thing.

Based on answer from @dvd86,

Step 1: DynamoStream -> lambda1 -> sqs -> Thing shadow desired

Step 2: shadow reported updated -> lambda2(delete message from sqs) -> Update DB about action

回答1:

Your solution is not recommend because there is a lot of troubles that you are going to have to implement yourself that Aws iot already implemented.

Your answer for this scenario is using AWS IoT shadow: https://docs.aws.amazon.com/iot/latest/developerguide/using-thing-shadows.html