小程序
传感搜
传感圈

Understanding AWS IoT Core: Features, Use Cases, & Quick Tutorial

2023-10-05 17:15:51
关注

Illustration: © IoT For All

AWS IoT Core is a managed cloud service that lets connected devices interact with cloud applications and other devices. It can support a large volume of messages and can process and route those messages to AWS endpoints and other devices reliably and securely.

AWS IoT Core makes it possible to build applications that act on the data generated by connected devices. These applications can be hosted in the cloud, which enables web-based access to these services, thus enhancing the scalability, accessibility, and maintenance of IoT systems.

AWS IoT Core is particularly useful in IoT use cases where devices need to communicate with each other and the cloud, but do not have the ability to directly interact with backend services. It acts as the communication hub between these devices and the backend services, handling all the complexities of concurrent communication, message routing, security, authorization, and error handling.

6 Key Features of AWS IoT Core

#1: Device Communication: MQTT, HTTP, and WebSocket Protocols

One of the critical aspects of any IoT service is the communication protocol. AWS IoT Core supports three main protocols: MQTT, HTTP, and WebSocket. 

MQTT (Message Queuing Telemetry Transport) is a lightweight messaging protocol designed for constrained devices and low-bandwidth, high-latency, or unreliable networks. HTTP and WebSockets are standard web protocols that devices can use to send and receive data from AWS IoT Core.

The support for these protocols ensures that your devices can communicate with AWS IoT Core, irrespective of their capabilities or network conditions. This feature is crucial in creating versatile, resilient IoT systems that can function seamlessly under varying conditions.

#2: Security and Identity Service: Authentication and Encryption

Robust security and identity services ensure that all device data is transmitted securely and that unauthorized devices or applications cannot connect to your devices. AWS IoT Core uses mutual authentication and encryption at all points of connection, ensuring data is never exchanged between devices and AWS IoT Core without proven identity.

Moreover, AWS provides fine-grained access control to your IoT resources using AWS Identity and Access Management (IAM). This ensures your resources are accessible only to authenticated users or devices with the necessary permissions.

#3: Device Shadow, Storing and Retrieving Device State

The Device Shadow feature in AWS IoT Core is a JSON document used to store and retrieve the current state of a device. This document enables applications to read from and write to the fields of the device shadow, providing a reliable way to track the device’s state over time.

This means even if your device is offline, you can set a desired future state, and the device will synchronize when it reconnects.

#4: Rules Engine: Processing and Routing of IoT Data

The Rules Engine is a service within AWS IoT Core that enables data processing and routing from IoT devices. The engine evaluates inbound messages published into AWS IoT Core and transforms and delivers them to another device or a cloud service, based on business rules you define.

With the Rules Engine, you can filter, transform, and act upon device data on the fly, based on business rules you define. You can route the data to AWS services like AWS Lambda, Amazon DynamoDB, Amazon S3, Amazon Kinesis, Amazon SNS, and many others.

#5: Registry: Organize and Index Devices

The Registry in AWS IoT Core allows you to categorize devices into a hierarchical structure based on function, security requirements, or any other category that fits your needs. The Registry also enables you to track metadata such as device attributes and capabilities.

#6: Device Defender: IoT Device Security

Finally, the Device Defender is a security feature in AWS IoT Core that continuously monitors your fleet of devices for abnormal behavior. It lets you maintain and enforce IoT configurations such as device identity, authentication, and access control, ensuring your devices remain compliant with security policies.

Main Use Cases of AWS IoT Core

Industrial Automation

AWS IoT Core allows businesses to connect their machinery and equipment to the cloud, enabling remote monitoring and real-time data analysis. This data-driven approach reduces downtime by predicting equipment failures and scheduling preventative maintenance.

Additionally, AWS IoT Core enhances operational efficiency by automating processes and reducing human error.

Home Automation

AWS IoT Core offers powerful tools for creating smart home devices. It enables the connection of various devices such as smart thermostats, lighting systems, security systems, and appliances to the Internet, allowing homeowners to control them remotely.

Wearables

Wearables like fitness trackers, smartwatches, and health monitors have become increasingly popular in recent years. AWS IoT Core plays a significant role in the functionality of these devices.

It facilitates the exchange of data between the wearable device and the cloud, allowing for real-time health monitoring, fitness tracking, and personalized insights. Secure data transmission ensures the user’s personal information is protected.

Smart Cities

AWS IoT Core can be instrumental in building smart cities. It enables the connection of various city services and infrastructure to the Internet, facilitating real-time monitoring and data analysis.

This interconnectedness can lead to improved public services, enhanced public safety, reduced environmental impact, and overall improved quality of life for city residents.

Asset Tracking

