SlideShare a Scribd company logo
1 of 31
AWS & Raspberry Pi
Please Follow my Youtube Account for video tutorials.
http://www.youtube.com/c/FaisalMehmoodAvan
Also follow me on my LinkedIn Account
https://kr.linkedin.com/in/faisalavan
Contact Information:
Phone: +82-10-6876-6805
Email: FAISAL.AVAN@HOTMAIL.COM
Table of Contents
S.No Topic
1. Sign in to the AWS IoT Console
2. Create and Attach a Thing (Device)
3. Set Up the Runtime Environment for the AWS IoT Embedded C SDK
4. Sample App Configuration
5. Run Sample Applications
6. Send sensing data to AWS
Sign in to the AWS IoT Console (1/3)
1. Install Raspbian OS on SD card and insert it in Raspberry Pi
2. Power ON Raspberry pi and confirm you have an Internet
connection.
3. Sign in to the AWS Management Console and choose AWS IoT
service.
4. https://us-east-2.console.aws.amazon.com/iotv2/home?region=us-
east-2#/dashboard
5. If this is your first time using the AWS IoT console, you will see the
Welcome to the AWS IoT Console page. In the left navigation pane,
choose Registry to expand the choices, and then choose Things.
Sign in to the AWS IoT Console (2/3)
4. If its first time, then there are no things in this section.
On the page that says You don't have any things yet, choose Register a thing.
Click Learn More to how to register a thing.
Register and Manage IoT Things
IoT thing Registration
Sign in to the AWS IoT Console (3/3)
4. If you want to create a new thing, Click Create
On the left side there is list of Created Things
You can View and Edit Things that are already created.
List of Created Things
Click to Create New Thing
Create and Attach a Thing (Device) (1/12)
A thing represents a device whose status or data is stored in the AWS cloud.
The Thing Shadows service maintains a thing shadow for each device
connected to AWS IoT. Thing shadows allow you to access and modify thing
state data.
1. Type a name for the thing, and then choose Create thing.
Enter Name for Thing
If you are new to Thing, then Hide Other
Options,
Create and Attach a Thing (Device) (2/12)
2. On the Details page, choose Interact.
Every new Thing created is assigned a unique address.
In this case arn:aws:iot:us-east-2:213604715346:thing/MyraspberryPi is the
unique address of Thing
Unique Identifier: Unique address of
newly created thing
Create and Attach a Thing (Device) (3/12)
3. Make a note of the REST API endpoint. You will need this value later.
Choose Security.
Update thing using Rest API endpoint
Create and Attach a Thing (Device) (4/12)
4. Choose Create certificate. This will generate an X.509 certificate and
key pair.
Certificates are for secure connection
Create and Attach a Thing (Device) (5/12)
5. Create a working directory called deviceSDK where your files will be
stored. Choose the links to download your public and private keys,
certificate, and root CA and save them in the deviceSDK directory. Choose
Activate to activate the X.509 certificate, then choose Attach a policy.
Download public, private and certificate
files and Place it in multiple places for
backup
Click to Attach a Policy to newly
activated certificate
First click Activate, Then click Attach a
policy
Create and Attach a Thing (Device) (6/12)
6. Choose Create new policy.
By default there are no Policies, Click
create new policy to add a policy
After creating Policy, Click Done
Create and Attach a Thing (Device) (7/12)
7. On the Create a policy page, in the Name field, type a name for the
policy. In the Action field, type iot:*. In the Resource ARN field, type *.
Select the Allow check box. This allows your Raspberry Pi to publish
messages to AWS IoT.
8. Choose Create.
Unique and Meaningful Name of
Policy
By enabling, it will allow raspberry pi
to publish message to AWS IoT Thing
Create and Attach a Thing (Device) (8/12)
9. In the left navigation pane, under Security, choose Certificates.
You can list Active Certificates. Attach IoT Things and Policies to
Certificates.
List of Certificates
Create and Attach a Thing (Device) (9/12)
10. In the box for the certificate you created, choose ... to open a drop-
down menu, and then choose Attach policy.
Attach the required Policies from list
Create and Attach a Thing (Device) (10/12)
11. In the Attach policies to certificate(s) dialog box, select the check
box next to the policy you created, and then choose Attach.
Select the policy from the list and Click Attach
Create and Attach a Thing (Device) (11/12)
12. In the box for the certificate you created, choose ... to open a drop-
down menu, and then choose Attach thing.
Attach the required Thing from list
Create and Attach a Thing (Device) (12/12)
13. In the Attach things to certificate(s) dialog box, select the check
box next to the thing you created to represent your Raspberry Pi, and
then choose Attach.
Select the Thing from the list and Click Attach
Setting Runtime Environment for the AWS IoT Embedded C SDK
1. Download the AWS IoT Device SDK for C from the following GitHub repository:
git clone https://github.com/aws/aws-iot-device-sdk-embedded-C.git –b release
2. Before you can use the AWS IoT Embedded C SDK, you must download all
required third-party libraries from GitHub.
Instructions:
You can find instructions for doing this in the deviceSDK/external_libs folder.
Sample App Configuration (1/3)
The AWS IoT Embedded C SDK includes sample apps for you to try. For
simplicity, we are going to run subscribe_publish_sample.
1. Copy your certificate, private key and root CA certificate into the
deviceSDK/certs directory.
2. Refer to Slide 10, for private key and certificate
Note:
Device and root CA certificates are subject to expiration and/or
revocation. If this should occur, you will need to copy new a CA
certificate or a new private key and device certificate onto your device.
Locate These files and copy to deviceSDK/certs folder
Sample App Configuration (2/3)
2. Navigate to the deviceSDK/samples/linux/subscribe_publish_sample directory. You will
need to configure your personal endpoint, private key, and certificate. The personal
endpoint is the REST API endpoint you noted earlier. Refer to slide 10 to find out
REST API endpoint.
If you don't remember the endpoint and you have access to a machine with the
AWS CLI installed, you can use the aws iot describe-endpoint command to find your
personal endpoint URL.
Or, go to the AWS IoT console. Choose Manage, choose Things, and then choose
the thing that represents your Raspberry Pi. On the Details page for the thing, in
the left navigation pane, choose Interact. Copy everything, including ".com", from
REST API endpoint.
Sample App Configuration (3/3)
3. Open the aws_iot_config.h file and, in the //Get from console section,
update the values for the following:
AWS_IOT_MQTT_HOST -- Your personal endpoint.
AWS_IOT_MY_THING_NAME -- Your thing name.
AWS_IOT_ROOT_CA_FILENAME -- Your root CA certificate.
AWS_IOT_CERTIFICATE_FILENAME -- Your certificate.
AWS_IOT_PRIVATE_KEY_FILENAME -- Your private key.
Run Sample Applications (1/2)
1. Compile the subscribe_publish_sample app using the included makefile.
make -f Makefile
This will generate an executable file.
… …
Run Sample Applications (2/2)
2. Run the subscribe_publish_sample_app. You should see output similar to
the following:
Your Raspberry Pi is now connected to AWS IoT using the AWS IoT Device
SDK for C.
Send sensing data to AWS (1/6)
1. Install AWS IoT Python SDK.
> git clone https://github.com/aws/aws-iot-device-sdk-python
> cd aws-iot-device-sdk-python
> sudo python setup.py install
The following successful message should be seen, otherwise run the
last step again.
Running install
…
Running install_egg_info
Removing…
Writing /usr/local/…
Send sensing data to AWS (2/6)
2. In AWS IoT platform, click Test and Subscribe to a topic, input
“thing01/data”, make a note for the MQTT client ID.
Send sensing data to AWS (3/6)
3. Connect the DHT11 sensor to the Raspberry Pi.
Send sensing data to AWS (4/6)
4. Download DHT11 Python library and create our script that will read data from
the sensor and publish to AWS IoT.
> git clone https://github.com/szazo/DHT11_Python
> cd DHT11_Python > vi read_and_publish.py
Send sensing data to AWS (5/6)
5. Run the script and check the result in AWS IoT Platform.
Python script result:
Send sensing data to AWS (6/6)
AWS IoT Platform result:
Contact Information
Please Follow my Youtube Account for video tutorials.
http://www.youtube.com/c/FaisalMehmoodAvan
Also follow me on my LinkedIn Account
https://kr.linkedin.com/in/faisalavan
Contact Information:
Phone: +82-10-6876-6805
Email: FAISAL.AVAN@HOTMAIL.COM
Thnk
You

