node.js and the internet of things

31
NODE.JS & THE INTERNET OF THINGS CHARLIE KEY @zwigby LOSANT @LosantHQ 1.28.2016

Upload: losant

Post on 16-Apr-2017

49.895 views

Category:

Software


7 download

TRANSCRIPT

Page 1: Node.js and The Internet of Things

N O D E . J S&

T H E I N T E R N E T O F T H I N G S

C HA R L I E KEY @ z wi g byLOSANT @LosantHQ

1.28.2016

Page 2: Node.js and The Internet of Things

2

W H O A M I ?

CHARLIE KEY

CEO & Co-Founder

Losant

PREVIOUSLY

CEO & Co-Founder

Modulus

Page 3: Node.js and The Internet of Things

Losant provides a complete developer platform to quickly, securely, and easily build complex connected solutions.

CONNECT ANALYZE REACT

Connect and manage thousands of devices.

Turn raw data into useful insights.

Make data-driven decisions in real-time.

Page 4: Node.js and The Internet of Things

4

W H A T I ST H E I N T E R N E T

O F T H I N G S ?

Page 5: Node.js and The Internet of Things

“ T H E I N T E R N E T A S A N E T W O R K H A D T H E P O T E N T I A L T O B E C O M E L I K E A N E R V O U S S Y S T E M I F W E A D D E D S E N S I N G C A P A B I L I T Y . ”

K E V I N A S H T O NP & G , U K ( 1 9 9 9 ) – A S S I S T A N T B R A N D

M A N A G E R , O L A Y

Page 6: Node.js and The Internet of Things

6

I o T – T H E I N T E R N E T O F T H I N G S

IoT is a term that represents a collection of ideas, devices, and processes.

Each thing is represented by a device or sensor.

These things are usually working together to create larger solutions by sending and reacting to data from an ecosystem.

Page 7: Node.js and The Internet of Things

I T ’ S A B O U T A D D I N G V A L U E A N D S O L V I N G P R O B L E M S -

L I V E SB U S I N E S S E SC U S T O M E R S

Page 8: Node.js and The Internet of Things

8

W H Y D O E S I o T M A T T E R ?

http://www.gartner.com/newsroom/id/3165317

0

5

10

15

20

25NUMBER OF CONNECTED DEVICES

2014 2015 2016 2017 2018 2019 2020

TODAY

billio

ns of

devic

es

Page 9: Node.js and The Internet of Things

9

I o T T O D A Y

Page 10: Node.js and The Internet of Things

T H E S M A R T H O M E

S M A R TA P P L I A N C E S

P R E S E N C E S E N S O R

S M A R TO U T L E T S

N E S T T H E R M O S T A T

P H I L I P S H U EB U L B S

H O M ES E C U R I T Y

Page 11: Node.js and The Internet of Things

M A N U F A C T U R I N GA U T O M A T E D

P R E S E N C E S E N S O R

T E M E R A T U R ES E N S O R

M O T O RS E N S O R

S M A R TD E L I V E R Y

R E M O T EM O N I T O R I N G

H U M I D I T YS E N S O R

Page 12: Node.js and The Internet of Things

T H E S M A R T E R S E L F

F I T B I TH E A R T R A T E

B R E A T H I N G S E N S O R

L U M O R U NS H O R T S

S M A R TR U N N I N G S H O E S

Page 13: Node.js and The Internet of Things

13

T H E I o T L I F E C Y C L E

C O L L E C T C O M M U N I C A T E A N A L Y Z E A C T

Page 14: Node.js and The Internet of Things

14

C O L L E C TDevices and sensors are collecting data everywhere.

H O M E C A R O F F I C E M F G P L A N T

Page 15: Node.js and The Internet of Things

15

C O M M U N I C A T ESending data and events through networks to some destination

A C L O U D P L A T F O R M P R I V A T E D A T A C E N T E R H O M E N E T W O R K

Page 16: Node.js and The Internet of Things

16

A N A L Y Z ECreating information from the data

M A C H I N E L E A R N I N G B U I L D I N G R E P O R T S F I L T E R I N G /P A I R I N GI T D O W N

Page 17: Node.js and The Internet of Things

17

A C TTaking action based on the information and data

