step by step guide on iot data synchronization …...step by step guide on iot data synchronization...
TRANSCRIPT
![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](https://reader030.vdocument.in/reader030/viewer/2022041106/5f07f87b7e708231d41fad7d/html5/thumbnails/1.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022041106/5f07f87b7e708231d41fad7d/html5/thumbnails/2.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022041106/5f07f87b7e708231d41fad7d/html5/thumbnails/3.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022041106/5f07f87b7e708231d41fad7d/html5/thumbnails/4.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022041106/5f07f87b7e708231d41fad7d/html5/thumbnails/5.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022041106/5f07f87b7e708231d41fad7d/html5/thumbnails/6.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022041106/5f07f87b7e708231d41fad7d/html5/thumbnails/7.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022041106/5f07f87b7e708231d41fad7d/html5/thumbnails/8.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022041106/5f07f87b7e708231d41fad7d/html5/thumbnails/9.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022041106/5f07f87b7e708231d41fad7d/html5/thumbnails/10.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022041106/5f07f87b7e708231d41fad7d/html5/thumbnails/11.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022041106/5f07f87b7e708231d41fad7d/html5/thumbnails/12.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022041106/5f07f87b7e708231d41fad7d/html5/thumbnails/13.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022041106/5f07f87b7e708231d41fad7d/html5/thumbnails/14.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022041106/5f07f87b7e708231d41fad7d/html5/thumbnails/15.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022041106/5f07f87b7e708231d41fad7d/html5/thumbnails/16.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022041106/5f07f87b7e708231d41fad7d/html5/thumbnails/17.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022041106/5f07f87b7e708231d41fad7d/html5/thumbnails/18.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022041106/5f07f87b7e708231d41fad7d/html5/thumbnails/19.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022041106/5f07f87b7e708231d41fad7d/html5/thumbnails/20.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022041106/5f07f87b7e708231d41fad7d/html5/thumbnails/21.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022041106/5f07f87b7e708231d41fad7d/html5/thumbnails/22.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022041106/5f07f87b7e708231d41fad7d/html5/thumbnails/23.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022041106/5f07f87b7e708231d41fad7d/html5/thumbnails/24.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022041106/5f07f87b7e708231d41fad7d/html5/thumbnails/25.jpg)
Thank You