Getting started on IoT with AWS and NodeMCU for less than 5€

27
IoT on AWS and NodeMCU FOR LESS THAN 5 EUROS June 2016 01

Transcript of Getting started on IoT with AWS and NodeMCU for less than 5€

Page 1: Getting started on IoT with AWS and NodeMCU for less than 5€

IoT on AWS and NodeMCU FOR LESS THAN 5 EUROS

June 2016

01

Page 2: Getting started on IoT with AWS and NodeMCU for less than 5€

About Johann• Tech Evangelist @Stylight

• 15+ years in tech

• In Germany for 2 years

• 7 years in San Francisco doing startups

• Organizer of many meetups

2

Page 3: Getting started on IoT with AWS and NodeMCU for less than 5€

Tweet me!

@romefort @StylightTech

Page 4: Getting started on IoT with AWS and NodeMCU for less than 5€

What are you going to learn?

4

• Discover ESP8266/NodeMCU

• Introduction to AWS IoT

• Hands-on

• Connecting a NodeMCU board

• Configuring Arduino environment for NodeMCU

• Installing AWS SDK

• Publishing sensor data to AWS IoT

• Trigger rules to invoke Lambda function

Page 5: Getting started on IoT with AWS and NodeMCU for less than 5€

ESP8266

5

• Cheap: $2

• Very low power consumption

• WIFI

• Deep-sleep mode

Page 6: Getting started on IoT with AWS and NodeMCU for less than 5€

NodeMCU• Micro-usb for flashing

and power

• 3v - 5v: Support Arduino sensors

• Compatible Arduino/Lua

• CHEAP

6

Page 7: Getting started on IoT with AWS and NodeMCU for less than 5€

You said CHEAP?

7

Page 8: Getting started on IoT with AWS and NodeMCU for less than 5€

Why?

8

• Cheap is good in IoT because it scales

• But no direct support of AWS IoT because no TLS 1.2 module yet in ESP8266

• Hackers always find workarounds

Page 9: Getting started on IoT with AWS and NodeMCU for less than 5€

If you just want to play around/prototype

9

Page 10: Getting started on IoT with AWS and NodeMCU for less than 5€

Introduction to AWS IoT

10

• Serverless way to connect your IoT devices and start processing data

• Supports MQTT, HTTP

• Secure - communication through use of X.509 Certificates

• Can connect huge amount of sensors, store and process the data in real-time

Page 11: Getting started on IoT with AWS and NodeMCU for less than 5€

AWS IoT Architecture

11source: http://docs.aws.amazon.com/iot/latest/developerguide/aws-iot-how-it-works.html

Page 12: Getting started on IoT with AWS and NodeMCU for less than 5€

What’s a Thing?

12

• An IoT Device

• Sensors, actuators,

• In our case a NodeCMU board

Page 13: Getting started on IoT with AWS and NodeMCU for less than 5€

What’s the Message Broker?

13

• Used to securely exchange messages following the publish-subscribe pattern, between IoT applications and Things.

• MQTT to publish/subscribe

• HTTP to publish

• Note: MQTT uses TLS 1.2 which is not available in NodeMCU

• Let’s use HTTP then!

Page 14: Getting started on IoT with AWS and NodeMCU for less than 5€

What’s the Rule Engine?

14

• Used to process messages and talk to other AWS components like Lambda, DynamoDB, etc

• SQL-Based language to select specific messages to be passed along.

Page 15: Getting started on IoT with AWS and NodeMCU for less than 5€

What are Thing Shadows?

15

• Devices sometimes go offline

• A Thing Shadow provide a persistent representation of a Thing

• A Thing can sync its state to its Thing Shadow through the REST API

Page 16: Getting started on IoT with AWS and NodeMCU for less than 5€

AWS IoT Console

16

Page 17: Getting started on IoT with AWS and NodeMCU for less than 5€

Hands-on!

June 2016

01

Page 18: Getting started on IoT with AWS and NodeMCU for less than 5€

We are going to:

18

• Create a Thing in AWS IoT

• Publish sensor data from our NodeMCU to update our Thing Shadow

• Have a look at the MQTT Client

• Create a Rule to trigger a lambda when humidity is > 50%

• Publish the data to Slack

Page 19: Getting started on IoT with AWS and NodeMCU for less than 5€

The Fritzing

19

Page 20: Getting started on IoT with AWS and NodeMCU for less than 5€

Create a Thing

20

Page 21: Getting started on IoT with AWS and NodeMCU for less than 5€

Open Serial Monitor

21

Page 22: Getting started on IoT with AWS and NodeMCU for less than 5€

MQTT Client

22

Page 23: Getting started on IoT with AWS and NodeMCU for less than 5€

Creating your Lambda

23

Page 24: Getting started on IoT with AWS and NodeMCU for less than 5€

Configuring your Lambda

24

Page 25: Getting started on IoT with AWS and NodeMCU for less than 5€

Write your Lambda

25

Page 26: Getting started on IoT with AWS and NodeMCU for less than 5€

Questions?

Twitter: @romefort tech.stylight.comRead our blog:

Page 27: Getting started on IoT with AWS and NodeMCU for less than 5€

www.stylight.com