Quick start IoT Tutorial with AWS IoT and Raspberry Pi

In this tutorial, I’m going to introducing you how to build your own “Internet of Things” device with Amazon AWS IoT. You will learn how to connect your Raspberry Pi with the Amazon AWS platform using the MQTT (Message Queue Telemetry Protocol) protocol, which is well-known in the IoT industry.

Amazon made it very easy for us to get started connecting your device with AWS IoT in under 5 minutes.

Let’s get started!

1. Create a new “Thing”

To create a new device (“thing”), visit the amazon AWS site https://aws.amazon.com/ and login to your account.

Click on services and search for “IoT” and select “AWS IoT”.

After this step, you will be redirected to the AWS IoT site.

Click on “Get started”.

Now you need to select your platform and the SDK. For this example, we choose the platform “Linux/OSX” and the SDK for “Node.js”.

Amazon shows you again, how easy it is, to set up a new device… (hopefully for the last time).

By the way: Click on “Get started” 🙂

To identify your “thing”, give it a name.

After that step, you can download your kit, which includes an example node.js script and also the certificate, to establish a secure connection to the Amazon AWS cloud.

Download the files and follow the steps below.

2. Setup your Raspberry Pi

Unzip the downloaded package.

If unzip is not installed, you can install it.

Now make the start script executable.

After that, you can execute the script.

A Short summary of the steps above.

Update –> troubleshooting:

—— troubleshooting section ——

Some users can’t run “start.sh”, because of missing packages. It is required to have “npm” and “Node.js” installed on the Pi, to execute the script. But don’t worry, it’s very easy.

If you get following error output “node: not found”, then Node.js is missing.

–> Fix: See my short blog post to fix this: Install Node.js on Raspberry pi

If you get the error output “npm: not found”, then npm is missing.

–> Fix: Install the package:

—— end of troubleshooting section ——

Now send a text message to your Pi!

If you’ve received the message on the Pi, then you’ve successfully connected your Raspberry Pi to amazon AWS IoT.

Done.

Now you can do a lot of things, like turning on/off a led directly from the cloud. In the future, I will write more topics about this stuff.

 

Leave a Reply