Step by step guide on IoT data synchronization …...Step by step guide on IoT data synchronization...

25
Step by step guide on IoT data synchronization using MQTT APIIT Education Group Center of Technology and Innovation Mustafa Mabrook

Transcript of Step by step guide on IoT data synchronization …...Step by step guide on IoT data synchronization...

Page 1: Step by step guide on IoT data synchronization …...Step by step guide on IoT data synchronization using MQTT APIIT Education Group Centerof Technology and Innovation MustafaMabrook

Step by step guide on IoT data

synchronization using MQTTAPIIT Education Group

Center of Technology and InnovationMustafa Mabrook

Page 2: Step by step guide on IoT data synchronization …...Step by step guide on IoT data synchronization using MQTT APIIT Education Group Centerof Technology and Innovation MustafaMabrook

Topics & Structure of the report

u Create an IoT thing

u Add a certificate to the created thing

u Add a new policy and attach it to the created certificate

u Subscribe to an IoT topic

u Connect to the thing via a python script

u Publish data to the subscribed topic

u Add an action on receiving an event (Insert to DynamoDB)

Page 3: Step by step guide on IoT data synchronization …...Step by step guide on IoT data synchronization using MQTT APIIT Education Group Centerof Technology and Innovation MustafaMabrook

Creating an IoT Thing

1. Navigate to the AWS IoT from AWS console

Page 4: Step by step guide on IoT data synchronization …...Step by step guide on IoT data synchronization using MQTT APIIT Education Group Centerof Technology and Innovation MustafaMabrook

Creating an IoT Thing2. Navigate to Manage Things option and then click on create button

Page 5: Step by step guide on IoT data synchronization …...Step by step guide on IoT data synchronization using MQTT APIIT Education Group Centerof Technology and Innovation MustafaMabrook

Creating an IoT Thing3. Choose “Create a single thing” option

Page 6: Step by step guide on IoT data synchronization …...Step by step guide on IoT data synchronization using MQTT APIIT Education Group Centerof Technology and Innovation MustafaMabrook

Creating an IoT Thing4. Key in the thing name, choose the thing group if any and then click next

Page 7: Step by step guide on IoT data synchronization …...Step by step guide on IoT data synchronization using MQTT APIIT Education Group Centerof Technology and Innovation MustafaMabrook

Add a certificate to the created thing1. Choose “Create certificate” option

Page 8: Step by step guide on IoT data synchronization …...Step by step guide on IoT data synchronization using MQTT APIIT Education Group Centerof Technology and Innovation MustafaMabrook

Add a certificate to the created thing2. Download the created certificate, the public key, the private key, and root CA

Page 9: Step by step guide on IoT data synchronization …...Step by step guide on IoT data synchronization using MQTT APIIT Education Group Centerof Technology and Innovation MustafaMabrook

Add a certificate to the created thing3. Activate the root CA and then click Done

Page 10: Step by step guide on IoT data synchronization …...Step by step guide on IoT data synchronization using MQTT APIIT Education Group Centerof Technology and Innovation MustafaMabrook

Add a new policy

1. Navigate to “Secure” menu option and then select “Policies”

2. Click on the “Create” button to create a new policy

Page 11: Step by step guide on IoT data synchronization …...Step by step guide on IoT data synchronization using MQTT APIIT Education Group Centerof Technology and Innovation MustafaMabrook

Add a new policy3. Key in the policy name and specify the action and the resource ARN4. Choose the appropriate effect and click create

Page 12: Step by step guide on IoT data synchronization …...Step by step guide on IoT data synchronization using MQTT APIIT Education Group Centerof Technology and Innovation MustafaMabrook

Attach the created policy to the certificate1. Navigate to “Secure” menu option and then select “Certificates”2. Select the created certificate and navigate to “Policies”3. From the “Actions” option, select the “Attach policy” option

Page 13: Step by step guide on IoT data synchronization …...Step by step guide on IoT data synchronization using MQTT APIIT Education Group Centerof Technology and Innovation MustafaMabrook

Attach the created policy to the certificate4. Select the created policy which is “test” in this case and click “Attach”

Page 14: Step by step guide on IoT data synchronization …...Step by step guide on IoT data synchronization using MQTT APIIT Education Group Centerof Technology and Innovation MustafaMabrook

Subscribe to an IoT topicKey in the topic name, choose a QoS, choose the MQTT payload format and thenClick “Subscribe to topic”

1.

Page 15: Step by step guide on IoT data synchronization …...Step by step guide on IoT data synchronization using MQTT APIIT Education Group Centerof Technology and Innovation MustafaMabrook

Subscribe to an IoT topic2. Keep the window open and move on to the next step which is connection to

the thing via a python script

Page 16: Step by step guide on IoT data synchronization …...Step by step guide on IoT data synchronization using MQTT APIIT Education Group Centerof Technology and Innovation MustafaMabrook

Connect to the thing via a python script1. Use the following script to connect to the created thing using the appropriate

account’s endpoint and the downloaded certificates/keys2. Call the sync function and pass the topic name and the message to be sent

Note: The endpoint can be found in the “Settings” menu option in the bottom left corner

Page 17: Step by step guide on IoT data synchronization …...Step by step guide on IoT data synchronization using MQTT APIIT Education Group Centerof Technology and Innovation MustafaMabrook

Connect to the thing via a python script3. Go back to the AWS console to see the sent message

Page 18: Step by step guide on IoT data synchronization …...Step by step guide on IoT data synchronization using MQTT APIIT Education Group Centerof Technology and Innovation MustafaMabrook

Add an action on receiving an event1. Navigate to the “Act” menu option and then click “Create”

Page 19: Step by step guide on IoT data synchronization …...Step by step guide on IoT data synchronization using MQTT APIIT Education Group Centerof Technology and Innovation MustafaMabrook

Add an action on receiving an event2. Key in the rule name, the attribute, and the topic name (Make sure the topic name

is the same one we published to)

Page 20: Step by step guide on IoT data synchronization …...Step by step guide on IoT data synchronization using MQTT APIIT Education Group Centerof Technology and Innovation MustafaMabrook

Add an action on receiving an event3. Click on “Add action” and choose (Invoke a Lambda function option)

Page 21: Step by step guide on IoT data synchronization …...Step by step guide on IoT data synchronization using MQTT APIIT Education Group Centerof Technology and Innovation MustafaMabrook

Add an action on receiving an event4. Choose the lambda function name to be executed from the dropdown list and click

on “Add action”

Page 22: Step by step guide on IoT data synchronization …...Step by step guide on IoT data synchronization using MQTT APIIT Education Group Centerof Technology and Innovation MustafaMabrook

Lambda function code sample

Page 23: Step by step guide on IoT data synchronization …...Step by step guide on IoT data synchronization using MQTT APIIT Education Group Centerof Technology and Innovation MustafaMabrook

View the DynamoDB table

Page 24: Step by step guide on IoT data synchronization …...Step by step guide on IoT data synchronization using MQTT APIIT Education Group Centerof Technology and Innovation MustafaMabrook

Q&A

Page 25: Step by step guide on IoT data synchronization …...Step by step guide on IoT data synchronization using MQTT APIIT Education Group Centerof Technology and Innovation MustafaMabrook

Thank You