- Mais recentes
- Mais votos
- Mais comentários
Hi. It looks like the pair of messages come 10s apart, but how often is a pair sent by each device? How big is your fleet? Do you plan to use shadows already?
Sometimes if can be handy, from the LoRaWAN Lambda decoder, to store the device state in a Thing shadow. Especially if you want to use fleet indexing with your fleet at all. However, you have to be wary of shadow costs and limits. Especially if you have a large fleet and/or frequent uplinks.
This is the long way of saying that I think shadows could be a good solution. Since the uplinks are unconfirmed, you will frequently face the situation of missing one of the two messages in the pair. So it's good to manage reconstitution in some per-device way. And since it's only 2 messages, a queue is probably not the best fit. From the Lambda, you can identify if it's the first or second message. If it's the first, store it in the shadow. If it's the second, read the shadow, compare timestamps to make sure you have a pair, and combine the messages. Possibly store the combined result back in the shadow, as well as send it on to Timestream.
- https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/iot-data.html#IoTDataPlane.Client.update_thing_shadow
- https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/iot-data.html#IoTDataPlane.Client.get_thing_shadow
With the data in the shadow (even if just the first message), you could perform fleet indexing queries such as "give me all the devices with battery below 3V".
If you are not interested in shadows or fleet indexing, I would suggest DynamoDB and use it similarly.
Conteúdo relevante
- AWS OFICIALAtualizada há 3 meses
- AWS OFICIALAtualizada há 2 anos
- AWS OFICIALAtualizada há 7 meses
Thanks for your reply! I have relatively few sensors (less than 20) and they report data every 15 minutes. For now I'll work with DynamoDB, but I'll check device shadows in the future.