i love apis 2015: iot lab

27
1 IoT Lab @mdobs @adammagaluk

Upload: apigee-google-cloud

Post on 15-Apr-2017

451 views

Category:

Software


0 download

TRANSCRIPT

Page 1: I Love APIs 2015: IOT Lab

1

IoT Lab !@mdobs

@adammagaluk

Page 2: I Love APIs 2015: IOT Lab

Our Project

2

Page 3: I Love APIs 2015: IOT Lab

Our Project

3 ©2015 Apigee. All Rights Reserved.

Page 4: I Love APIs 2015: IOT Lab

Our Project

4 ©2015 Apigee. All Rights Reserved.

Zetta Server

hub

zs

Mic Buzzer

API

Browser API

Page 5: I Love APIs 2015: IOT Lab

Our Project – Home Security

5 ©2015 Apigee. All Rights Reserved.

Building an open source security system Our process

a. Intro to the Internet of Things b. Intro to our technology c. Building our first circuit. (Using a buzzer) d. Building our second circuit. (Using a microphone) e. Coordinating them with JavaScript

We’ll Learn a. How to create basic circuits b. How to work with the BeagleBone Black c. How to harness the Zetta toolchain for creating IoT Apps d. What else can be done with Zetta

Page 6: I Love APIs 2015: IOT Lab

Intro to the Internet of Things

6

Page 7: I Love APIs 2015: IOT Lab

•  A growing ubiquitous network of devices. •  Made up of Sensors and Actuators •  Sensors

–  Sense the world around you. –  Report data back

•  Actuators –  Act on the world around you –  Give feedback

The Internet of Things

Page 8: I Love APIs 2015: IOT Lab

•  Data –  What to store? –  What to use?

•  Interfaces and Protocols –  Many protocols exist for IoT? –  What to use?

•  Devices in large systems –  How to coordinate devices in large systems?

•  Quality of Tooling –  How to build tools for people building products?

Issues within the Internet of Things

Page 9: I Love APIs 2015: IOT Lab

Zetta is an open source platform for the Internet of Things. It harnesses JavaScript to make things quick and easy. Zetta tackles all these problems in an elegant, and efficient way.

Intro to Zetta

Page 10: I Love APIs 2015: IOT Lab

•  Data –  Broadcasting data over websockets. –  Make collection and analysis easy

•  Interfaces and Protocols –  Use HTTP to communicate with devices –  Every device gets an API generated from Node.js

•  Devices in large systems –  Coordinate devices across the globe with ease

•  Quality of Tooling –  Designed with the developer in mind –  Multiple tools for helping develop quickly

Solving these problems

Page 11: I Love APIs 2015: IOT Lab

Intro to our Technology

11

Page 12: I Love APIs 2015: IOT Lab

•  Evented and Async •  Open source •  Every developer knows JavaScript •  Can run on many different platforms

Why Node.js?

Page 13: I Love APIs 2015: IOT Lab

•  Single board computer, runs Linux and similar to Raspberry Pi •  Low cost and community supported •  Comes with Node.js pre-installed •  Has a node module for accessing hardware •  Browser based IDE for programming right on the board

Why BeagleBone Black?

Page 14: I Love APIs 2015: IOT Lab

•  Tool for prototyping electronic circuits •  Great for circuits without soldering

Intro to Breadboard

Page 15: I Love APIs 2015: IOT Lab

•  Create a new file to put some code in

Getting Started

Page 16: I Love APIs 2015: IOT Lab

Let’s write a snippet of Zetta and see what happens!

Writing some Zetta code

Page 17: I Love APIs 2015: IOT Lab

Our First Circuit

17

Page 18: I Love APIs 2015: IOT Lab

First Circuit

18 ©2015 Apigee. All Rights Reserved.

Black - Bottom / Pin 1 White - Top / Pin 7

Page 19: I Love APIs 2015: IOT Lab

Our Second Circuit

19

Page 20: I Love APIs 2015: IOT Lab

Second Circuit

20 ©2015 Apigee. All Rights Reserved.

Pins from right: Green - Top / Pin 6 Red - Top / Pin 8 Resistor: 2.2 K

Page 21: I Love APIs 2015: IOT Lab

A Coordination

21

Page 22: I Love APIs 2015: IOT Lab

Linking

22

Page 23: I Love APIs 2015: IOT Lab

23 ©2015 Apigee. All Rights Reserved.

Problem: How do we expose our API to the world?

Page 24: I Love APIs 2015: IOT Lab

What does linking do?

24 ©2015 Apigee. All Rights Reserved.

Z1 Z2

F i r e w a l l

Tunneled Connection HTTP Request

Linking creates a secure tunnel out of home networks allowing you to expose your API to the world.

Page 25: I Love APIs 2015: IOT Lab

•  Built an open source security system •  Our process

a. We learned how to use Zetta b. We learned about it’s development tools and best practices c. We built circuitry to power our system d. We coordinated these devices using JavaScript and interacted with them via API.

•  We Learned a. How to create basic circuits b. How to work with the BeagleBone Black c. Harnessing the Zetta toolchain

Our Completed Project - Home Security

Page 26: I Love APIs 2015: IOT Lab

1. Zetta Github - http://github.com/zettajs/zetta 2. Workshop Code - https://github.com/zettajs/zetta-security-system 3. Zetta Mailing List - https://groups.google.com/forum/#!forum/zetta-discuss 4. IoT Craft - https://groups.google.com/forum/#!forum/iot-craft 5. Apigee Community – http://community.apigee.com/ 6. My Personal Email - [email protected]

Additional Resources

Page 27: I Love APIs 2015: IOT Lab

27 ©2015 Apigee. All Rights Reserved.

Congratulations! The kit is yours to keep.