C O M M U N I C A T EW / A N O T H E RM A C H I N E( M 2 M )

S E N D A N O T I F I C A T I O N( S M S , E M A I L , T E X T )

T A L K T OA N O T H E R S Y S T E M

Page 18: Node.js and The Internet of Things

J A V A S C R I P T+

I o T

Empowering everyone to build a more connected world.

Page 19: Node.js and The Internet of Things

19

W H Y J A V A S C R I P T ?

The current toolsets are hard to learn and use.

Low Level languages mean more development time and issues.

Page 20: Node.js and The Internet of Things

20

W H Y N O D E . J S ?

48% of developers are usingNode.js at IoT companies

npm231643

total packages

Page 21: Node.js and The Internet of Things

S U P P O R T E D H A R D W A R EBEAGLEBONE BLACK

INTEL EDISON RASPBERRY PI

INTEL GALILEO LILINO ONE

TESSEL 2

Page 22: Node.js and The Internet of Things

22

S U P P O R T E D C O M M U N I C A T I O N

XMPPnpm install node-xmpp-client

MQTTnpm install mqtt

HTTPnpm install request

CoAPnpm install coap

AMPQnpm install ampq

STOMPnpm install stomp-client

and so many more…

Page 23: Node.js and The Internet of Things

23

N O D E . J S L I B R A R I E SJOHNNY-FIVE

var five = require("johnny-five");var board = new five.Board();

board.on("ready", function() {var led = new five.Led(13);led.blink(500);

});

var Cylon = require("cylon");

Cylon.robot({connections: {

arduino: { adaptor: 'firmata', port: '/dev/ttyACM0' }},devices: {led: { driver: 'led', pin: 13 }

},work: function(my) {every((1).second(), function() {my.led.toggle();

});}

}).start();

Page 24: Node.js and The Internet of Things

I N T E L E D I S O N

W I F IB L U E T O O T H

L I N U X B A S E D

Page 25: Node.js and The Internet of Things

25

E D I S O N D E T A I L S

Dual Core Atom CPU 500 MHz

MCU 100 MHz

Wi-Fi & Bluetooth LE

Yocto Linux

40 GPIO

MANY BREAKOUT BOARD

OPTIONS

TINY LITTLE COMPUTER

Page 26: Node.js and The Internet of Things

26

E D I S O N T I P S

var m = require('mraa'); //require mraa

var myLed = new m.Gpio(13); //LED hooked up to digital pin 13

myLed.dir(m.DIR_OUT); //set the gpio direction to outputvar ledState = true; //Boolean to hold the state of Led

function periodicActivity(){

myLed.write(ledState ? 1:0); //write led state to pinledState = !ledState; //invert the ledStatesetTimeout(periodicActivity,1000); //call after 1 second

}

periodicActivity(); //call the periodicActivity function

USE MRAAnpm install mraa

Page 27: Node.js and The Internet of Things

27

E D I S O N S E N S O R SUSE GROVE KIT

Page 28: Node.js and The Internet of Things

28

E D I S O N C O M P A T I B I L I T Y USE UPM (USEFUL PACKAGES & MODULES)

https://github.com/intel-iot-devkit/upmhttps://github.com/intel-iot-devkit/upm/tree/master/examples/javascript

// Load PN532 modulevar pn532 = require('jsupm_pn532');

// Instantiate an PN532 on I2C bus 0 (default) using gpio 3 for the// IRQ, and gpio 2 for the reset pin.var myNFCObj = new pn532.PN532(3, 2);

if(myNFCObj.readPassiveTargetID(pn532.PN532.BAUD_MIFARE_ISO14443A, uid, uidSize, 2000)){

// found a card – do something}

Page 29: Node.js and The Internet of Things

29

W H E R E D O W E G O F R O M H E R E

SMALLER & MORE POWERFUL DEVICES

JS IN SMALLER FOOTPRINT

BETTER HW SUPPORT

WIDER CONNECTIVITY

Page 30: Node.js and The Internet of Things

30

“Anything with a battery will have network connection.”

-Ben Wen

T H E F U T U R E W O R L D

Page 31: Node.js and The Internet of Things

31

T H A N K Y O UCHARLIE KEY

[email protected]@zwigby

LOSANT

@LosantHQ