AWS IoT Greengrass - Jetson Nano
Tags: aws, iot, beginners, greengrass
Published: 2020-06-05 14:33:55

---
title: AWS IoT Greengrass - Jetson Nano
published: true
description: AWS IoT Greengrass setup for the NVIDIA Jetson Nano Developer Kit. In this guide we take you through the setup process required to flash a new board and connect it to AWS IoT Greengrass.
canonical_url: https://devopstar.com/bricks/aws-iot-greengrass-jetson-nano
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/hlcqimlfm5vcgfw3hw3l.jpg
tags: aws, iot, beginner, greengrass
series: Bricks
---

> Please reach out to me on [Twitter @nathangloverAUS](https://twitter.com/nathangloverAUS) if you have follow up questions!

*This post was originally written on [DevOpStar](https://devopstar.com/)*. Check it out [here](https://devopstar.com/bricks/aws-iot-greengrass-jetson-nano)

Welcome to the **AWS IoT Greengrass - Jetson Nano** brick. In this overview we'll go through setting up an NVIDIA Jetson Nano with AWS IoT Greengrass. The specific parts that we will cover can be seen below:

* Install NVIDIA Jetson Nano Image
* Create Greengrass Group
* Install AWS IoT Greengrass on Jetson Nano
* Deploy Greengrass Group

### Prerequisites

* [AWS Account](https://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/) (Free Tier is acceptable)
* [Etcher](https://www.balena.io/etcher/) - Used for flashing SD card images
* [NVIDIA Jetson Nano Developer Kit](https://developer.nvidia.com/embedded/jetson-nano-developer-kit), although the second half of this guide will work for any Linux operating system.
  * 16GB+ microSD card - Anything smaller and you'll have trouble with the uncompressed Jetson Nano image
  * Power, Ethernet, Mouse, Keyboard & HDMI cable for hooking up the Jetson Nano

#### Install NVIDIA Jetson Nano Image

Download the Jetson Nano SD card image from the [resources website](https://developer.nvidia.com/jetson-nano-sd-card-image). The image is ~6GB compressed so be aware that this can take a while to download.

![Jetson Nano SD card image](https://dev-to-uploads.s3.amazonaws.com/i/pxgk6jii9nf5duey3vwu.png)

Open up Etcher and complete the following steps:

1. Select the `.zip` file you just downloaded
2. Select the microSD card that you want to flash the image to
3. Click **Flash!**

![Jetson Nano flashing image with Etcher](https://dev-to-uploads.s3.amazonaws.com/i/94iq9rpcz9rasz04t1ic.png)

> **Note**: *this flashing process can take quite a while (10-15 minutes)*

Once the microSD card has been flashed, remove it from your computer and insert it into the Jetson Nano.

> **Note**: *It is worth plugging in an ethernet cable at this stage too if you would like to do a system update on first boot.*

Proceed to power on the board and run through the setup process using the baked in wizard. The only screen where you should have to focus your time is when you name the device and pick a username/password

![Jetson Nano system setup user/password](https://dev-to-uploads.s3.amazonaws.com/i/u3rit37l0j81hadoce4o.png)

#### Create Greengrass Group

In this set of steps we will begin defining out Greengrass group and export a set of certificates that can be used for your Jetson Nano to talk to AWS IoT

To begin with, navigate to the [AWS IoT portal](https://console.aws.amazon.com/iot/home?region=us-east-1#/greengrassIntro) and open up the Greengrass option on the left. From here we are going to run through the **Create a Group** guided setup by clicking the button

![AWS IoT Greengrass create a group](https://dev-to-uploads.s3.amazonaws.com/i/xsbcyuvxdl0l2w9typ28.png)

Greeted with two boxes, you are asked which type of setup you would like to run through. For the purpose of this getting started guide, we will be selecting **Use default creation**

![AWS IoT Greengrass default group creation](https://dev-to-uploads.s3.amazonaws.com/i/clg31y2xjw1roisjoixu.png)

Time to name the Greengrass group, this name needs to be unique within the region of your account. In this guide we've gone with `demo-group`.

![AWS IoT Greengrass demo group naming](https://dev-to-uploads.s3.amazonaws.com/i/r88kfxwyvta1g2ceoyib.png)

The Core function is used by your Greengrass device to communicate with AWS IoT and other IoT devices on your local network. For this guide we will go with the name that is provided to us by default `demo-group_Core`.

![AWS IoT Greengrass name Greengrass group core](https://dev-to-uploads.s3.amazonaws.com/i/93dj6jfh0kf70u0qb470.png)

Finally, you will be prompted to understand that the creation task with perform a number of actions for you under the hood. Click **Create Group and Core** to have all the actions taken.

> **Note**: *If you are interested in learning how you can deploy this resources with AWS CloudFormation, check out [t04glovern/aws-greengrass-cfn](https://github.com/t04glovern/aws-greengrass-cfn/blob/master/.blog/README.md).*

![AWS IoT Greengrass create group and core](https://dev-to-uploads.s3.amazonaws.com/i/x9u9hb1cm3z1j85yrmvv.png)

Time to celebrate as you have created your Greengrass group and core! Simply download the `tar.gz` files and keep them somewhere safe for the next steps.

![AWS IoT Greengrass download resources](https://dev-to-uploads.s3.amazonaws.com/i/jx869kcuv64eh9wvmg1k.png)

Click **Finish** to complete this section. In the next section we will take our Greengrass resources and install them on our Jetson Nano.

#### Install AWS IoT Greengrass on Jetson Nano

Jumping over to your Jetson Nano device, you will need some way to work on the system. You can either:

* SSH to the Jetson Nano: `ssh <username>@<ipaddress>`
* Plug in keyboard/mouse and work directly

The first thing you will need to do is copy the `tar.gz` files from the previous steps over. This can either be accomplished **by a USB**, or **SCP** (if you feel confident with the command line)

An example of using SCP to copy the file across:

```bash
scp xxxxxxxxx-setup.tar.gz <username>@<ipaddress>:/home/<username>

# Example of my command
scp 551aca43d9-setup.tar.gz devopstar@devopstar.local:/home/devopstar
```

With the files onboard, its time to install Greengrass on the Jetson Nano. To do this run the following commands in order.

```bash
# create user ggc_user and group ggc_group
sudo adduser --system ggc_user
sudo addgroup --system ggc_group

# download the Greengrass core package
# this is version 1.10.1 at time of writing
wget https://d1onfpft10uf5o.cloudfront.net/greengrass-core/downloads/1.10.1/greengrass-linux-aarch64-1.10.1.tar.gz

# extract the greengrass files to root
sudo tar -xzvf greengrass-linux-aarch64-1.10.1.tar.gz -C /

# install the rootCA
sudo wget -O /greengrass/certs/root.ca.pem https://www.amazontrust.com/repository/AmazonRootCA1.pem
```

Next we need to extract those Greengrass configuration files we generated in the previous steps. To do this extract the `tar.gz` (make sure to change the filename based on your file)

```bash
sudo tar -xzvf <certificate_id>-setup.tar.gz -C /greengrass

# Example of my command
sudo tar -xzvf 551aca43d9-setup.tar.gz -C /greengrass
```

**Optionally** you can also run the following commands to install some extra dependencies

```bash
sudo apt install openjdk-8-jdk
```

We're now setup and ready to start the Greengrass core service.

```bash
# start greengrass
cd /greengrass/ggc/core/
sudo ./greengrassd start
# Setting up greengrass daemon
# Validating hardlink/softlink protection
# Waiting for up to 1m10s for Daemon to start

# Greengrass successfully started with PID: 12319
```

Finally, confirm that the service is working properly by running the following (use the PID from the command output above)

```bash
ps aux | grep <PID_FROM_ABOVE>
# root     12319  1.3  0.5 1008696 23308 pts/1   Sl   21:14   0:00 /greengrass/ggc/packages/1.10.1/bin/daemon -core-dir /greengrass/ggc/packages/1.10.1 -greengrassdPid 12314
```

#### Deploy Greengrass Group

The final step is to run the deploy for the Greengrass group that was just setup. To do this, navigate to the [Greengrass Groups section of the AWS IoT portal](https://console.aws.amazon.com/iot/home?region=us-east-1#/greengrass/grouphub).

Open up the Greengrass group that we just deployed by clicking its name.

![AWS IoT Greengrass Groups](https://dev-to-uploads.s3.amazonaws.com/i/pw5jx9weaoife9ug0u7c.png)

To run the deployment for the device, simply click **Deploy** under the **Actions** menu.

![AWS IoT Greengrass group deploy](https://dev-to-uploads.s3.amazonaws.com/i/e63g2tlt770r1hbuxck0.png)

You will be prompted how you would like to deploy, go with **Automatic detection**.

![AWS IoT Greengrass group automatic detection](https://dev-to-uploads.s3.amazonaws.com/i/o6gi5o2fvd7u87rp9pgo.png)

After a minute or so you should see the Greengrass group has been deployed by a green indicator.

![AWS IoT Greengrass group successful deployment](https://dev-to-uploads.s3.amazonaws.com/i/fmles2naicib02vejzqq.png)

### Summary

Congratulations! You created an AWS IoT Greengrass group that is ready for use on your edge based IoT project. With this Greengrass Core setup on the Jetson Nano you can now start looking at more complex tasks such as:

* Lambda Functions on the Edge
* Machine Learning on the Edge
* [Docker containers on Greengrass](https://devopstar.com/2019/12/14/greener-grass-docker-deployments)

If you had any issues setting things up, or you have other questions, please let me know by reaching out on Twitter [@nathangloverAUS](https://twitter.com/nathangloverAUS) or dropping a comment below.