Send IOT core device MQTT fields as IOT core / tracker, "user-defined key-values pairs with each position update."

0

I'm using a custom LORA device which publishes via MQTT to IOT core. In IOT core I have a message routing rule (and SQL) that pushes the location info in the received device MQTT to an AWS tracker resource. In the webApp frontend I use, GetDevicePositionHistoryCommand to extract the positions. This is all working. Now I'd like to pass the pass the RSSI of the LORA device along with each position update. This data is already present in the MQTT from the device alongside the lat/lon being passed to the tracker. According to this AWS Location ServicesAmazon Location Service adds metadata help customers reduce costs article from AWS, it should be possible to include "...three user-defined key-values pairs with each position update." I have fairly exhaustively searched and have found ABSOLUTELY NO EXAMPLES of how to do this! Can anyone offer any guidance? Thanks in advance for any help!

2 Answers
0
  • Hi and thanks very much for your quick response! Unfortunately, I don't think this answers my question. Your example shows how to SET these metadata using BatchUpdateDevicePositionCommand(), but in my application, the position updates are done by a rule in IOT core. I'm guessing I might be able to use a "lamda action" instead of the "location action" in my IOT core rule. However, this only associates the metadata with the tracker. I still don't see (and your example doesn't appear to show) how to actually access that metadata along with the position data; i.e., the list of positions retrieved by GetDevicePositionHistoryCommand() DO NOT contain any metadata, so how exactly does one access the metadata?

0

Hello there. At this time the IoT Core Rule for Amazon Location Service does not support passing Metadata to Amazon Location Service trackers. Currently, only the position data is passed through. If you need to pass these through, you will need to make use of a Lambda Rule: https://docs.aws.amazon.com/location/latest/developerguide/tracking-using-mqtt-with-lambda.html. Then, using the https://docs.aws.amazon.com/location/latest/APIReference/API_GetDevicePositionHistory.html API, you can access this position history along with your Position Properties.

I hope this helps and I've passed on your feedback to our IoT Core team

AWS
awszac
answered a year 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