More Related Content

What's hot

Setting up your virtual infrastructure using fi lab cloud webminar
Setting up your virtual infrastructure using fi lab cloud webminarSetting up your virtual infrastructure using fi lab cloud webminar
Setting up your virtual infrastructure using fi lab cloud webminar
Henar Muñoz Frutos
 
Configuring cisco asa and pix firewalls part2
Configuring cisco asa and pix firewalls part2Configuring cisco asa and pix firewalls part2
Configuring cisco asa and pix firewalls part2
IT Tech
 

What's hot (15)

EE5111 a0195042 j_iot_project_report_update
EE5111 a0195042 j_iot_project_report_updateEE5111 a0195042 j_iot_project_report_update
EE5111 a0195042 j_iot_project_report_update
 
PowerShell: A Language for the Internet of Things #ATLPUG
PowerShell: A Language for the Internet of Things #ATLPUGPowerShell: A Language for the Internet of Things #ATLPUG
PowerShell: A Language for the Internet of Things #ATLPUG
 
Setting up your virtual infrastructure using fi lab cloud webminar
Setting up your virtual infrastructure using fi lab cloud webminarSetting up your virtual infrastructure using fi lab cloud webminar
Setting up your virtual infrastructure using fi lab cloud webminar
 
Configure & send push notification on i os device
Configure & send push notification on i os deviceConfigure & send push notification on i os device
Configure & send push notification on i os device
 
