I Love APIs 2015: Create Design-driven APIs with Node.js and Swagger
I Love APIs 2015: IOT Lab
-
Upload
apigee-google-cloud -
Category
Software
-
view
451 -
download
0
Transcript of I Love APIs 2015: IOT Lab
![Page 1: I Love APIs 2015: IOT Lab](https://reader031.fdocuments.net/reader031/viewer/2022021922/587bf7eb1a28ab7c668b4e53/html5/thumbnails/1.jpg)
1
IoT Lab !@mdobs
@adammagaluk
![Page 2: I Love APIs 2015: IOT Lab](https://reader031.fdocuments.net/reader031/viewer/2022021922/587bf7eb1a28ab7c668b4e53/html5/thumbnails/2.jpg)
Our Project
2
![Page 3: I Love APIs 2015: IOT Lab](https://reader031.fdocuments.net/reader031/viewer/2022021922/587bf7eb1a28ab7c668b4e53/html5/thumbnails/3.jpg)
Our Project
3 ©2015 Apigee. All Rights Reserved.
![Page 4: I Love APIs 2015: IOT Lab](https://reader031.fdocuments.net/reader031/viewer/2022021922/587bf7eb1a28ab7c668b4e53/html5/thumbnails/4.jpg)
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](https://reader031.fdocuments.net/reader031/viewer/2022021922/587bf7eb1a28ab7c668b4e53/html5/thumbnails/5.jpg)
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](https://reader031.fdocuments.net/reader031/viewer/2022021922/587bf7eb1a28ab7c668b4e53/html5/thumbnails/6.jpg)
Intro to the Internet of Things
6
![Page 7: I Love APIs 2015: IOT Lab](https://reader031.fdocuments.net/reader031/viewer/2022021922/587bf7eb1a28ab7c668b4e53/html5/thumbnails/7.jpg)
• 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](https://reader031.fdocuments.net/reader031/viewer/2022021922/587bf7eb1a28ab7c668b4e53/html5/thumbnails/8.jpg)
• 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](https://reader031.fdocuments.net/reader031/viewer/2022021922/587bf7eb1a28ab7c668b4e53/html5/thumbnails/9.jpg)
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](https://reader031.fdocuments.net/reader031/viewer/2022021922/587bf7eb1a28ab7c668b4e53/html5/thumbnails/10.jpg)
• 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](https://reader031.fdocuments.net/reader031/viewer/2022021922/587bf7eb1a28ab7c668b4e53/html5/thumbnails/11.jpg)
Intro to our Technology
11
![Page 12: I Love APIs 2015: IOT Lab](https://reader031.fdocuments.net/reader031/viewer/2022021922/587bf7eb1a28ab7c668b4e53/html5/thumbnails/12.jpg)
• 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](https://reader031.fdocuments.net/reader031/viewer/2022021922/587bf7eb1a28ab7c668b4e53/html5/thumbnails/13.jpg)
• 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](https://reader031.fdocuments.net/reader031/viewer/2022021922/587bf7eb1a28ab7c668b4e53/html5/thumbnails/14.jpg)
• Tool for prototyping electronic circuits • Great for circuits without soldering
Intro to Breadboard
![Page 15: I Love APIs 2015: IOT Lab](https://reader031.fdocuments.net/reader031/viewer/2022021922/587bf7eb1a28ab7c668b4e53/html5/thumbnails/15.jpg)
• Create a new file to put some code in
Getting Started
![Page 16: I Love APIs 2015: IOT Lab](https://reader031.fdocuments.net/reader031/viewer/2022021922/587bf7eb1a28ab7c668b4e53/html5/thumbnails/16.jpg)
Let’s write a snippet of Zetta and see what happens!
Writing some Zetta code
![Page 17: I Love APIs 2015: IOT Lab](https://reader031.fdocuments.net/reader031/viewer/2022021922/587bf7eb1a28ab7c668b4e53/html5/thumbnails/17.jpg)
Our First Circuit
17
![Page 18: I Love APIs 2015: IOT Lab](https://reader031.fdocuments.net/reader031/viewer/2022021922/587bf7eb1a28ab7c668b4e53/html5/thumbnails/18.jpg)
First Circuit
18 ©2015 Apigee. All Rights Reserved.
Black - Bottom / Pin 1 White - Top / Pin 7
![Page 19: I Love APIs 2015: IOT Lab](https://reader031.fdocuments.net/reader031/viewer/2022021922/587bf7eb1a28ab7c668b4e53/html5/thumbnails/19.jpg)
Our Second Circuit
19
![Page 20: I Love APIs 2015: IOT Lab](https://reader031.fdocuments.net/reader031/viewer/2022021922/587bf7eb1a28ab7c668b4e53/html5/thumbnails/20.jpg)
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](https://reader031.fdocuments.net/reader031/viewer/2022021922/587bf7eb1a28ab7c668b4e53/html5/thumbnails/21.jpg)
A Coordination
21
![Page 22: I Love APIs 2015: IOT Lab](https://reader031.fdocuments.net/reader031/viewer/2022021922/587bf7eb1a28ab7c668b4e53/html5/thumbnails/22.jpg)
Linking
22
![Page 23: I Love APIs 2015: IOT Lab](https://reader031.fdocuments.net/reader031/viewer/2022021922/587bf7eb1a28ab7c668b4e53/html5/thumbnails/23.jpg)
23 ©2015 Apigee. All Rights Reserved.
Problem: How do we expose our API to the world?
![Page 24: I Love APIs 2015: IOT Lab](https://reader031.fdocuments.net/reader031/viewer/2022021922/587bf7eb1a28ab7c668b4e53/html5/thumbnails/24.jpg)
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](https://reader031.fdocuments.net/reader031/viewer/2022021922/587bf7eb1a28ab7c668b4e53/html5/thumbnails/25.jpg)
• 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](https://reader031.fdocuments.net/reader031/viewer/2022021922/587bf7eb1a28ab7c668b4e53/html5/thumbnails/26.jpg)
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](https://reader031.fdocuments.net/reader031/viewer/2022021922/587bf7eb1a28ab7c668b4e53/html5/thumbnails/27.jpg)
27 ©2015 Apigee. All Rights Reserved.
Congratulations! The kit is yours to keep.