Publish and subscribe data from the edge device to your AWS IoT Greengrass platform and vice-versa.
To accomplish this task you need to follow the steps in this article:
- Create AWS IoT Greengrass group
- Install and Start AWS IoT Greengrass on the Edge Device
- Start AWS IoT Greengrass on the Edge Device
What you will need
Make sure that you have prepared the following points:
- Your TeamViewer credentials.
- Your AWS Greengrass credentials.
- The edge device is set up with a TeamViewer IoT Agent and TeamViewer Edge Management is enabled.
- The edge device is connected to the internet.
- File Transfer is enabled (see Enable File Transfer).
- Access the Edge Device via Remote Terminal.
Create AWS IoT Greengrass group
An AWS IoT Greengrass group contains settings and other information about its components, such as devices, Lambda functions, and connectors. A group defines how its components can interact with each other.
- On your PC sign in to AWS Management Console and open the AWS IoT console.
- From the left menu click Greengrass.
- On the Welcome to AWS IoT Greengrass page, click Create a Group.
- To allow the console to create or configure the Greengrass service role for you click Grant permission.
- On the Set up your Greengrass group page, select Use default creation to create a group.
- Enter a name for your group (for example,
MyFirstGroup), and then click Next.
- On the Review Group creation page, select Create Group and Core.
- Download your core’s security resources and configuration file. On the confirmation page, under Download and store your Core’s security resources, choose Download these resources as a tar.gz.
tar.gzfile starts with a 10-digit hash that’s also used for the certificate and key file names.
- After the download click Finish.
Install AWS IoT Greengrass on the Edge Device
You need the security resources which you have downloaded when creating an AWS IoT Greengrass group.
- Download the AWS IoT Greengrass Core software installation package. select the CPU architecture and distribution (and operating system, if necessary) that best describe your core device.
- For Raspberry Pi Model B or B+, download the Armv7l for Raspbian package.
- For an Amazon EC2 instance, download the x86_64 for Linux package.
- Use Transfer Files to transfer the AWS IoT Greengrass Core software (
greengrass-) and the security resources
YYYYYY-setup.tar.gzto the user folder on the edge device (default
- Access the edge device remotely (Access the Edge Device via Remote Terminal).
- Navigate to the user folder on the edge device where you transferred the files.
- To decompress the files type in the following commands and press enter:
sudo tar -xzvf greengrass-OS-architecture-1.10.0.tar.gz -C
sudo tar -xzvf hash-setup.tar.gz -C /greengrass
- To download the ATS root CA certificate type in the following command and press enter:
cd /greengrass/certs/ sudo wget -O root.ca.pem https://www.amazontrust.com/repository/AmazonRootCA1.pem
- Start AWS IoT Greengrass on your edge device type in the following commands and press enter:
sudo ./greengrassd start
- When the message “Greengrass successfully started” is displayed take a note of the PID-number.
- To check if the AWS IoT Greengrass daemon is functioning type in the following command and press enter. Replace
PIDwith the PID-number from the previous step.
ps aux | grep PID