AWS IoT Greengrass software is readily available on PHYTEC's phyBOARD-Zeta to enable cloud capabilities.  Greengrass allows data to be collected, analyzed, and acted upon at the source, while using the cloud for storage, analytics, and securely connecting to other devices.  Code can be deployed to individual SOMs or to device fleets through the cloud in AWS Lambda functions via Greengrass, facilitating the process of remote software updates and certificate rotation.  This quick-start will demonstrate how to deploy a simple "Hello World" Lambda function to the phyBOARD-Zeta and view the results in the AWS IoT Console. 

This tutorial is based off of "Getting Started with AWS IoT Greengrass" in the AWS IoT Greengrass Developer Guide, which can be found here:

1Create or log into your AWS account. Here is the current link to the console sign-in:


Connect the phyBoard-Zeta to the Internet. If this is the first time booting the board you will need to bring up the ethernet interfaces:

  • If using ethernet, power on the phyBOARD-Zeta, boot into Linux and log in
  • Run the listed commands to set up the Internet
    • (modify to the ethernet port that you're using)
ifconfig eth0 up
udhcpc -i eth0

# To prevent commands from wrapping over themselves: 
shopt -s checkwinsize && resize

Run the following commands to make sure everything is correctly configured for Greengrass:

If there are missing dependencies beyond Node v6.10 and Java 8, then the Greengrass option was not correctly configured in the image build. Try rebuilding the image and then proceed to the next step when all of the required dependencies are configured and installed.

mkdir ~/Downloads && cd ~/Downloads
cd greengrass-dependency-checker-GGCv1.7.1
sudo modprobe configs
chmod +700 check_ggc_dependencies
sudo ./check_ggc_dependencies | more


Create a Greengrass group.

  • On the AWS IoT console, click "Greengrass" on the left
  • Click "Create a group".

  • Select "use easy creation" to automatically generate certificates for the phyBoard-Zeta to connect to AWS Greengrass
  • Select "provision a core" in the IoT Registry

6Name your group in the "Group Name" box and click "Next".

7Use the name provided for the core, and click "Next".

8Click "Create Group and Core" to finalize creating the Greengrass Group (AWS-side resources for the your set of devices).

9On the confirmation page, download the certificate package. No need to download the software configuration package. Click "Finish".

10Transfer the certificate package from your computer to the i.MX7.

from Windows:

cd <insert path-to-downloaded-files>
pscp -scp <insert hash>-setup.tar.gz root@<insert IP-address>:~/Downloads

from macOS/Unix

cd <insert path-to-downloaded-files>
sudo scp <insert hash>-setup.tar.gz root@<insert IP-address>:~/Downloads

See this link for more details regarding the transfer of files: Copying Files to the Device

11Return to the i.MX7. Decompress the certificate file and copy the root CA to the device. Check that the isn't empty.
cd ~/Downloads
tar -xzvf <insert hash-setup>.tar.gz -C /greengrass
cd /greengrass/certs/
wget -O

# Check that the last command was successful
12Start AWS GG daemon on the i.MX7 and check that the daemon is running (there will be a root entry for /greengrass/ggc/packages/1.7.0/bin/daemon).
cd /greengrass/ggc/core
sudo ./greengrassd start

# Check that daemon is running
ps aux | grep -E 'greengrass.*daemon'
13Create the "Hello World" Lambda function. Return to the AWS IoT Core Console and select "Software"


Download the SDK:

  • Scroll down to "SDKs" and under "AWS IoT Greengrass Core SDK", select "View all SDKs"
  • Click "v1.3.0" under "Python 2.7" to download the AWS IoT Greengrass Core SDK for Python

15Decompress the "greengrass-core-python-sdk-1.3.0.tar.gz" downloaded from the last step.

Windows: install 7-Zip, right click on file, and choose "7-Zip" → "Open archive" → drag folder to desired location (image shows contents of folder)

macOS: double click the file, open "sdk", and then unzip

Unix: use the command line:

tar -xzf <path to greengrass-core-python-sdk-1.3.0.tar.gz>/greengrass-core-python-sdk-1.3.0.tar.gz
cd aws_greengrass_core_sdk/sdk
sudo unzip

16Now actually create the Lambda function. Move the greengrasssdk folder into the "examples"→ "HelloWorld" folder and zip them together.

Unix (including macOS):

sudo zip -r greengrasssdk


17Package the Lambda. On the group page in the AWS IoT Console, select "Lambda" → "Add Lambda" → "Create new Lambda".

18In the AWS Lambda Console, fill out the "Author from Scratch" box like in the following screenshot, and then select "Create function" on the bottom:

  • Upload the Lambda function deployment package created in Step 17 (could be named something different)
  • Fill out the fields like in the image
    • Code entry type: .zip file
    • Runtime: Python 2.7
    • Handler: greengrassHelloWorld.function_handler
  • Save the function (upper right hand corner)


Publish the Lambda function:

  • "Actions" → "Publish new version"
  • In "Version Description" , enter anything (e.g. "First version" and then "Publish"


Create an alias/ nickname for the Lambda function:

  • "Actions" → "Create alias"
  • Enter a name (e.g. "GG_HelloWorld")
  • Set version to "1"
  • Click "Create"


Add the Lambda to your GG group to deploy:

  • Return to the group created in the AWS IoT Console
  • Choose "Use existing Lambda"
  • Select the Lambda created in the last step


Edit the Lambda's configuration for the group:

  • For version, choose "Alias: GG_HelloWorld", or whatever alias was chosen for the Lambda
  • Set the settings as the ones in the lower image
  • Choose "Update"


Create a subscription to the MQTT topic:

  • Choose "Subscriptions"
  • For "Select a source", choose "Select"
  • Choose the "Lambdas" tab and then "Greengrass_HelloWorld"
  • For "Select a target" choose "Select"
  • Choose the "Services" tab, and then choose "IoT Cloud", "Next"
  • In the "Topic filter" section, type "hello/world", and then hit "Next"


Deploy the Lambda:

  • Select "Actions" → "Deploy"
    • The first time may take awhile
    • If deployment takes 5 minutes or more, try:
      • "Actions" → "Reset Deployments"
      • Check the box that says "Do you want to force the reset"
      • Click "Reset deployment"
      • Redeploy like before
  • The "Deployments" tab will contain a log of successes/failures, also indicated by the colored dot in the heading
  • Choose "Automatic detection" in the next window


See the MQTT messages:

  • In the side bar of the AWS IoT Core console, choose "Test"
  • Choose "Subscribe to topic" in the left-hand column and set the settings to look like the lower image
  • Now click "Subscribe to topic" to the right of the "Subscription Topic" field


There should now be a "Hello world!" MQTT message appearing in the AWS IoT test console every five or so seconds!