In the logistics and supply chain industry, AWS IoT Core is used for asset tracking. It enables real-time tracking of goods, providing businesses with valuable insights into their inventory and supply chain operations.

This visibility helps businesses improve their operations, reduce costs, and provide better customer service.

AWS IoT Core Pricing

Here is a breakdown of IoT core pricing, within the AWS Free Tier and once you exceed the free limits.

Free Tier

The AWS Free Tier is designed to give you hands-on experience with a range of AWS services at no charge. For AWS IoT Core, the free tier offers 250,000 free messages (published or delivered) per month for 12 months.

This allows businesses to experiment with connecting devices to the AWS cloud, sending data, and building IoT applications without any upfront cost.

However, it’s important to note that once you exceed the free tier limit, you’ll be charged according to the standard AWS IoT Core pricing. The free tier is a great way to get started with AWS IoT Core and understand its capabilities before committing financially.

Connectivity

Connectivity charges apply when you use AWS IoT Core to connect your devices to AWS. The pricing for connectivity is primarily based on the amount of data transferred to and from AWS IoT Core.

In the U.S. East (Northern Virginia) region, for example, prices start at $0.08 per million minutes of connection (equivalent to about $0.000000133 per minute of connection). The cost decreases as you use more connection minutes.

Messaging

Messaging forms a significant part of AWS IoT Core pricing. AWS charges for messages published to AWS IoT Core, delivered from AWS IoT Core to a device or application, or delivered to a rules engine.

The charges depend on the size of the message and the region. For instance, in the U.S. East (Northern Virginia) region, the price is $1 per million messages.

Device Shadow and Registry

The Device Shadow and Registry component of AWS IoT Core allows you to store and retrieve the last known state of a device, which can be useful for applications that need to check device status or control a device.

The pricing for this component is based on the number of operations (reads, writes, deletes) performed. In the U.S. East (Northern Virginia) region, the price is $1.25 per million operations.

Rules Engine

The Rules Engine is a crucial part of AWS IoT Core that allows you to build IoT applications that gather, process, analyze, and act on data generated by connected devices.

The cost of using the Rules Engine is based on the number of rules evaluations. In the U.S. East (Northern Virginia) region, for example, the price is $0.15 per million evaluations.

Device Location

The Device Location feature in AWS IoT Core enables you to retrieve the last known location of your devices. The pricing for this component is based on the number of location queries made. In the US East (Northern Virginia) region, for instance, the price is $0.40 per thousand queries.

AWS IoT Core Quick Tutorial

AWS IoT provides a built-in tutorial that shows you how to create your first thing object, connect a device to it, and watch it send MQTT messages. This section is abbreviated from the Amazon documentation.

To start the tutorial, sign into the AWS IoT console, and from Learning resources on the right, choose Start tutorial, and then click View connection options.

Create a Thing Object

The tutorial begins in the Connect > Connect one device section of the AWS IoT console. In the right-hand pane you will see step 1 of the process: Prepare your device.

Follow the on-screen instructions to prepare your device for connecting to AWS IoT and click Next.

In the Register and Secure your Device section:

  • Choose Create a new thing or choose an existing thing.
  • In the Thing name field, enter a name for the thing.
  • In the Additional Configurations section, customize your thing resource further.

Then click Next.

In the Choose Platform and SDK section, choose the platform and the language of the AWS IoT Device SDK that you want to use. In the tutorial, a sample thing is created that uses the Linux/OSX platform and Python SDK. Make sure that you have python3 and pip3 installed on the target device before you continue to the next step.

Click Next.

EMQ Technologies Inc.

Download Files to the IoT Device

After AWS IoT has created the connection kit, a page appears that includes the following files and resources your device requires:

  • The thing’s certificate files used to authenticate the device.
  • A policy resource to authorize your thing object to interact with AWS IoT.
  • The script to download the AWS Device SDK and run the sample program on your device.

When you’re ready to continue, choose the Download connection kit button, this will download a connection kit for the platform you selected earlier.

Note that you can run this part of the process directly from the device. In this case, save the connection kit file to a directory from which you can run command line commands. Otherwise, save it to a local directory and then transfer the file to your device.

Unzip the connection kit on your device – you can do this via the Unzip connection kit on your device section in the console, or the terminal on your device. After you have the connection kit file on the device, continue by choosing Next.

Run the Sample

You do this procedure in a terminal or command window on your device while you follow the directions displayed in the console. The commands you see in the console are for the operating system you chose earlier (in this case, the Linux/OSX operating systems).

In a terminal or command window on your device, in the directory with the connection kit file, perform the steps shown in the AWS IoT console.

EMQ Technologies Inc.

