Exploring IoT Platforms: A Comprehensive Guide to Amazon AWS IoT

Exploring IoT Platforms: A Comprehensive Guide to Amazon AWS IoT

Author: Ma Zhi

Published by IoT Think Tank

Please indicate the source and origin when reprinting

—— [Introduction] ——

The IoT Think Tank will publish a series of articles written by Mr. Ma Zhi every Friday afternoon in the second article — “Exploring Domestic and Foreign IoT Platforms”.

Exploring IoT Platforms: A Comprehensive Guide to Amazon AWS IoT

The IoT Think Tank will publish a series of articles written by Mr. Ma Zhi every Friday afternoon in the second article — “Exploring Domestic and Foreign IoT Platforms”

—— Domestic ——

(1) Baidu IoT Hub

(2) Alibaba Cloud IoT Suite

(3) QQ IoT·Smart Hardware Open Platform

(4) JD Micro-Link

(5) Smart Cloud IoT Cloud Service Platform and Smart Hardware Self-Development Platform

(6) Qingke Cloud FogCloud

(7) Ablecloud IoT Self-Development and Big Data Cloud Platform

(8) China Mobile IoT Open Platform OneNet

—— Foreign ——

(1) Amazon AWS IoT

(2) Microsoft Azure IoT

(3) IBM Watson IoT

(4) Ayla Networks

Platform Positioning

• AWS IoT is a managed cloud platform that makes it easy and secure for connected devices to interact with cloud applications and other devices.

• AWS IoT can support billions of devices and trillions of messages, and can process these messages and route them securely and reliably to AWS endpoints and other devices. Applications can track all devices and communicate with them at any time, even if these devices are not connected.

• Use AWS services such as AWS Lambda, Amazon Kinesis, Amazon S3, Amazon Machine Learning, Amazon DynamoDB, Amazon CloudWatch, AWS CloudTrail, and Amazon Elasticsearch Service integrated with Kibana to build IoT applications that collect, process, and analyze data generated by interconnected devices and take action on it without managing any infrastructure.

Architecture

Exploring IoT Platforms: A Comprehensive Guide to Amazon AWS IoT

AWS Services Integrated with AWS IoT Platform

Exploring IoT Platforms: A Comprehensive Guide to Amazon AWS IoT

• Amazon DynamoDB — Managed NoSQL database

• Amazon Kinesis — Real-time processing of large-scale streaming data

• AWS Lambda — Run code in EC2 cloud virtual machines in response to events

• Amazon Simple Storage Service (S3) — Scalable cloud storage

• Amazon Simple Notification — Push notification service

• Amazon Simple Queue Service — Message queue service

Device SDK

• AWS IoT Device SDK connects hardware devices to AWS IoT using MQTT, HTTP, or WebSockets protocols, allowing hardware devices to seamlessly and securely collaborate with the device gateway and device shadow provided by AWS IoT.

• The device SDK supports C, JavaScript, Arduino, Java, and Python.

• The device SDK includes open-source libraries, developer guides with examples, and porting guides for users to build IoT products or solutions based on hardware platforms.

Exploring IoT Platforms: A Comprehensive Guide to Amazon AWS IoT

Device Gateway

• The AWS IoT device gateway supports devices to communicate securely and efficiently with AWS IoT. The device gateway can exchange messages using a publish/subscribe model, supporting one-to-one and one-to-many communication. With this one-to-many communication model, AWS IoT will support interconnected devices broadcasting data to multiple subscribers of a given topic.

• The device gateway supports MQTT, WebSocket, and HTTP 1.1 protocols, as well as private protocols.

• The device gateway can automatically scale to support over 1 billion devices without pre-configuring infrastructure.

Exploring IoT Platforms: A Comprehensive Guide to Amazon AWS IoT

Authentication and Authorization

Exploring IoT Platforms: A Comprehensive Guide to Amazon AWS IoT

• AWS IoT provides mutual authentication and encryption at all connection points. AWS IoT supports AWS authentication methods (known as “SigV4”) as well as certificate-based X.509 authentication. Connections using HTTP can use either method, while connections using MQTT can use certificate-based authentication, and connections using WebSockets can use SigV4.

• Using certificates generated by AWS IoT and those signed by the preferred certificate authority (CA), map the selected roles and/or policies to each certificate to grant or revoke access to devices or applications.

• Create, deploy, and manage device certificates and policies through the console or using the API. These device certificates can be pre-configured, activated, and associated with relevant policies configured using AWS IAM.

• AWS IoT also supports mobile applications using Amazon Cognito for connection, which is responsible for creating unique identifiers for application users and obtaining temporary, limited-privilege AWS credentials.

Registry

• The registry will create device identities and track metadata such as device attributes and capabilities.

• The registry assigns a unique identity to each device regardless of its type and connection method. In addition, it supports metadata describing device capabilities, such as whether a sensor reports temperature and whether the data is in Fahrenheit or Celsius.

