Line 72: Line 72:
 
Now verify whether the policies are attached to newly created thing as shown below.
 
Now verify whether the policies are attached to newly created thing as shown below.
 
[[File:AwsIOT VerifyPolicy.jpg]]
 
[[File:AwsIOT VerifyPolicy.jpg]]
 +
 +
 +
=Testing Using MQTT Fx tool=
 +
As we have a test thing and also the certificates assigned with required policies. We can test it using the MQTT Fx broker tool. Lets list all the info we had while creating the thing and it certificates.
 +
 +
Broker Address / HOST Name:  a3jzsmkecjw9hn.iot.us-west-2.amazonaws.com <br>
 +
Broker Port : 8883
 +
 +
Certificates:<br>
 +
aws-root-ca.pem
 +
certificate.pem.crt
 +
private.pem.key
 +
[[File:MqttFx Setup.jpg]]
 +
<br><br>
 +
 +
[[File:Mqtt Connect.jpg]]
 +
<br><br>
 +
 +
[[File:Mqtt Subscribe.JPG]]
 +
<br><br>
 +
 +
 +
[[File:Mqtt SubscribeSucess.JPG]]
 +
<br><br>
 +
 +
[[File:Mqtt Publish.JPG]]
 +
<br><br>
 +
 +
[[File:Mqtt SubscribeTopicRcvd.JPG]]

Revision as of 19:11, 8 April 2017

In this tutorial we will discuss how to configure the AWS for amazon user account and later we will see how to setup a new things and generate certificates to communicate with your IOT device using AWS MQTT services.

AWS User Account

For using the AWS services you need to have a user account and login using the AWS Login link

Existing users can directly login and directly jump to next. New users should register first and link the credit card for payments. Basic plan is free for first Year, other plans are chargeable. Check this link for available plans. AwsIOT Login page.JPG

Creating a new thing

After Login, click on Signin To Console to go to AWS dash board. Now type AWS IOT and Select the AWS IOT (Connect Devices to Cloud) from drop down as shown below. AwsIOT Start.png

Now the AWS GetStarted Window will open only for the first time. Click on GetStarted to go to dash board. AwsIOT GetStarted.jpg

Click on Register-->Things for registering a new Thing as shown below. AwsIOT registerThing.jpg

Click on Create to create a new Thing. AwsIOT ThingCreate.jpg

Provide a unique Thing name and click on Create to proceed. AwsIOT TestThingName.jpg

myTestThing is SuccessFul created as shown below. AwsIOT ThingCreatedSuccessfully.jpg

Get the MQTT HOST name and thing name from Interact menu. These will be used to connect with AWS MQTT and also to subscribe/publish the topics. AwsIOT ThingInteract.jpg

Generate certificates for new thing

Go to Security menu and click on Create Certificate to register the certificates. AwsIOT ThingCreateCertificate.jpg

Click on the activate button to activate the certificates and download the certificate,private key and root CA as name them as below.

 aws-root-ca.pem 
certificate.pem.crt
private.pem.key

AwsIOT ThingCertActivateSuccess.jpg

Define and Attach Policies

Go do AWS dash board and select the Security-->Policies and click on Create a Policy as shown below. AwsIOT ThingPolicyCreate.jpg

Define the policy for myTestThing as shown below AwsIOT ThingPolicyDefine.jpg

Now go back to Certificates and attach the policy that was defined above AwsIOT ThingPolicyAttach.jpg

Select the thing and attach the policies define above. AwsIOT ThingPolicyAttach 1.jpg


Verify the Attached Policies

Now verify whether the policies are attached to newly created thing as shown below. AwsIOT VerifyPolicy.jpg


Testing Using MQTT Fx tool

As we have a test thing and also the certificates assigned with required policies. We can test it using the MQTT Fx broker tool. Lets list all the info we had while creating the thing and it certificates.

Broker Address / HOST Name: a3jzsmkecjw9hn.iot.us-west-2.amazonaws.com
Broker Port : 8883

Certificates:
aws-root-ca.pem certificate.pem.crt private.pem.key MqttFx Setup.jpg

Mqtt Connect.jpg

Mqtt Subscribe.JPG


Mqtt SubscribeSucess.JPG

Mqtt Publish.JPG

Mqtt SubscribeTopicRcvd.JPG