AWS IoT Greengrass, Raspberry Pi 3 and Freenove

The concept of IoT is very interesting and has been exploited fully in a few industries. More and more adoption is coming and last evening this desire to create a simple proof of concept dawned upon me and hence began a sleepless night.

I am not going to reproduce everything that I learnt from the AWS website and will leave it to the reader to explore this.

Ingredients

If you have already followed the AWS tutorial and are looking for some inspiration, here is what I have:

  1. A Raspberry Pi 3
  2. Breadboard
  3. Extension cable for the Raspberry Pi
  4. A keypad from Freenove (get the whole kit. It really is amazing)
  5. A 1602 LCD Screen from Freenove
  6. Power supply for the Raspberry Pi
  7. HDMI cable for connecting the Pi to a display
  8. An AWS Account – free signup for 1 year

A few images to kindle your interest 🙂

The Entire Kit
Connecting the Extension cable to the breadboard
Breadboard and Pi
Breadboard Pi Keypad and LCD
Test run of the LCD from a Freenove script – all is well
Upgrading to the latest Raspbian version
The IoT Greengrass screen within the AWS Management Console
After creating the Greengrass group
Download relevant Keys for authentication. This goes into the Pi
Download the setup files, create gcc user and groups for Greengrass Daemon
Greengrass daemon running successfully in the Pi
Create a registry entry for the device
More security credentials!
Modifying device security policies
Add subscriptions for source and target. You have to do this twice
Remember to filter data by topic
And a second subscription
Both subscriptions together
Ensure the daemon is running on the device. All other processes have been redacted
Create a deployment
Make note of the custom endpoint

From now on, we are fully back into the device making all the relevant code changes. The high level flow is:

  1. Read the letters pressed on the keypad and publish to the topic which we filtered on earlier
  2. Read the same message from the subscription and display the message on the LCD screen
Example of a message that is published from the AWS Console
How it appears on the Raspberry Pi console
And voila as how it appears on the LCD Screen