After you enter the command from Step 2 in the console, you should see an output in the device’s terminal or command window that indicates the program is sending messages to AWS IoT Core and then receiving messages back.

From the Test page of the AWS IoT console, open the MQTT test client. If you chose Python SDK, then in the MQTT test client, in the Topic filter, enter a topic to subscribe to messages from the device. For example, you can use the topic sdk/test/python. The topic filters are case-sensitive.

After you subscribe to the test topic, run ./start.sh on your device. Immediately afterward, messages should appear in the MQTT client, similar to this:

{
  "message": "Hello World!" [1]
}

Click Continue to finish the tutorial and see a summary of the activity.

Tweet

Share

Share

Email

  • Cloud Software
  • MQTT
  • Smart Home Automation

  • Cloud Software
  • MQTT
  • Smart Home Automation

参考译文
了解 AWS IoT Core:功能、用例与快速教程
插图:© IoT For All --> AWS IoT Core 是一项托管式云服务,使连接的设备能够与云应用和其他设备进行交互。它可以支持大量的消息,并能可靠、安全地处理和将这些消息路由到 AWS 终端节点和其他设备。AWS IoT Core 使得构建基于连接设备所生成数据的应用程序成为可能。这些应用可以部署在云上,从而实现基于网络的访问,提升物联网系统的可扩展性、可访问性和可维护性。AWS IoT Core 特别适用于物联网场景,其中设备需要彼此通信和连接云端,但无法直接与后端服务交互。它充当这些设备与后端服务之间的通信中心,处理所有并发通信、消息路由、安全、授权和错误处理的复杂性。AWS IoT Core 六大关键特性 #1:设备通信:MQTT、HTTP 和 WebSocket 协议 物联网服务中的关键方面之一是通信协议。AWS IoT Core 支持三种主要协议:MQTT、HTTP 和 WebSocket。MQTT(Message Queuing Telemetry Transport)是一种为资源受限设备和低带宽、高延迟或不可靠网络设计的轻量级消息协议。HTTP 和 WebSocket 是标准的网络协议,设备可以使用它们与 AWS IoT Core 发送和接收数据。这些协议的支持确保了无论设备能力或网络状况如何,设备都能与 AWS IoT Core 通信。该特性在创建灵活、强大的物联网系统方面至关重要,特别是在各种条件下实现无缝运行。#2:安全与身份服务:认证与加密 强大的安全与身份服务确保所有设备数据安全传输,并防止未经授权的设备或应用连接到您的设备。AWS IoT Core 在所有连接点使用双向认证和加密,确保设备与 AWS IoT Core 之间没有经过验证身份的数据交换。此外,AWS 使用 AWS 身份与访问管理(IAM)为您提供细粒度的物联网资源访问控制,确保只有获得授权的用户或设备才能访问您的资源。#3:设备影子,存储与检索设备状态 AWS IoT Core 中的“设备影子”功能是一个 JSON 文档,用于存储和检索设备的当前状态。该文档使应用程序能够读取和写入设备影子的字段,提供一种可靠的方式追踪设备状态随时间的变化。这意味着即使您的设备离线,您也可以设置期望的未来状态,当设备重新连接时,状态将同步。#4:规则引擎:物联网数据的处理与路由 规则引擎是 AWS IoT Core 中的一项服务,使您可以处理和路由来自物联网设备的数据。该引擎评估发送到 AWS IoT Core 的入站消息,并根据您定义的业务规则将其转换并交付给另一台设备或云服务。借助规则引擎,您可以根据定义的业务规则即时过滤、转换并处理设备数据。您可以将数据路由到 AWS 服务,如 AWS Lambda、Amazon DynamoDB、Amazon S3、Amazon Kinesis、Amazon SNS 等。#5:设备注册表:组织和索引设备 AWS IoT Core 中的注册表允许您根据功能、安全需求或其他任何适合您需求的类别将设备分类为一个层次结构。注册表还使您能够跟踪诸如设备属性和能力等元数据。#6:设备防御者:物联网设备安全 最后,设备防御者是 AWS IoT Core 中的一项安全功能,用于持续监控您的设备舰队以检测异常行为。它使您能够维护和执行 IoT 配置,如设备身份、认证和访问控制,确保您的设备符合安全策略。AWS IoT Core 的主要用例 工业自动化 AWS IoT Core 允许企业将机器设备连接到云端,实现远程监控和实时数据分析。这种数据驱动方法通过预测设备故障和安排预防性维护,减少停机时间。此外,AWS IoT Core 通过自动化流程和减少人为错误,提高运营效率。家庭自动化 AWS IoT Core 为创建智能家居设备提供了强大的工具。它使诸如智能恒温器、照明系统、安防系统和家用电器等各类设备连接到互联网,让用户可以远程控制这些设备。可穿戴设备 近年来,诸如健身追踪器、智能手表和健康监测器等可穿戴设备越来越受欢迎。AWS IoT Core 在这些设备的功能中发挥了重要作用。它促进了可穿戴设备与云端的数据交换,实现实时健康监测、健身追踪和个性化洞察。安全的数据传输确保了用户的个人信息受到保护。智慧城市 AWS IoT Core 在建设智慧城市中可以发挥重要作用。它使各种城市服务和基础设施连接到互联网,实现实时监控和数据分析。这种互联性可以带来更优质的公共服务、增强公共安全、减少环境影响,并整体提升城市居民的生活质量。资产追踪 在物流和供应链行业,AWS IoT Core 被用于资产追踪。它使货物的实时追踪成为可能,为业务提供库存和供应链运营的宝贵洞察。这种可视性帮助企业改进运营,降低成本,并提供更好的客户服务。AWS IoT Core 价格 以下是 AWS IoT Core 的价格结构,包括在 AWS 免费层内以及超出免费额度后的费用。免费层 AWS 免费层旨在让您以零成本体验一系列 AWS 服务。对于 AWS IoT Core,免费层提供每月 25 万条免费消息(发布或交付),持续 12 个月。这使企业能够在无需任何前期费用的情况下,试验将设备连接到 AWS 云、发送数据和构建物联网应用。然而,超过免费层限制后,将按标准 AWS IoT Core 价格收费。免费层是开始使用 AWS IoT Core 并了解其功能的好方法,然后再做出财务承诺。连接性费用 当您使用 AWS IoT Core 将设备连接到 AWS 时,将产生连接性费用。连接性费用主要基于传输到和从 AWS IoT Core 的数据量。例如,在美国东部(弗吉尼亚北部)地区,价格从每百万分钟连接费用 0.08 美元(相当于每分钟连接费用约 0.000000133 美元)起。连接时间使用越多,成本越低。消息费用 消息费用构成 AWS IoT Core 价格的重要部分。AWS 对发布到 AWS IoT Core 的消息、从 AWS IoT Core 发送到设备或应用程序的消息,以及发送到规则引擎的消息收费。费用取决于消息大小和区域。例如,在美国东部(弗吉尼亚北部)地区,每百万条消息的费用为 1 美元。设备影子与注册表 AWS IoT Core 的设备影子与注册表功能允许您存储和检索设备的当前状态。美国东部(弗吉尼亚北部)地区每百万次请求的费用为 0.20 美元。规则引擎 AWS IoT Core 的规则引擎允许您根据定义的业务规则即时过滤、转换并处理设备数据。美国东部(弗吉尼亚北部)地区每百万条消息的费用为 0.10 美元。MQTT 代理 AWS IoT Core 的 MQTT 代理支持 MQTT 协议,允许设备之间进行消息通信。美国东部(弗吉尼亚北部)地区每百万次连接的费用为 0.10 美元。下载文件到物联网设备 在 AWS IoT Core 创建连接套件后,会出现一页,其中包含设备所需以下文件和资源: - 用于认证设备的“设备”证书文件。 - 授权您的“设备”对象与 AWS IoT 进行交互的策略资源。 - 下载 AWS 设备 SDK 并在设备上运行示例程序的脚本。当您准备好继续时,选择“下载连接套件”按钮,这将为您之前选择的平台下载连接套件。注意您可以直接在设备上运行这个过程。在这种情况下,将连接套件文件保存到您可以从命令行运行的目录中。否则,将其保存到本地目录,然后将其传输到您的设备。在设备上解压连接套件——您可以通过控制台中的“解压连接套件”部分或设备上的终端完成此操作。在设备上获得连接套件文件后,选择“下一步”。运行示例 您在设备的终端或命令窗口中执行此操作,同时按照控制台中显示的指导操作。控制台中显示的命令是您之前选择的操作系统(在此情况下为 Linux/OSX 操作系统)。在设备的终端或命令窗口中,在包含连接套件文件的目录中执行 AWS IoT 控制台中显示的步骤。EMQ Technologies Inc.在设备上运行 ./start.sh 后,消息应立即出现在 MQTT 客户端中,如下所示: {"message": "Hello World!" [1]}点击“继续”以完成教程并查看活动摘要。TweetShareShareEmail 云软件MQTTSmart Home Automation --> 云软件MQTTSmart Home Automation
您觉得本篇内容如何
评分

评论

您需要登录才可以回复|注册

提交评论

广告

iotforall

这家伙很懒,什么描述也没留下

关注

点击进入下一篇

MQTT 控制报文简介

提取码
复制提取码
点击跳转至百度网盘