HTML5 Powered Internet Of Things Products

48
Clickslide.co [email protected] @clickslideCTO Introduction ActionScript Cordova JavaScript PHP Ruby C++ C# Java AWS Jelastic Heroku Node.js Binary Packets APIs!!!!!

description

Leveraging HTML5, JavaScript, CSS, and Datadipity (http://clickslide.co) developers can build internet connected products in 1 day. We have demonstrated this technique by winning multiple hackathons. The products we've created include a connected Dog Collar, a connected door lock for keyless entry, a connected garbage can to weigh your trash and many more. Using this advanced technique, IoT products can be reduced to one HTML file and one Javascript file running inside of a Phonegap application. Developers can leverage existing APIs and cloud services to build a virtual full-stack without having to learn anything new or program any of the API interactions. We believe HTML5 is the future of software development and aim to support HTML5 developers with a fast and stable method to deliver IoT products with HTML5 & Javascript only. Here is an example of an IoT product built in 1 day using this technique: https://www.youtube.com/watch?v=9C6MgZsbVYE

Transcript of HTML5 Powered Internet Of Things Products

Page 1: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

Introduction

ActionScript

Cordova

JavaScript

PHP

• Ruby

• C++

• C#

• Java

AWS

Jelastic

• Heroku

Node.js

• Binary Packets

APIs!!!!!

Page 2: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

HTML5 Powered IoT Products

JavaScript and the virtual API software stack.

Page 3: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

What We’ll Cover

Part 1:

General Overview of infrastructure for Virtual

API Software Stack.

Part 2:

Breakdown of a practical example with

sample code and process overview.

Page 4: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

What are IoT Products?

Page 6: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

Internet Connected

What does it take to get an object online?

Page 7: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

Sensor Data

Quick Demo of using sensor data in

JavaScript using:

• Simply.js

• Pebble Watch

Page 8: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

IoT Infrastructure

JavaScript everywhere!

Page 9: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

JavaScript in the browser

• Data Analysis

• Business Logic

Page 10: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

JavaScript in Cordova (Phonegap)

• Quick demo of App structure for Cordova

• Event Driven

• Templates

– Jsviews is awesome

• Plugins

Page 11: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

JavaScript on Arduino

• Johnny Five

• Firmata

• Quick Demo of LED blinky

Page 12: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

I APIs

Page 13: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

HTTP

vs.

Web Hooks

vs.

Web Sockets

Page 14: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

HTTPKeep it in the client!

Large packets of data all at once

Page 15: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

Web Hooks

If This Then What?

Push notifications for servers

Page 16: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

1 : 1

POST

Web Hooks

No chain of events

Page 17: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

Web Sockets

“Real Time” messaging for Apps

ClientServer

Page 18: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

Information Routing

Think of Node.js as a message router for Web Sockets and Web Hooks.

Node.js

API

Node.js

Service

Node.js

Service

Node.js

Service

TCP

TCP

TCP

Page 19: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

Relieve Stress

Move business logic to the front-end

Page 20: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

API Intelligence

Set it and forget it

Front End

API

APIAPI

IaaS

Social, Geo, SaaS, etc.Quantifiable Self

BaaS

Page 21: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

Front-end Only

Business logic in a JavaScript client.

Front End

API

APIAPI

IaaS

Social, Geo, SaaS, etc.Quantifiable Self

BaaS

Web Socket

Router

Page 22: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

Data Structuring

• Reusable Logic

• Reusable components

• Plug-’n’-play intelligence with APIs

• Focus on building beautiful front-ends

• 100% JavaScript applications

Page 23: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

Software Stack

Client(HTML/CSS/J

avaScript)Serversdatabases

Traditional proprietary software stack

Programming required

Page 24: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

Software Stack Using APIs

HTML5 Client

Server

databases

Traditional proprietary software stack leveraging APIs

APIs

Programming required

Page 25: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

Virtual API Stack

Client(JS/HTML5)

API Powered JavaScript Client

APIs

Programming required

Page 26: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

Virtual API Stack with

Datadipity

Datadipity

Front-end Only – JavaScript Everywhere

APIs

NML.js

Client

Programming required

No Programming required

Page 27: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

Security

• No data stored on Client

• PCI Compliant

• Copyright Algorithms where needed

• SSL

• MD5/SHA Hash

Page 28: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

Security Continued

Page 29: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

BREAK TIME

Recap

• Virtual API Software Stack – No More

Backend!

• APIs Provide Intelligence to smart objects

• JavaScript Firmware

Page 30: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

My Hardware Setup

Page 31: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

The Firmware

• Johnny-five for Node.js

– Also, Cylon-js etc..

Page 32: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

The Webhook

• Get data from M2X locally with Ngrok

Page 33: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

The HTML

• Socket.io

• Bootstrap

• JSViews

• Jquery

• Modernizer

• NML.js

Page 34: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

The App

Page 35: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

APIs To Integrate

• AT&T M2X for real time sensor data

• AT&T In App Messaging for SMS

• Twitter

• Facebook

Page 36: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

Mashup APIs

• Facebook

• Twitter

• SMS

Page 37: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

Test The Integration

Page 38: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

Structure The Data

Page 39: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

Download NML.js

• https://github.com/clickslide/NML.js

Page 40: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

Publish The API

• Generates XML, JSON, JSONP REST

endpoint for your mashup.

Page 41: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

Create Cordova Ready App

Page 42: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

Prepare App Views

• JSViews

– ./templates/jsviews/loading-progress.html

– ./temples/jsviews/login-register-auth.html

Page 43: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

Instantiate NML.js

Page 44: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

Take Away

• Firmware is JavaScript, which is a different

type of front-end

• JavaScript developer can now be founders

of hardware companies

• 2 man team to manage full IoT company

at scale; 1 firmware, 1 full-stack.

Page 45: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

Where JavaScript Shines

• Web Hooks

– to Node.js Server

• Web Sockets

– Server to Client(s)

– Client to Client(s)

• Ajax

– Client to APIs

– APIs to Client(s)

Page 46: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

Tools

• Server Frameworks– Meteor

– Express

– Percolate

– Keystone

– Actionhero

• BaaS– Parse

– Kinvey

– Firebase

• SaaS– Social

– Geolocation

– Gaming

• Scaling– AWS

– Heroku

– Joyent

– Nodejitsu

– MongoDB - the JavaScript of NoSQL dbs.

• IaaS– Datadipity

• Front-end– Angular

– Backbone

– NML.js

– Jquery

Page 47: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

Things to Remember

• APIs are eventually consistent

• Leverage Services not Servers

• Up-front costs are minimally higher, but

save drastically in the long term

• Use Web Sockets to send events between

apps

• Use APIs to get Data into your Apps

• HTML5 is the future!

Page 48: HTML5 Powered Internet Of Things Products

[email protected]@clickslideCTO

Sign Up Today

http://clickslide.co