Configuring cisco asa and pix firewalls part2
Configuring cisco asa and pix firewalls part2Configuring cisco asa and pix firewalls part2
Configuring cisco asa and pix firewalls part2
 
IoT Workshop in Macao
IoT Workshop in MacaoIoT Workshop in Macao
IoT Workshop in Macao
 
Advanced Container Security - AWS Summit Sydney 2018
Advanced Container Security - AWS Summit Sydney 2018Advanced Container Security - AWS Summit Sydney 2018
Advanced Container Security - AWS Summit Sydney 2018
 
Fiware cloud developers week brussels
Fiware cloud developers week brusselsFiware cloud developers week brussels
Fiware cloud developers week brussels
 
Project Pt1
Project Pt1Project Pt1
Project Pt1
 
Introducing Gridiron Security and Compliance Management Platform and Enclave ...
Introducing Gridiron Security and Compliance Management Platform and Enclave ...Introducing Gridiron Security and Compliance Management Platform and Enclave ...
Introducing Gridiron Security and Compliance Management Platform and Enclave ...
 
Installing WordPress on AWS
Installing WordPress on AWSInstalling WordPress on AWS
Installing WordPress on AWS
 
sfdx continuous Integration with Jenkins on aws (Part II)
sfdx continuous Integration with Jenkins on aws (Part II)sfdx continuous Integration with Jenkins on aws (Part II)
sfdx continuous Integration with Jenkins on aws (Part II)
 
February EPD Webinar: How do I...use PiCloud for cloud computing?
February EPD Webinar: How do I...use PiCloud for cloud computing?February EPD Webinar: How do I...use PiCloud for cloud computing?
February EPD Webinar: How do I...use PiCloud for cloud computing?
 
sfdx continuous Integration with Jenkins on aws (Part I)
sfdx continuous Integration with Jenkins on aws (Part I)sfdx continuous Integration with Jenkins on aws (Part I)
sfdx continuous Integration with Jenkins on aws (Part I)
 
