How to verify that AWS lambda function is running on raspberry pi 3 for Greengrass?

700 views Asked by At

I am preferring official AWS doc for AWS Greengrass setup in RaspberryPi3. I have already completed

Module 1: Environment Setup for Greengrass

Module 2: Installing the AWS IoT Greengrass Core Software

When it comes to

Module 3 (Part 1): Lambda Functions on AWS IoT Greengrass , I got stucked in "Verify the Lambda Function Is Running on the Core Device".

Because I can't see "hello world! Sent from greengrass core running on plateform: Linux - 4.19.86-v7+-armv7l-with-debian9.0" at MQTT client dashboard by subscribing to the topic "hello/world".

I have already deployed such deployment successfully for my greengrass group and provided subscriptions and Lambda functions as explained in AWS docs. I have also started Daemon on RaspberryPi3 by the command

sudo ./greengrassd start

at path location

/greengrass/ggc/core

I have also checked GGConnManager.log file present at path location

/greengrass/ggc/var/log/system

that shows such last log like,

[INFO]-MQTT server started.

But still didn't get any expected result at MQTT client dashboard.

Am I missing something ? How should I publish or subscribe to such topic for this task ?

OR Should I try any other method to verify this AWS lambda function ? Please help.

2

There are 2 answers

0
Ram Grandhi On

Here are a few things to try out.

  1. Go to AWS Console -> GGGroup -> -> Settings -> Logs (make sure you select Local Logs for User Lambdas).

  2. If you have done the rest correct, you should see lambda logs under /greengrass/ggc/var/log/user///*.log

  3. For the sake of testing, you may want to add some console logs to your Lambdas (on module load, not on handler invocation).

cheers, ram

0
Michael Dombrowski On

If you don't have a user directory under the log directory, then that means that your user lambda function never executed. You probably need to set the function to be a pinned lambda, see https://docs.aws.amazon.com/greengrass/latest/developerguide/config-lambda.html section 7 for how to set that.