Skip to content

Instantly share code, notes, and snippets.

@dave-malone
Last active March 6, 2022 19:23
Show Gist options
  • Save dave-malone/fd434016d019feb1f93b60ce56652179 to your computer and use it in GitHub Desktop.
Save dave-malone/fd434016d019feb1f93b60ce56652179 to your computer and use it in GitHub Desktop.
AWS IoT Greengrass Core running on RaspberryPi

Setup a RaspberryPi as an AWS IoT Greengrass Core

These instructions are derived directly from https://docs.aws.amazon.com/freertos/latest/userguide/getting_started_espressif.html

Install and setup Raspian

Flash Raspian to your SD card using Etcher.

Connect to the RaspberryPi using a monitor, keyboard and mouse to perform the initial setup.

Run sudo raspi-config

Configure Networking options to enable Wifi access, and then enable SSH in Interfacing Options.

Change the default pi user password as well for security reasons.

Configure AWS Greengrass on AWS IoT

Follow these instructions: https://docs.aws.amazon.com/greengrass/latest/developerguide/gg-config.html

Copy Greengrass files onto your RaspberryPi

These files will be available on your machine after you have completed the previous step.

cd path-to-downloaded-files
raspberrypi=192.168.1.251
scp greengrass-*-1.5.0.tar.gz pi@${raspberrypi}:/home/pi
scp *-setup.tar.gz pi@${raspberrypi}:/home/pi

Setup Greengrass

SSH into your RasbperryPi and untar the Greengrass Core software and your Core setup files:

cd /home/pi
sudo tar -xzvf greengrass-*-1.5.0.tar.gz -C /
sudo tar -xzvf *-setup.tar.gz -C /greengrass
cd /greengrass/certs/
sudo wget -O root.ca.pem http://www.symantec.com/content/en/us/enterprise/verisign/roots/VeriSign-Class%203-Public-Primary-Certification-Authority-G5.pem
cd /greengrass/ggc/core/
sudo ./greengrassd start

Update AWS IoT Greengrass Core Settings

In order for your IoT Things to know how to connect to your Greengrass Core, you must make the following changes:

IoT Core > Greengrass > Groups > YourGreengrassGroup > Settings

Under the Core connectivity information section, ensure that "Manually manage connection information" is selected.

IoT Core > Greengrass > Groups > YourGreengrassGroup > Cores > YourGreengrassGroup_Core > Connectivity

Core endpoints:

  • Endpoint: Your RaspberryPi's IP address
  • Port: 8883
  • Optional connection information: leave blank

Also, ensure that there are no IPv6 Core endpoints, or loopback address endpoints registered. If there are, remove them.

Troubleshooting

Greengrass logs can be found in /greengrass/ggc/var/log.

The connection manager logs are useful for troubleshooting connectivity issues with devices trying to connect to the RaspberryPi running as the Greengrass Core: tail -f /greengrass/ggc/var/log/system/connection_manager.log

Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment