Pioneering IOT with AWS

Will Ng

1.29.2016

IoT_AWS.jpgContributions to this blog were made by Andy Koziol, Enterprise Architect, and Terrence Young, Technology Consultant.

Internet of Things (IoT) is a hot topic in the last 2 years. It is about connecting smart devices to exchange data and work better. It is driven by sensors and mobile processor units becoming smaller, more energy efficient and lower cost. It is also driven by the higher adoption of mobile devices and expanded internet connectivity. It has applications in a wide area, e.g. connected home, smart city, wearables and digital healthcare.It is a challenge to implement IoT because it involves several technical areas from low energy wireless communication to scalable cloud infrastructure. It requires a wide range of expertise and management of many technical details to ensure the success of a project. To aid our discussion here, we are going to group the different technical aspects in roughly 4 big layers: wireless technology, hardware & firmware, cloud infrastructure and application interface.

There are several IoT platforms that integrate technical solutions across different aspects to make IoT implementation quicker and easier. Apple, Google and Amazon are some of the big players to have announced or released a full vertical IoT platform. We compiled the following visualization to illustrate and compare their solutions in these 4 big layers:

AWS_Solstice.png

Amazon Web Services (AWS) IoT is a great choice among the 3 because it is flexible with a broad range of applications enabled by the AWS ecosystem from analytics to web data access. It is also fully released and supported as of Jan 2016.

Here is a diagram from Amazon on the overall architecture of AWS IoT:

Amazon.png

Firstly, the device can communicate to the AWS IoT system by MQTT or HTTP over IP connection. MQTT is power-efficient while HTTP RESTful API is convenient for quick implementation. For MQTT, it uses X.509 certificates with the private key stored on the device, while HTTP RESTful is based on more traditional authentication via Amazon IAM.

Device Shadow is the flexible concept that AWS IoT uses to send data to the device and for the device to report data. The data in the device shadow can be used for analytics or triggering other action and it is configured by the rules engine. With rules engine, you can directly configure it to, e.g.

  1. Store the data in Amazon S3 or Amazon DynamoDB.
  2. Analyze the data with Amazon Kinesis
  3. Invoke push notification to mobile devices via Amazon SNS
  4. Implementing custom function with Amazon Lambda function or publishing data via Amazon SQS queue

To give an estimate of the AWS IoT cost, we are going to use the following use case as an example:

100 sensors each publish one 400-byte message per minute to AWS IoT.
AWS IoT then delivers all of the messages to one metering device, and also to DynamoDB.

The total cost would be ~$43 /month for AWS IoT + DynamoDB usage charge, where

  • messages from sensors  ~$21.5 /month = 100 msgs/mins * 43200 mins/mth * $5 / mil msgs
  • messages sent to metering device same as above ~$21.5 / month
  • no cost for sending AWS IoT data to DynamoDB

At our most recent Chicago Mobile Meetup, we showed a demo of using AWS Node.Js device SDK to connect a Raspberry PI to the AWS IoT. The following code snippet is about the device responding to a change in the desired state of the device shadow. 

Screen_Shot_2016-01-28_at_1.28.14_PM.png

To get started, there are a lot of hardware starter kits and a few device SDKs (Embedded C, NodeJS, Arduino Yun python wrapper) to choose from, visit here for more information: https://aws.amazon.com/iot/getting-started/


Have fun hacking and building IoT! Learn more about Solstice's IoT capabilities.