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:
- 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:
- 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.
- 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:
- 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
- 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
- Then, add these scripts on that file:
fs.protected_hardlinks = 1
fs.protected_symlinks = 1
You can see this in the following screenshot:
- Save, and reboot your Raspberry Pi:
$ sudo reboot
- 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.