Difference between revisions of "IoTGateway/AWS/Greengrass"

From ESS-WIKI
Jump to: navigation, search
Line 1: Line 1:
 
This article is written based on AWS (Amazon Web Services) Greengrass 1.0.0, and the target device is Advantech RSB-4760 ([[IoTGateway/BSP/Linux#APQ8016|Qualcomm APQ8016 platform]]).
 
This article is written based on AWS (Amazon Web Services) Greengrass 1.0.0, and the target device is Advantech RSB-4760 ([[IoTGateway/BSP/Linux#APQ8016|Qualcomm APQ8016 platform]]).
  
== Set Up Environment ==
+
== <font color="#0070c0">Set Up Environment</font> ==
  
 
This section is referred to the [http://docs.aws.amazon.com/greengrass/latest/developerguide/prepare-annapurna.html AWS Greengrass document] and [http://docs.aws.amazon.com/cli/latest/userguide/awscli-install-linux.html AWS CLI document].
 
This section is referred to the [http://docs.aws.amazon.com/greengrass/latest/developerguide/prepare-annapurna.html AWS Greengrass document] and [http://docs.aws.amazon.com/cli/latest/userguide/awscli-install-linux.html AWS CLI document].
  
=== Debian 9 (Stretch) ===
+
=== <font color="#0070c0">Debian 9 (Stretch)</font> ===
  
 
1. Add ggc_user and ggc_group using the following commands:
 
1. Add ggc_user and ggc_group using the following commands:
Line 44: Line 44:
 
  aws --version
 
  aws --version
  
== Set Up AWS Greengrass ==
+
== <font color="#0070c0">Set Up AWS Greengrass</font> ==
  
 
This section is referred to this [http://docs.aws.amazon.com/greengrass/latest/developerguide/gg-setup.html AWS Greengrass document].
 
This section is referred to this [http://docs.aws.amazon.com/greengrass/latest/developerguide/gg-setup.html AWS Greengrass document].
  
=== Download the AWS Greengrass Core Software ===
+
=== <font color="#0070c0">Download the AWS Greengrass Core Software</font> ===
  
 
Sign in to the [https://console.aws.amazon.com AWS Management Console] and navigate to the '''AWS IoT''' console. Then, download the [https://us-west-2.console.aws.amazon.com/iotv2/home?region=us-west-2#/software AWS Greengrass Core Software] from '''Software''' page.
 
Sign in to the [https://console.aws.amazon.com AWS Management Console] and navigate to the '''AWS IoT''' console. Then, download the [https://us-west-2.console.aws.amazon.com/iotv2/home?region=us-west-2#/software AWS Greengrass Core Software] from '''Software''' page.
Line 63: Line 63:
 
'''PS:''' You are also able to download this AWS Greengrass core software in the next step.
 
'''PS:''' You are also able to download this AWS Greengrass core software in the next step.
  
=== Create an AWS Greengrass Group ===
+
=== <font color="#0070c0">Create an AWS Greengrass Group</font> ===
  
 
Open the AWS IoT console and, in the navigation pane, choose '''Greengrass'''.&nbsp;On the&nbsp;'''Define a Greengrass group'''&nbsp;tile, choose&nbsp;'''Get Started'''.&nbsp;
 
Open the AWS IoT console and, in the navigation pane, choose '''Greengrass'''.&nbsp;On the&nbsp;'''Define a Greengrass group'''&nbsp;tile, choose&nbsp;'''Get Started'''.&nbsp;
Line 83: Line 83:
 
:
 
:
  
*'''cloud.pem.crt'''
+
*'''''cloud.pem.crt'''''
  
 
::The Core certificate downloaded from the console,e.g. ce69fc71e9.cert.pem.
 
::The Core certificate downloaded from the console,e.g. ce69fc71e9.cert.pem.
Line 89: Line 89:
 
:
 
:
  
*'''cloud.pem.key'''
+
*'''''cloud.pem.key'''''
  
 
::The private key downloaded from the console, e.g. ce69fc71e9.private.key.
 
::The private key downloaded from the console, e.g. ce69fc71e9.private.key.
Line 95: Line 95:
 
:
 
:
  
*'''root-ca.pem'''
+
*'''''root-ca.pem'''''
  
 
::The AWS IoT root CA certificate from Symantec.
 
::The AWS IoT root CA certificate from Symantec.
  
=== Create an AWS Greengrass Core Device in the Cloud ===
+
=== <font color="#0070c0">Create an AWS Greengrass Core Device in the Cloud</font> ===
  
=== Provisioning an AWS Greengrass Core ===
+
=== <font color="#0070c0">Provisioning an AWS Greengrass Core</font> ===
  
=== Get Connected to AWS ===
+
=== <font color="#0070c0">Get Connected to AWS</font> ===

Revision as of 11:09, 5 September 2017

This article is written based on AWS (Amazon Web Services) Greengrass 1.0.0, and the target device is Advantech RSB-4760 (Qualcomm APQ8016 platform).

Set Up Environment

This section is referred to the AWS Greengrass document and AWS CLI document.

Debian 9 (Stretch)

1. Add ggc_user and ggc_group using the following commands:

sudo useradd ggc_user
sudo groupadd ggc_group

2. Install missing dependencies using the following commands:

sudo apt-get update
sudo apt-get install sqlite3

3. Set up cgroups

wget https://raw.githubusercontent.com/tianon/cgroupfs-mount/master/cgroupfs-mount
chmod 777 cgroupfs-mount
sudo bash ./cgroupfs-mount

4. Install Pip

curl -O https://bootstrap.pypa.io/get-pip.py
python get-pip.py --user  

# Add an export command to your profile script, e.g. ~/.profile
export PATH=~/.local/bin:$PATH

# Load the profile into your current session
source ~/.profile

# Verify that pip is installed correctly
pip --version

5. Installing the AWS CLI with Pip

pip install awscli --upgrade --user

# Verify that the AWS CLI installed correctly
aws --version

Set Up AWS Greengrass

This section is referred to this AWS Greengrass document.

Download the AWS Greengrass Core Software

Sign in to the AWS Management Console and navigate to the AWS IoT console. Then, download the AWS Greengrass Core Software from Software page.

Copy the tar file into target device, and use the following command to extract the tar file:

sudo tar -zxvf greengrass-platform-version.tar.gz -C /
Where platform is either:
  • linux-armv7l
  • linux-x86-64
  • linux-aarch64

PS: You are also able to download this AWS Greengrass core software in the next step.

Create an AWS Greengrass Group

Open the AWS IoT console and, in the navigation pane, choose Greengrass. On the Define a Greengrass group tile, choose Get Started

Aws-gg-1.png

On the Set up your Greengrass Group page, choose Use easy creation, and then follow the instructions. Finally, you can see the page as below.

Download the public/private key pairs & certificate, and keep them safe. When the download has completed choose Finish.

Aws-gg-2.png

Install certificates on your Core device

1. Download the AWS IoT root CA certificate from Verisign.

2. Copy the Core's private key, certificate, and the AWS IoT root CA certificate into the /greengrass/configuration/certs directory of your device using the following names:

  • cloud.pem.crt
The Core certificate downloaded from the console,e.g. ce69fc71e9.cert.pem.
  • cloud.pem.key
The private key downloaded from the console, e.g. ce69fc71e9.private.key.
  • root-ca.pem
The AWS IoT root CA certificate from Symantec.

Create an AWS Greengrass Core Device in the Cloud

Provisioning an AWS Greengrass Core

Get Connected to AWS