How to fetch aws iot data in lambda function

Home Forum IoT Software Platforms AWS IoT Development Platform How to fetch aws iot data in lambda function

This topic contains 1 reply, has 2 voices, and was last updated by  Jessica 1 year, 8 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #951

    Hamilton
    Participant

    Hello,
    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.

    #971

    Jessica
    Participant

    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” }

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.