Configuring AWS Greengrass Core

After we have published AWS Lambda, we can consume this Lambda function into AWS Greengrass. Firstly, we need to prepare our resources for the local AWS Greengrass Core.

Follow these steps to configure local resources on AWS Greengrass Core:

  1. Open AWS Greengrass Group and then add new local resources from the Resources menu. Fill in the resource name; for instance, GPIO. Select the Device option for Local resource type with the/dev/gpiomem path, as shown in the following screenshot:

Save this resource. 

  1. Now, create Lambda on AWS Greengrass Group from the existing Lambda that we have already created. After this Lambda is created, you can add our GPIO resource. You can enable the Read access to /sys directory option to ensure our Lambda can access local resources.
  2. You should also add a new subscription for our local Lambda. Set the source from our local Lambda and target for the IoT Cloud. You can set any topic, for instance, pi/blinking.
  3. Before deploying to AWS Greengrass Core, you should configure your Raspberry Pi 3. Regarding the security issue, you should configure ggc_user as a member of the GPIO group. Please execute the following command on the Raspberry Pi Terminal in order to configure ggc_user as the member of gpio:
$ sudo adduser ggc_user gpio

If not configured, you will probably get problems, as shown in the following screenshot:

  1. Reboot your Raspberry Pi 3 and then start the Greengrass service after the reboot is completed.

Now you can deploy AWS Greengrass into the AWS Greengrass Core machine.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.179.85