cloud tutorial aws iot
play

Cloud Tutorial: AWS IoT CSE 521S Fall Sep. 17, 2020 Ruixuan - PowerPoint PPT Presentation

Cloud Tutorial: AWS IoT CSE 521S Fall Sep. 17, 2020 Ruixuan (Corey) 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


  1. Cloud Tutorial: AWS IoT CSE 521S Fall Sep. 17, 2020 Ruixuan (Corey) Dai

  2. XaaS: Basics in Cloud Computing

  3. Cloud Computing Ø Cloud computing provides shared pool of configurable computing resource to end users on demand Ø Three service models q IaaS (Infrastructure as a Service): virtual machines, storage, network … q PaaS (Platform as a Service): execution runtime, middleware, web server, database, development tool … q SaaS (Software as a Service): email, virtual desktop, games … 9/17/20 3

  4. Cloud Services: On-premise Software Ø Traditional APP Data Ø installed and runs on personal computer Runtime Middleware Ø You Manage and Deploy You Manage q Hardware OS q OS q Software Virtualization Server Ø Example q This presentation Storage Network 9/17/20 4

  5. Infrastructure as a Service (IaaS) Ø IaaS APP q "physical server box” Web q Virtual Machine Service Data You Manage • Memory Runtime • Storage • CPU Middleware • Network OS Ø Example Service Provider Manages q AWS EC2 Virtualization q AWS EFS Server Ø Use case Storage q Build up you VM cluster Network 9/17/20 5

  6. Platform as a Service (PaaS) Ø PaaS You Manage APP q You get a framework Data q Host Application q T ools Runtime Middleware Service Provider Manages Ø Example OS q AWS IoT Virtualization Ø Use case Server q Build up you’re smart A/C Storage controller Network 9/17/20 6

  7. PaaS Example: AWS IoT Tools Framework The essence is MESSAGING MIDDLEWARE Send messages between sensors and servers… 9/17/20 7

  8. Software as a Service (SaaS) Ø SaaS APP q You get a whole solution Data Service Provider Manages Runtime Ø Example Middleware q Gmail OS q Dropbox Virtualization q Office365 Server Storage Network 9/17/20 8

  9. XaaS: A Recap PaaS On-Premise IaaS SaaS You Manage APP APP APP APP Data Data Data Data You Manage Runtime Runtime Runtime Runtime Service Provider Manages Middleware Middleware Middleware Middleware Service Provider Manages You Manage OS OS OS OS Service Provider Manages Virtualization Virtualization Virtualization Virtualization Server Server Server Server Storage Storage Storage Storage Network Network Network Network 9/17/20 9

  10. Tutorial: Hello! AWS IoT!!

  11. Internet-of-Things Ø Internet-of-Things q Devices • Different Types § Sensors, actuators q Data and Command • Sensing the world • Give Response q Challenge • United: Connected + Communication • Smart: Data Analytics + Strategy 9/17/20 11 Source: https://aws.amazon.com/iot-platform/ http://www.brain-smart.net/smart-brain-health-blog/page/2/#axzz4W4oSp8a6

  12. Solution: AWS IoT Smart: Other Cloud Service United: Connect + Communication Data Storage Stated: “Thing Shadow” Machine Learning 9/17/20 12 Source: https://aws.amazon.com/iot-platform/

  13. Tutorial: Hello AWS IoT! Ø Key concepts: q Publisher (e.g. Sensor), Subscriber (e.g. Server), Topic • Topic is used to identify the message. Ø Not a traditional “peer-to-peer” communication. Publish to a topic Forward Amazon SNS Subscribe to a topic Temperature sensor Period: 5s (0.2Hz) Message middleware 9/17/20 13 Source: https://aws.amazon.com/iot-platform/

  14. Basic Interact: Subscribe/Publish Ø You can define your own Topic (Twitter Account) Ø Subscriber can receive the message you published to your topic I am going to publish a tweet. “Today is beautiful ” Tweet “subscribe” “Publish” Follow Twitter account a “Topic” Received message from Trump: Subscriber “Today is beautiful” Publisher 9/17/20 14

  15. Resources Ø Amazon IoT q http://docs.aws.amazon.com/iot/latest/developerguide/what-is- aws-iot.html Ø Raspberry Pi q https://www.raspberrypi.org/ Ø Resource list for course projects q http://cps.cse.wustl.edu/index.php/List_of_Projects Ø Apply for $40 credits for Amazon AWS q https://aws.amazon.com/education/awseducate/apply/ 15

  16. Get into AWS Manage Console Ø Create your own AWS account Ø Sign In IoT Manage Console q https://aws. amazon .com/ iot / 9/17/20 16

  17. Step 1: Create a Virtual "Thing” Ø Virtual “Thing”: a virtual copy of your thing q A Thing in AWS IoT has a “shadow” • a JSON document that is used to store and retrieve current state information for a device. § E.g. Battery level, Connectivity, data A “Dashboard” to show some info q Shadow is a special topic in AWS IoT AWS IoT Ø Certificates and policy q Authentication, Security q Permission and roles Virtual “Thing” Certificates -> your ID / Shadow Policy -> your permission book 9/17/20 17

  18. Create a thing Ø 1. AWS IoT Menu • Things è Create Ø 2. Give a name 9/17/20 18

  19. 19

  20. 20

  21. The keys and cert will be used later 21

  22. Create Policy Ø A policy is attached to a key/cert q It tells what this key/cert can do 22

  23. Here, we grant it all permissions for demo! 23

  24. This is the policy you created 24

  25. Attach Policy Ø Attach Policy to the key/cert q A policy tells what this key/cert can do Click the cert you just created 25

  26. 26

  27. 27

  28. Now, you have a virtual thing on AWS! 28

  29. AWS Things Summary q Certificate: authenticate the device q Policy: define the roles/permissions of the certificate q Virtual copy of the thing (Shadow): Store/retrieve some information 29

  30. Let’s test it online!

  31. Basic Interact: Publish to the “Shadow” Ø Get your “Shadow” Shadow is a special topic q In your Thing Page Shadow Topic 9/17/20 31

  32. Find your “Shadow” Topic Ø Topic: can be seen as the “address” Shadow Topic: $aws/things/ cse521 /shadow/update 9/17/20 32 https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html?icmpid=docs_iot_console

  33. Ø Using Embedded Test Client to Test Your Shadow Topic q In AWS IoT Page Topic Message 9/17/20 33

  34. Shadow Message { "state": { "reported":{ "welcome": "CSE521s", "time":"13:45", "temperature":"25"} }, "message": "Hello from CSE521s console"} 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 34

  35. Update Shadow Ø In your “Thing” Page 35

  36. Basic Interact: Subscribe/Publish Ø You can define your own Topic Ø Once you have a subscriber that is subscribed to the topic, the subscriber can receive the message 9/17/20 36

  37. Step 2: Connect a “Physical” Device AWS IoT AWS IoT SDK Certificate AWS SDK Client Attach Virtual “Thing” / Shadow Temperature sensor Period: 5s (0.2Hz) Copy Policy 9/17/20 37

  38. Connect your Device Ø Copy certificates to your physical things q Downloaded before! Ø Choose your AWS SDK (support MQTT) q Node JS q Python ( pip install AWSIoTPythonSDK ) q Java q … Ø Set up your client with SDK and the certificates 9/17/20 38

  39. Some Notes Ø 1. Copy the certificates/keys to your real thing Ø 2. You will need the endpoint and port (8883) Host(Endpoint) Ø 3. Set up your configuration of the code with SDK Change your code accordingly! 9/17/20 39

  40. SDK and Demo Codes Ø https://github.com/aws/aws-iot-device-sdk-python Ø https://github.com/aws/aws-iot-device-sdk- python/blob/master/samples/basicPubSub/basicPubSub.py 40

  41. More: Rule Engine, Link with SNS services Ø Simple Notification Service AWS IoT Publish Virtual “Thing” / Shadow EC2 t2.micro AWS Forward Subscribe Topic: CSE521_Tutorial Subscribe Amazon SNS 9/17/20 41

  42. Create a Rule in Amazon IoT Ø Add a query to filter your interesting topic (event) Ø Add an Action: q Forward this message to SNS q Specify Dest ARN q Enable Rule 9/17/20 42

  43. Notification on SMS & Email 9/17/20 43

  44. One More Thing: Account Security Ø DON’T UPLOADYOUR KEY PUBLICLY!!! Time to Open Source! 9/17/20 44 Source: WeChat Subscriptions: 西乔《神秘的程序员们 39 》 Geek Life Chpt 39.

  45. What if… $50,000 AWS Bill! 9/17/20 45 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

  46. Some project examples Ø Gesture recognition with smartwatch q Recognize the specific gesture to control the light Ø Smart pet feeder q Food dispenser with schedules and smart control Ø Smart mirror q Show personalized info in the mirror Sensing, Connecting, Smart If you have any question about the project, feel free to send me an Email 46

  47. Thanks! Ruixuan Dai

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend