0

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.

ashwal
  • 19
  • 3
  • Hi @Ram Grandhi , thanks for ur help. I have tried 1 st thing, that is Good. But when I tried 2nd thing you have mentioned, I didn't get any directory named as "user' at /greengrass/ggc/var/log/ in my pi3. So now, what should be the issue with it. Should I try again from the beginning..? – ashwal Jan 01 '20 at 11:08
  • Hi @ashwal - Couple of things to check then. a. check if lambdas are indeed OTA'ed to your device locally by listing under /greengrass/ggc/deployment/lambda/* . b. if you see your lambdas in there, then I doubt your greengrass Grouplevel settings in AWS Console is using CloudWatch Logs Only mechanism. Hence, you won't see anything created (like /user directory) on the device. c. Go to AWS console -> GGGroup --> Settings -> Enable local system logs for system & user lambdas. d. Finally, click on ''Deploy'' from AWS console. Let me know how it goes.. cheers, ram – Ram Grandhi Jan 05 '20 at 07:24

2 Answers2

1

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.

0

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

Ram Grandhi
  • 901
  • 7
  • 9