Preparing Raspberry Pi 3

The Raspberry Pi 3 board can run on several OSes. A list of supported OSes for Raspberry Pi 3 can be found at https://www.raspberrypi.org/downloads/. To work with AWS Greengrass Core, it is recommended that you install the latest Raspbian Linux OS for Raspberry Pi, which can be found at https://www.raspberrypi.org/downloads/raspbian/. For a refresher on installation on Raspberry Pi 3, I recommend you follow the instructions mentioned at https://www.raspberrypi.org/documentation/installation/installing-images/README.md.

Now we will prepare to deploy AWS Greengrass Core on Raspberry Pi 3. Follow these steps:

  1. You should have installed Raspbian on Raspberry Pi 3. If you have not, you can install it by following the guidelines at https://www.raspberrypi.org/documentation/installation/installing-images/README.md. If you have installed Raspbian on Raspberry Pi 3, make sure that the OS has Linux kernel 4.4.11+ or later with OverlayFS and the user namespace enabled. You can verify this using the following command on the Terminal:
$ uname -a

You should see the kernel version on the Terminal. For instance, you can see my kernel version, which is 4.9.41, from the Raspbian OS in the following screenshot:

  1. You also can upgrade Raspbian Linux in order to work with AWS Greengrass. You can type the commands as follows:
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo BRANCH=next rpi-update

This operation needs internet access, so your Raspberry Pi should be connected to the internet.

  1. The next step is to create a user named ggc_user and a group named ggc_group. Type the following commands on the Raspberry Pi Terminal:
$ sudo adduser --system ggc_user
$ sudo addgroup --system ggc_group

You can see the executed commands in the following screenshot:

  1. AWS Greengrass requires local storage to perform local processing. You can install SQLite on Raspberry Pi. For this, type the following command:
$ sudo apt-get install sqlite3
  1. Since AWS Greengrass requires a high-security environment, Raspberry Pi should be configured to activate hardlink/softlink protection. You can perform it by opening the /etc/sysctl.d/98-rpi.conf file:
$ sudo nano /etc/sysctl.d/98-rpi.conf
  1. Then, add these scripts on that file:
fs.protected_hardlinks = 1
fs.protected_symlinks = 1

You can see this in the following screenshot:

  1. Save, and reboot your Raspberry Pi:
$ sudo reboot
  1. After reboot, please type the following command:
$ sudo sysctl -a | grep fs

You should see our added parameters in the Terminal, as in the following screenshot:

The next step is to configure and register Raspberry Pi to AWS IoT in order to enable AWS Greengrass. We will perform this task in the next section.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.189.171.125