Up and Running with the Internet of Things Using Raspberry Pi and AWS IoT

Amazon Web Services (AWS) previously released its Internet of Things (IoT) platform, AWS IoT. This managed cloud platform brings IoT development, small device programming and automation to a totally different level. Not only does it provide everything you need to communicate to the devices around you, but it does so in a way that gives you less to think about.

Before I started on my personal exploratory and very experimental project that we call the Internet of Things, I had mustered up a system consisting of custom-built APIs running on top of EC2 instances, communicating over a VPN to a box running at my house. Needless to say, I think I was in over my head. With a background mostly in pure development, and not much in systems and operations, I was very pleased to just “set it and forget it” once I set up AWS IoT with my devices. The IoT device SDK handles all the messaging, the gateway to the device and provides the ability to pub/sub to nodes connected to the thing I defined. I also have the bonus of integrating it with other AWS services, which I’m not even a little bit mad about.

I have the first part of my project done — and fairly seamlessly might I add. It didn’t take more than a few hours (that includes some hack time) to control my device, a Raspberry Pi with AWS IoT. It blew my mind when I realized I could control my devices solely from over the web. Running a Node script on my laptop, and seeing an LED illuminate 2 seconds later from my Pi was kind of trippy. These things are so basic, but so very cool. I’m hooked.

As much as I’d love to take the time to write up a walkthrough of setting up “Things” and devices with AWS IoT, Amazon provides amazing IoT documentation and a fantastic quickstart in its developer guide. I suggest you go there to get started. The JavaScript aws-iot-device-sdk and its README are also fantastic.

I followed this AWS IoT Raspberry Pi How-To Guide on getting started with the basic necessities of IoT with the Raspberry Pi. So thanks to sreid for that!

Without further ado, here’s my code that I ran on my Raspberry Pi:


Here’s the quick Node script I executed to update the Thing Shadow to illuminate the LED hooked up to the Pi:



If you have any questions, comments or suggestions, I’d love to hear them. Also, try running this code for yourself. I am interested in hearing if you are as geeked about it as I am.