Service Configuration Management for Rapid Growth
Service Configuration Management for Rapid GrowthService Configuration Management for Rapid Growth
Service Configuration Management for Rapid Growth
 

Similar to Raspberry pi and AWS

Microsoft.certleader.az 220.free.pdf.2020-may-30.by.tony.0q.vce (1)
Microsoft.certleader.az 220.free.pdf.2020-may-30.by.tony.0q.vce (1)Microsoft.certleader.az 220.free.pdf.2020-may-30.by.tony.0q.vce (1)
Microsoft.certleader.az 220.free.pdf.2020-may-30.by.tony.0q.vce (1)
Rajesh Anbalagan
 

Similar to Raspberry pi and AWS (20)

Microsoft.certleader.az 220.free.pdf.2020-may-30.by.tony.0q.vce (1)
Microsoft.certleader.az 220.free.pdf.2020-may-30.by.tony.0q.vce (1)Microsoft.certleader.az 220.free.pdf.2020-may-30.by.tony.0q.vce (1)
Microsoft.certleader.az 220.free.pdf.2020-may-30.by.tony.0q.vce (1)
 
AmazonRTOS - Antonio Luciano
AmazonRTOS - Antonio LucianoAmazonRTOS - Antonio Luciano
AmazonRTOS - Antonio Luciano
 
A step by step guide to develop temperature sensor io t application using ibm...
A step by step guide to develop temperature sensor io t application using ibm...A step by step guide to develop temperature sensor io t application using ibm...
A step by step guide to develop temperature sensor io t application using ibm...
 
Building Better IoT Applications without Servers
Building Better IoT Applications without ServersBuilding Better IoT Applications without Servers
Building Better IoT Applications without Servers
 
Aws iot
Aws iotAws iot
Aws iot
 
Getting Started with AWS IoT
Getting Started with AWS IoTGetting Started with AWS IoT
Getting Started with AWS IoT
 
Azure hands on lab
Azure hands on labAzure hands on lab
Azure hands on lab
 
ESM 6.9.1 for AWS Setup Guide
ESM 6.9.1 for AWS Setup GuideESM 6.9.1 for AWS Setup Guide
ESM 6.9.1 for AWS Setup Guide
 
Open Source for You: Etherios Cloud Connector
Open Source for You: Etherios Cloud ConnectorOpen Source for You: Etherios Cloud Connector
Open Source for You: Etherios Cloud Connector
 
AWS DataSync.pdf
AWS DataSync.pdfAWS DataSync.pdf
AWS DataSync.pdf
 
AWS Lambda Hands-on: How to Create Phone Call Notifications in a Serverless Way
 AWS Lambda Hands-on: How to Create Phone Call Notifications in a Serverless Way AWS Lambda Hands-on: How to Create Phone Call Notifications in a Serverless Way
AWS Lambda Hands-on: How to Create Phone Call Notifications in a Serverless Way
 
AWS Lambda Hands-on: How to Create Phone Call Notifications in a Serverless W...
AWS Lambda Hands-on: How to Create Phone Call Notifications in a Serverless W...AWS Lambda Hands-on: How to Create Phone Call Notifications in a Serverless W...
AWS Lambda Hands-on: How to Create Phone Call Notifications in a Serverless W...
 
AWS_IoT_Device_Management_Workshop.pptx
AWS_IoT_Device_Management_Workshop.pptxAWS_IoT_Device_Management_Workshop.pptx
AWS_IoT_Device_Management_Workshop.pptx
 
RICOH THETA x IoT Developers Contest : Cloud API Seminar
 RICOH THETA x IoT Developers Contest : Cloud API Seminar RICOH THETA x IoT Developers Contest : Cloud API Seminar
RICOH THETA x IoT Developers Contest : Cloud API Seminar
 
Web + AWS + IoT, how to
Web + AWS + IoT, how to Web + AWS + IoT, how to
Web + AWS + IoT, how to
 