• The registry stores metadata about devices without incurring additional costs; and the metadata in the registry will not expire as long as it is accessed or updated at least once every 7 days.

Exploring IoT Platforms: A Comprehensive Guide to Amazon AWS IoT

Device registry information stored in JSON format

Device Shadow

Exploring IoT Platforms: A Comprehensive Guide to Amazon AWS IoT

• Device shadows retain the last reported state and expected future state of each device, even if the device is offline.

• Obtain the last reported state of a device or set the expected future state through the API or using the rules engine.

• Applications can set the expected future state of a device without specifying the current state of the device. AWS IoT will compare the expected future state with the last reported state and command the device to “make up the difference”.

• The device SDK can easily synchronize its state and its shadow and respond to expected future states set through the shadow.

• Device shadows are stored for free for up to a year. If the state is updated at least once a year, the device shadow will be retained permanently; otherwise, the state will expire.

Device Shadow Process

Exploring IoT Platforms: A Comprehensive Guide to Amazon AWS IoT

Device Shadow Format

Exploring IoT Platforms: A Comprehensive Guide to Amazon AWS IoT

Device Shadow Service

The device shadow service uses MQTT topics to facilitate communication between applications and devices. Below are the related MQTT QoS 1 topics:

$aws/things/{thingName}/shadow/update

$aws/things/{thingName}/shadow/get

$aws/things/{thingName}/shadow/delete

$aws/things/{thingName}/shadow/update/accepted

$aws/things/{thingName}/shadow/update/rejected

$aws/things/{thingName}/shadow/update/delta

$aws/things/{thingName}/shadow/get/accepted

$aws/things/{thingName}/shadow/get/rejected

$aws/things/{thingName}/shadow/delete/accepted

$aws/things/{thingName}/shadow/delete/rejected

The device SDK (C-SDK, JS-SDK) integrates shadow functionality into the device, enabling automatic synchronization of states between the device and the shadow service.

Rules Engine

Exploring IoT Platforms: A Comprehensive Guide to Amazon AWS IoT

• The rules engine validates inbound messages published to AWS IoT and transforms these messages based on defined business rules, routing them to another device or cloud service. Rules can apply to data from one or multiple devices and can execute one or more operations in parallel.

• The rules engine can also route messages to AWS endpoints, including AWS Lambda, Amazon Kinesis, Amazon S3, Amazon Machine Learning, Amazon DynamoDB, Amazon CloudWatch, and Amazon Elasticsearch Service integrated with Kibana. External endpoints can connect using AWS Lambda, Amazon Kinesis, and Amazon Simple Notification Service (SNS).

• Rules can be written using SQL-like statements. For example: If the temperature reading exceeds a specific threshold, it can trigger a rule to transfer the data to AWS Lambda; if this temperature exceeds 15% of the average of 5 other devices, action should be taken.

• The rules engine will provide dozens of available functions for transforming data, and unlimited functions can be created through AWS Lambda. For example, if processing various numerical values, the average of incoming numbers can be taken. Rules can also trigger Java, Node.js, or Python code to execute in AWS Lambda, providing maximum flexibility and ability to process device data.

Rules Engine Integration with Other Cloud Services

Exploring IoT Platforms: A Comprehensive Guide to Amazon AWS IoT

The rules engine validates message requests published to AWS IoT, transforms message requests based on business rules, and publishes to other services, such as:

• Enriching or filtering data collected from devices

• Writing device data to an Amazon DynamoDB database

• Saving files to Amazon S3

• Sending push notifications to all Amazon SNS users

• Publishing data to an Amazon SQS queue

• Calling Lambda functions to extract data

• Using Amazon Kinesis to process large amounts of device message data

• Sending data to Amazon Elasticsearch Service

• Capturing CloudWatch metrics

• Sending an MQTT message to Amazon Machine Learning service, predicting based on Amazon Machine Learning model

Rules Engine & Real-time Streaming Data Processing

Exploring IoT Platforms: A Comprehensive Guide to Amazon AWS IoT

N:1 Inbound Sensor Streaming Data (Data Denoising)

The rules engine filters, transforms, and aggregates sensor data before sending it to Amazon Kinesis for real-time streaming data processing

Kinesis Streaming Data Shared with Other Business Systems

Importing real-time processing results of streaming data into databases, applications, or other Amazon services

Rules Engine & Push Notification Service

Exploring IoT Platforms: A Comprehensive Guide to Amazon AWS IoT

Push Notifications

Supports Apple APNS push notification service, Google GCM cloud messaging service, Amazon ADM device messaging service, Microsoft WNS push service

Amazon SNS Push Notification Service -> HTTP Protocol Endpoints (SMS, Email)

Using Amazon SNS push notification service, calling third-party HTTP protocol endpoints, supports subscription and retries

Rules Engine Example – Using Machine Learning Prediction Function

Exploring IoT Platforms: A Comprehensive Guide to Amazon AWS IoT

