0
votes

I tried sending data from raspberry to aws iot and now i am trying to fetch this data in lambda function. How can we fetch aws iot data in lambda function ?

I tried creating the rule to invoke lambda function but it is just calling a function, it is not sending the data of aws iot to it.

2

2 Answers

0
votes

Setting up an AWS IoT rule to invoke Lambda function is correct.

Within the lambda function, you can access the MQTT payload. Example if you are using nodejs, you would do:

exports.handler = function(event, context, callback){
    console.log("variable1: ", event.var1);
}

Your message payload should be something like { "var1": "hello" }

0
votes

In the rule, set the query and filter the data you want into your lambda:

SELECT color AS rgb FROM 'a/b' WHERE temperature > 50