Deep Dive Series - AWS IoT Core
https://www.spiceworks.com/tech/iot/articles/what-is-mqtt/

Deep Dive Series - AWS IoT Core

Introduction

Our main objective in this article is to send JSON (JavaScript Object Notation) test payloads from the AWS CLI (Command line Interface) and publish it to a given arbitrary topic (say, “myTopic”)

AWS IoT Core allows IoT devices to communicate with each other through the MQTT (Message Queuing Telemetry Transport) protocol. By subscribing to a specific topic, users can see the JSON data sent from the AWS CLI. The MQTT protocol is a lightweight messaging protocol designed for small sensors and mobile devices, optimised for high-latency and unreliable networks. It operates on a publish/subscribe model, where:

  • Publishers send messages on a topic (e.g., "myTopic").
  • Subscribers can subscribe to one or more topics to receive messages.
  • An MQTT Broker manages message distribution, publishing messages from the publisher to all subscribers of the topic.

STEP BY STEP PROCEDURE:

Our aim is to send the following JASON payload to the IOT core and publish it on the topic named “myTopic”.

JASON payload to send:

"{\"uptime\": 123,\"temp\": 44,\"humidity\": 33}"         

Step 1: Setting up the AWS CLI?

Click on the following link to install the package:

https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html#getting-started-install-instructions

Step 2: Configure the AWS CLI .

Open your terminal or command prompt and run the following commands to verify the installation:

Command 1: aws - -version (to check the version)

?????????????

Command 2: aws - -configure (Here we must provide the Access key Id, Aws secret access key & region Name)

Note: To provide this information we must have created a user profile in AWS.

Follow the next few steps in order to do so.

(First you must Create an Account on AWS)

Step 2.1: Open the AWS and login to your console using the credentials (Email ID and Password)

Step 2.2: ?Go to services > Search for IAM (Identity and Access management)> Access management> Users> Create users

Step 2.3: You can set the username and password of your choice. You can also choose to enable the below option.

Users must create a new password at next sign-in - Recommended”

Clicking on this option will require you to create a new password during the next login.

Step 2.4: In this step, you can attach the “AdministratorAccess” policy to the user.?Click next once done.

Step 2.5: You can review the username and permission summary. You can also add Tags in it (Optional). Select create user once everything is in order.

Step 2.6: You have successfully created a user and you can view the username and password.

Step 2.7: To configure the AWS CLI, we need the AWS Access key and the AWS Secret access key. For that, we must create these credentials.

Step 2.8: Go to Users and select "jayakrishnan", you will see an option called create access key in it. Select the command Line interface, confirm and press next. There you can optionally provide a description for the purpose of this access key and where it will be used.

Step 2.9: Finally, you can obtain the necessary Access key and secret key to configure AWS CLI. You can also download the necessary credential using the Download .csv file menu.

This was the basic setup to get you started. Be sure to stay tuned for the next part!


要查看或添加评论,请登录

Jayakrishnan S的更多文章

社区洞察

其他会员也浏览了