Cloud Tutorial: AWS IoT
CSE 520S Spring,
- Jan. 16, 2020
Cloud Tutorial: AWS IoT CSE 520S Spring, Jan. 16, 2020 Ruixuan Dai - - PowerPoint PPT Presentation
Cloud Tutorial: AWS IoT CSE 520S Spring, Jan. 16, 2020 Ruixuan Dai XaaS: Basics in Cloud Computing Cloud Computing Cloud computing provides shared pool of configurable computing resource to end users on demand Three service models q IaaS
1/16/20
3
q IaaS (Infrastructure as a Service): virtual machines, storage,
q PaaS (Platform as a Service): execution runtime, middleware,
q SaaS (Software as a Service): email, virtual desktop, games …
Ø installed and runs on personal computer Ø You Manage and Deploy
q Hardware q OS q Software
Ø Example
q This presentation
1/16/20
4
APP Data Runtime Middleware OS Virtualization Server Storage Network You Manage
q "physical server box” q Virtual Machine
q AWS EC2 q AWS EFS
q Build up you
1/16/20
5
You Manage APP Data Runtime Middleware OS Virtualization Server Storage Network Service Provider Manages
Web Service
q You get a framework q Host Application q Tools
q AWS IoT
q Build up you’re smart A/C
1/16/20
6
You Manage Service Provider Manages APP Data Runtime Middleware OS Virtualization Server Storage Network
1/16/20
7
The essence is MESSAGING MIDDLEWARE Send messages between sensors and servers…
q You get a whole solution
q Gmail q Dropbox q Office365
1/16/20
8
Service Provider Manages APP Data Runtime Middleware OS Virtualization Server Storage Network
1/16/20
9
APP Data Runtime Middleware OS Virtualization Server Storage Network You Manage You Manage APP Data Runtime Middleware OS Virtualization Server Storage Network Service Provider Manages You Manage Service Provider Manages APP Data Runtime Middleware OS Virtualization Server Storage Network Service Provider Manages APP Data Runtime Middleware OS Virtualization Server Storage Network
1/16/20
11
q Many of them
q Data and Command
q Challenge
Source: https://aws.amazon.com/iot-platform/ http://www.brain-smart.net/smart-brain-health-blog/page/2/#axzz4W4oSp8a6
1/16/20
12
United: Connect + Communication Smart: Other Cloud Service Data Storage Machine Learning
Source: https://aws.amazon.com/iot-platform/
Stated: “Thing Shadow”
1/16/20
13
Source: https://aws.amazon.com/iot-platform/
Publish Amazon SNS Forward Subscribe Temperature sensor Period: 5s (0.2Hz) Message middleware
q http://docs.aws.amazon.com/iot/latest/developerguide/what-is-
q https://www.raspberrypi.org/
q http://cps.cse.wustl.edu/index.php/List_of_Projects
q https://aws.amazon.com/education/awseducate/apply/
14
q https://aws.amazon.com/iot/
1/16/20
15
1/16/20
16
AWS IoT Virtual “Thing” / Shadow
q a JSON document that is used to store and retrieve
q Shadow is a special topic in AWS IoT
q Authentication, Security q Permission and roles A “Dashboard” to show some info Certificates -> your ID Policy -> your permission book
1/16/20
17
18
19
20
The keys and cert will be used later
q It tells what this key/cert can do
21
22
23
This is the policy you created
q A policy tells what this key/cert can do
24
Click the cert
25
26
27
q Shadow: Store/retrieve some information q Certificate: authenticate the device q Policy: define the roles/permissions of the
q In your Thing Page
1/16/20
29
Shadow Topic
1/16/20
30
Shadow Topic
q In AWS IoT Page
1/16/20
31
Your Shadow Topic Topic Message
32
A Shadow Message is a JSON object. Shadow message has strict formats. Please see https://docs.aws.amazon.com/iot/latest/developerguide/device- shadow-document-syntax.html
33
1/16/20
34
1/16/20
35
a “Topic” I am going to publish a tweet. “Today is beautiful ” Twitter account Received message from Trump: “Today is beautiful” Subscriber Publisher
Temperature sensor Period: 15s (4Hz)
1/16/20
36
AWS IoT Virtual “Thing” / Shadow Attach Certificate Policy Copy AWS SDK Client AWS IoT SDK
q Note: through scp utility q Downloaded before!
q Node JS q Python (pip install AWSIoTPythonSDK ) q Java q …
1/16/20
37
1/16/20
38
Host(Endpoint) Modify the code
39
1/16/20
40
Publish Amazon SNS AWS IoT Virtual “Thing” / Shadow Forward Topic: CSE521_Tutorial Subscribe Subscribe
EC2 t2.micro
q Forward this message to SNS q Specify Dest ARN q Enable Rule
1/16/20
41
1/16/20
42
1/16/20
43
Time to Open Source!
Source: WeChat Subscriptions: 西乔《神秘的程序员们 39》 Geek Life Chpt 39.
1/16/20
44
Source: https://www.quora.com/My-AWS-account-was-hacked-and-I-have-a-50-000-bill-how-can-I-reduce-the-amount-I-need-to-pay
q Update your thing’s Shadow with AWS IoT Test Console
q Use your computer as a “Thing” to update your thing’s Shadow
q Publish and Subscribe on your computer
clients can share the same certs. You can use the shadow as the topic.
receives that message)
45
q Recognize the specific gesture to control the light
q Food dispenser with schedules and smart control
q Show personalized info in the mirror
46