The above is an example of using the Amazon Machine Learning prediction function machinelearning_predict, which means: If the result of the machine learning prediction function processing the MQTT message is category 1, then republish this message to a topic.

Device Management

Exploring IoT Platforms: A Comprehensive Guide to Amazon AWS IoT

• Supports firmware upgrades globally or in specific regions

• The rules engine tracks upgrade status and progress in the DynamoDB database

• The registry stores the firmware version of devices

S3 Managing Firmware Distribution Versions

Organizing and securing firmware binary files in S3

Message Broker Using Topic Patterns to Notify Device Groups

Notifying device groups of firmware update information, including the URL address of firmware binary files in S3

AWS IoT Platform Interfaces

• AWS Command Line Interface (AWS CLI)

Execute AWS IoT commands on Windows, Mac, and Linux

• AWS SDKs

Develop IoT applications using specific language APIs

• AWS IoT API

Develop IoT applications using HTTP or HTTPS requests

• AWS IoT Thing SDK for C

Develop IoT applications on resource-constrained devices, such as MCUs

AWS IoT Monitoring Tools

• Automated Monitoring Tools

Amazon CloudWatch Alarms

Amazon CloudWatch Logs

Amazon CloudWatch Events

AWS CloudTrail Log Monitoring

Manual Monitoring Tools

• AWS IoT Dashboard

Certificates

Policies

Rules

Devices

• CloudWatch Homepage

Current alarms and status

Alarms and resource charts

Service health

• CloudWatch

• Custom dashboards

• Custom charts for troubleshooting and monitoring trends

• Search all AWS resource metrics

• Create and modify alarm parameters

AWS IoT Beginner Kit

• The AWS IoT Beginner Kit is designed to help prototype development and securely connect to AWS IoT.

• The kit includes development microcontroller boards, sensors and actuators, AWS IoT Device SDK, and getting started guide.

Exploring IoT Platforms: A Comprehensive Guide to Amazon AWS IoT

AWS IoT Beginner Kit – Supported Platforms

Exploring IoT Platforms: A Comprehensive Guide to Amazon AWS IoT

AWS IoT Ecosystem

Exploring IoT Platforms: A Comprehensive Guide to Amazon AWS IoT

Platform Management Interface

Exploring IoT Platforms: A Comprehensive Guide to Amazon AWS IoT

Create Device

Exploring IoT Platforms: A Comprehensive Guide to Amazon AWS IoT

Device Attributes

Exploring IoT Platforms: A Comprehensive Guide to Amazon AWS IoT

Create Certificate

Exploring IoT Platforms: A Comprehensive Guide to Amazon AWS IoT

Activate Certificate

Exploring IoT Platforms: A Comprehensive Guide to Amazon AWS IoT

Create Policy

Exploring IoT Platforms: A Comprehensive Guide to Amazon AWS IoT

Bind Certificate and Policy

Exploring IoT Platforms: A Comprehensive Guide to Amazon AWS IoT

Bind Certificate and Device

Exploring IoT Platforms: A Comprehensive Guide to Amazon AWS IoT

Configure Device

Exploring IoT Platforms: A Comprehensive Guide to Amazon AWS IoT

Use MQTT Client to Subscribe to Device Messages

Exploring IoT Platforms: A Comprehensive Guide to Amazon AWS IoT

Use MQTT Client to View Device Messages

Exploring IoT Platforms: A Comprehensive Guide to Amazon AWS IoT

Create SMS Push Topic and Subscribe to This Topic

Exploring IoT Platforms: A Comprehensive Guide to Amazon AWS IoT

Exploring IoT Platforms: A Comprehensive Guide to Amazon AWS IoT

Create Rules

Exploring IoT Platforms: A Comprehensive Guide to Amazon AWS IoT

Create Rule Actions

Exploring IoT Platforms: A Comprehensive Guide to Amazon AWS IoT

Test Subscription Success

Exploring IoT Platforms: A Comprehensive Guide to Amazon AWS IoT

Previous Hot Articles (Click on the article title to read directly):

  • [Heavyweight] IoT Industry Panorama Report, First Domestic IoT Industry Two-Dimensional Perspective Panorama”

  • Interview with Academician Wu Hequan: Four Good News Indicate That the Development of IoT Has Entered the Right Track”

  • The First Low-Power Wide-Area Network LPWAN Market Report in China Released: Where Is the Next IoT Opportunity? [Text Version]”

  • A Cartoon Tells You: Behind NB-IoT, What Is the LoRa That Everyone Is Talking About?”

  • A Cartoon Tells You: Besides WiFi, Bluetooth, What Can the Recently Hot NB-IoT Do?”

  • McKinsey’s Heavy Report: How Do Enterprises Tap into the Value of ‘Industry 4.0’? (Collectible Edition)”

Exploring IoT Platforms: A Comprehensive Guide to Amazon AWS IoT

Leave a Comment

×