Asset Model Import FlexConnector Developer's Guide
Asset Model Import FlexConnector Developer's GuideAsset Model Import FlexConnector Developer's Guide
Asset Model Import FlexConnector Developer's Guide
 
Titanium Studio [Updated - 18/12/2011]
Titanium Studio [Updated - 18/12/2011]Titanium Studio [Updated - 18/12/2011]
Titanium Studio [Updated - 18/12/2011]
 
Masterless Puppet Using AWS S3 Buckets and IAM Roles
Masterless Puppet Using AWS S3 Buckets and IAM RolesMasterless Puppet Using AWS S3 Buckets and IAM Roles
Masterless Puppet Using AWS S3 Buckets and IAM Roles
 
Accelerating your application development with IBM BlueMix (Your dream devel...
Accelerating your application development with IBM BlueMix (Your dream devel...Accelerating your application development with IBM BlueMix (Your dream devel...
Accelerating your application development with IBM BlueMix (Your dream devel...
 
Python3 (boto3) for aws
Python3 (boto3) for awsPython3 (boto3) for aws
Python3 (boto3) for aws
 

More from Faisal Mehmood (20)

Raspbian Noobs
Raspbian NoobsRaspbian Noobs
Raspbian Noobs
 
Lecture 44
Lecture 44Lecture 44
Lecture 44
 
Lecture 37 cond prob
Lecture 37 cond probLecture 37 cond prob
Lecture 37 cond prob
 
Lecture 20 combinatorics o
Lecture 20 combinatorics oLecture 20 combinatorics o
Lecture 20 combinatorics o
 
Lecture 36 laws of prob
Lecture 36 laws of probLecture 36 laws of prob
Lecture 36 laws of prob
 
Lecture 36
Lecture 36 Lecture 36
Lecture 36
 
Lecture 35 prob
Lecture 35 probLecture 35 prob
Lecture 35 prob
 
Lecture 27
Lecture 27Lecture 27
Lecture 27
 
Lecture 26
Lecture 26Lecture 26
Lecture 26
 
Lecture 25
Lecture 25Lecture 25
Lecture 25
 
Lecture 24
Lecture 24Lecture 24
Lecture 24
 
Lecture 22
Lecture 22Lecture 22
Lecture 22
 
Lecture 21
Lecture 21Lecture 21
Lecture 21
 
Lecture 20
Lecture 20Lecture 20
Lecture 20
 
Lecture 19 counting
Lecture 19 countingLecture 19 counting
Lecture 19 counting
 
Lecture 18 recursion
Lecture 18 recursionLecture 18 recursion
Lecture 18 recursion
 
Lecture 17 induction
Lecture 17 inductionLecture 17 induction
Lecture 17 induction
 
Lecture 16 SERIES
Lecture 16  SERIESLecture 16  SERIES
Lecture 16 SERIES
 
Lecture 15 sequences
Lecture 15 sequencesLecture 15 sequences
Lecture 15 sequences
 
Lecture 14(d)
Lecture 14(d)Lecture 14(d)
Lecture 14(d)
 

Recently uploaded

Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptx
pritamlangde
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
HenryBriggs2
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Kandungan 087776558899
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 

Recently uploaded (20)

PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and properties
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptx
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Learn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic MarksLearn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic Marks
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 

Raspberry pi and AWS

  • 1. AWS & Raspberry Pi Please Follow my Youtube Account for video tutorials. http://www.youtube.com/c/FaisalMehmoodAvan Also follow me on my LinkedIn Account https://kr.linkedin.com/in/faisalavan Contact Information: Phone: +82-10-6876-6805 Email: FAISAL.AVAN@HOTMAIL.COM
  • 2. Table of Contents S.No Topic 1. Sign in to the AWS IoT Console 2. Create and Attach a Thing (Device) 3. Set Up the Runtime Environment for the AWS IoT Embedded C SDK 4. Sample App Configuration 5. Run Sample Applications 6. Send sensing data to AWS
  • 3. Sign in to the AWS IoT Console (1/3) 1. Install Raspbian OS on SD card and insert it in Raspberry Pi 2. Power ON Raspberry pi and confirm you have an Internet connection. 3. Sign in to the AWS Management Console and choose AWS IoT service. 4. https://us-east-2.console.aws.amazon.com/iotv2/home?region=us- east-2#/dashboard 5. If this is your first time using the AWS IoT console, you will see the Welcome to the AWS IoT Console page. In the left navigation pane, choose Registry to expand the choices, and then choose Things.
  • 4. Sign in to the AWS IoT Console (2/3) 4. If its first time, then there are no things in this section. On the page that says You don't have any things yet, choose Register a thing. Click Learn More to how to register a thing. Register and Manage IoT Things IoT thing Registration
  • 5. Sign in to the AWS IoT Console (3/3) 4. If you want to create a new thing, Click Create On the left side there is list of Created Things You can View and Edit Things that are already created. List of Created Things Click to Create New Thing
  • 6. Create and Attach a Thing (Device) (1/12) A thing represents a device whose status or data is stored in the AWS cloud. The Thing Shadows service maintains a thing shadow for each device connected to AWS IoT. Thing shadows allow you to access and modify thing state data. 1. Type a name for the thing, and then choose Create thing. Enter Name for Thing If you are new to Thing, then Hide Other Options,
  • 7. Create and Attach a Thing (Device) (2/12) 2. On the Details page, choose Interact. Every new Thing created is assigned a unique address. In this case arn:aws:iot:us-east-2:213604715346:thing/MyraspberryPi is the unique address of Thing Unique Identifier: Unique address of newly created thing
  • 8. Create and Attach a Thing (Device) (3/12) 3. Make a note of the REST API endpoint. You will need this value later. Choose Security. Update thing using Rest API endpoint
  • 9. Create and Attach a Thing (Device) (4/12) 4. Choose Create certificate. This will generate an X.509 certificate and key pair. Certificates are for secure connection
  • 10. Create and Attach a Thing (Device) (5/12) 5. Create a working directory called deviceSDK where your files will be stored. Choose the links to download your public and private keys, certificate, and root CA and save them in the deviceSDK directory. Choose Activate to activate the X.509 certificate, then choose Attach a policy. Download public, private and certificate files and Place it in multiple places for backup Click to Attach a Policy to newly activated certificate First click Activate, Then click Attach a policy
  • 11. Create and Attach a Thing (Device) (6/12) 6. Choose Create new policy. By default there are no Policies, Click create new policy to add a policy After creating Policy, Click Done
  • 12. Create and Attach a Thing (Device) (7/12) 7. On the Create a policy page, in the Name field, type a name for the policy. In the Action field, type iot:*. In the Resource ARN field, type *. Select the Allow check box. This allows your Raspberry Pi to publish messages to AWS IoT. 8. Choose Create. Unique and Meaningful Name of Policy By enabling, it will allow raspberry pi to publish message to AWS IoT Thing
  • 13. Create and Attach a Thing (Device) (8/12) 9. In the left navigation pane, under Security, choose Certificates. You can list Active Certificates. Attach IoT Things and Policies to Certificates. List of Certificates
  • 14. Create and Attach a Thing (Device) (9/12) 10. In the box for the certificate you created, choose ... to open a drop- down menu, and then choose Attach policy. Attach the required Policies from list
  • 15. Create and Attach a Thing (Device) (10/12) 11. In the Attach policies to certificate(s) dialog box, select the check box next to the policy you created, and then choose Attach. Select the policy from the list and Click Attach
  • 16. Create and Attach a Thing (Device) (11/12) 12. In the box for the certificate you created, choose ... to open a drop- down menu, and then choose Attach thing. Attach the required Thing from list
  • 17. Create and Attach a Thing (Device) (12/12) 13. In the Attach things to certificate(s) dialog box, select the check box next to the thing you created to represent your Raspberry Pi, and then choose Attach. Select the Thing from the list and Click Attach
  • 18. Setting Runtime Environment for the AWS IoT Embedded C SDK 1. Download the AWS IoT Device SDK for C from the following GitHub repository: git clone https://github.com/aws/aws-iot-device-sdk-embedded-C.git –b release 2. Before you can use the AWS IoT Embedded C SDK, you must download all required third-party libraries from GitHub. Instructions: You can find instructions for doing this in the deviceSDK/external_libs folder.
  • 19. Sample App Configuration (1/3) The AWS IoT Embedded C SDK includes sample apps for you to try. For simplicity, we are going to run subscribe_publish_sample. 1. Copy your certificate, private key and root CA certificate into the deviceSDK/certs directory. 2. Refer to Slide 10, for private key and certificate Note: Device and root CA certificates are subject to expiration and/or revocation. If this should occur, you will need to copy new a CA certificate or a new private key and device certificate onto your device. Locate These files and copy to deviceSDK/certs folder
  • 20. Sample App Configuration (2/3) 2. Navigate to the deviceSDK/samples/linux/subscribe_publish_sample directory. You will need to configure your personal endpoint, private key, and certificate. The personal endpoint is the REST API endpoint you noted earlier. Refer to slide 10 to find out REST API endpoint. If you don't remember the endpoint and you have access to a machine with the AWS CLI installed, you can use the aws iot describe-endpoint command to find your personal endpoint URL. Or, go to the AWS IoT console. Choose Manage, choose Things, and then choose the thing that represents your Raspberry Pi. On the Details page for the thing, in the left navigation pane, choose Interact. Copy everything, including ".com", from REST API endpoint.
  • 21. Sample App Configuration (3/3) 3. Open the aws_iot_config.h file and, in the //Get from console section, update the values for the following: AWS_IOT_MQTT_HOST -- Your personal endpoint. AWS_IOT_MY_THING_NAME -- Your thing name. AWS_IOT_ROOT_CA_FILENAME -- Your root CA certificate. AWS_IOT_CERTIFICATE_FILENAME -- Your certificate. AWS_IOT_PRIVATE_KEY_FILENAME -- Your private key.
  • 22. Run Sample Applications (1/2) 1. Compile the subscribe_publish_sample app using the included makefile. make -f Makefile This will generate an executable file. … …
  • 23. Run Sample Applications (2/2) 2. Run the subscribe_publish_sample_app. You should see output similar to the following: Your Raspberry Pi is now connected to AWS IoT using the AWS IoT Device SDK for C.
  • 24. Send sensing data to AWS (1/6) 1. Install AWS IoT Python SDK. > git clone https://github.com/aws/aws-iot-device-sdk-python > cd aws-iot-device-sdk-python > sudo python setup.py install The following successful message should be seen, otherwise run the last step again. Running install … Running install_egg_info Removing… Writing /usr/local/…
  • 25. Send sensing data to AWS (2/6) 2. In AWS IoT platform, click Test and Subscribe to a topic, input “thing01/data”, make a note for the MQTT client ID.
  • 26. Send sensing data to AWS (3/6) 3. Connect the DHT11 sensor to the Raspberry Pi.
  • 27. Send sensing data to AWS (4/6) 4. Download DHT11 Python library and create our script that will read data from the sensor and publish to AWS IoT. > git clone https://github.com/szazo/DHT11_Python > cd DHT11_Python > vi read_and_publish.py
  • 28. Send sensing data to AWS (5/6) 5. Run the script and check the result in AWS IoT Platform. Python script result:
  • 29. Send sensing data to AWS (6/6) AWS IoT Platform result:
  • 30. Contact Information Please Follow my Youtube Account for video tutorials. http://www.youtube.com/c/FaisalMehmoodAvan Also follow me on my LinkedIn Account https://kr.linkedin.com/in/faisalavan Contact Information: Phone: +82-10-6876-6805 Email: FAISAL.AVAN@HOTMAIL.COM