raspberry pi 2 + windows 10 iot core + node.js
TRANSCRIPT
![Page 1: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/1.jpg)
Ep.1 Developing for IoT with Web Technologies
Andri YadiCEO, DyCode
![Page 2: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/2.jpg)
![Page 3: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/3.jpg)
sponsored by
organized by
IoT4Bdg
supported by
![Page 4: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/4.jpg)
Raspberry Pi 2 + Windows 10 IoT Core + Node.js
Let’s talk about…
![Page 5: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/5.jpg)
Andri Yadi
@andri_yadi | a at dycode dot com
http://andriyadi.me
![Page 6: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/6.jpg)
CEO of
![Page 7: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/7.jpg)
CEO of
![Page 8: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/8.jpg)
Been coding in awesome languages/Frameworks for 18 years
QBasic, Pascal, c, C++, Java, PHP, Bash, C#, Visual Basic, HTML, JavaScript, Python, Objective-C, Swift
.NET, Qt/QML, Java ME/EE/SE, Android SDK, iOS SDK, Node.js, Arduino
![Page 9: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/9.jpg)
8 years in a row
![Page 10: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/10.jpg)
A custom-made, compact, autonomous machine for delivering engagements
Co-creator of
![Page 11: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/11.jpg)
Inside
![Page 12: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/12.jpg)
Inside
![Page 13: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/13.jpg)
Disclaimer
Let’s have Fun today!
![Page 14: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/14.jpg)
Disclaimer
I’ll do More demo, less Slides
![Page 15: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/15.jpg)
Raspberry Pi 2
SoC: Broadcom BCM2836 (CPU, GPU, DSP, SDRAM) 900 MHz quad-core ARM Cortex A7 Memory: 1 GB (shared with GPU) GPU: Broadcom VideoCore IV @ 250 MHz Storage: MicroSD
![Page 16: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/16.jpg)
Raspberry Pi 2 & GPIO
![Page 17: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/17.jpg)
Raspberry Pi OS
![Page 18: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/18.jpg)
New Comer
![Page 19: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/19.jpg)
Windows 10 IoT Core on Raspberry Pi 2
![Page 20: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/20.jpg)
Windows 10 IoT Core Supported boards
Raspberry Pi 2 Minnowboard Max
![Page 21: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/21.jpg)
What to do after install Windows 10 IoT Core?
Code it!
![Page 22: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/22.jpg)
Supported development paths
Arduino Wiring &UWP Lightning Providers
Windows Remote Arduino
Windows Virtual Shields for ArduinoNative
![Page 23: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/23.jpg)
Supported development language/frameworks
![Page 24: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/24.jpg)
Out focus today!
![Page 25: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/25.jpg)
Why JavaScript?
Explanation in Bahasa Indonesia: http://andriyadi.me/bandung-iot-developer-day/
![Page 26: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/26.jpg)
What do you need?
tool for VS
IoT side Desktop side
NTVS IoT
![Page 27: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/27.jpg)
DemoDon’t blink!
![Page 28: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/28.jpg)
Setup
GPIO 5
![Page 29: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/29.jpg)
Code in Node.jsvarhttp=require('http'),uwp=require("uwp");
//EnablesUniversalWindowsPlatform(UWP)"Windows"namespacetobe //accessibleuwp.projectNamespace("Windows");
vargpioCtrl=Windows.Devices.Gpio.GpioController.getDefault();varswitchPin=gpioCtrl.openPin(5);
//SetpinasoutputswitchPin.setDriveMode(Windows.Devices.Gpio.GpioPinDriveMode.output);varcurrentValue=Windows.Devices.Gpio.GpioPinValue.high;//WriteHIGHvaluetoGPIOPIN5,tolightuptheLEDswitchPin.write(currentValue);
uwp.close();//CallthiswhenallUWPusageiscompleted.
![Page 30: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/30.jpg)
DemoSmiiiile!
Display smiley on LED matrix
![Page 31: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/31.jpg)
Setup
![Page 32: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/32.jpg)
Let there be a lightLet’s turn on bigger light, a light bulb
![Page 33: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/33.jpg)
1 2 3 4
A
B
C
D
4321
D
C
B
A Title
Number RevisionSizeA4
Date: 7-Oct-2015 Sheet ofFile: D:\DYCODE\Layout PCB\Demo.ddb Drawn By:
Q1TRIAC
U1
OPTOTRIAC_1
R2
1K
R1
470
LAMP
AC PLUG
GPIO
AC solid state switch
To RPi2 GPIO 5
![Page 34: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/34.jpg)
AC lamp switch setup
AC Switch
![Page 35: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/35.jpg)
Motion detectedGPIO interrupt demo
![Page 36: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/36.jpg)
Setup
1 2 3 4
A
B
C
D
4321
D
C
B
A Title
Number RevisionSizeA4
Date: 7-Oct-2015 Sheet ofFile: D:\DYCODE\Layout PCB\Demo.ddb Drawn By:
Q1TRIAC
U1
OPTOTRIAC_1
R2
1K
R1
470
LAMP
AC PLUG
GPIO
![Page 37: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/37.jpg)
Motion CapturedAccess USB Camera
![Page 38: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/38.jpg)
Setup
1 2 3 4
A
B
C
D
4321
D
C
B
A Title
Number RevisionSizeA4
Date: 7-Oct-2015 Sheet ofFile: D:\DYCODE\Layout PCB\Demo.ddb Drawn By:
Q1TRIAC
U1
OPTOTRIAC_1
R2
1K
R1
470
LAMP
AC PLUG
GPIO
![Page 39: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/39.jpg)
I made a library to Access Webcam using Node.js !
https://github.com/andriyadi/Win10IoT-AzureIotHub-SmartLamp/blob/master/SmartLamp/
lib/Camera.js
![Page 40: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/40.jpg)
Control the light from Mars….or from anywhere connected to internet
![Page 41: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/41.jpg)
We need Cloud
for that…
![Page 42: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/42.jpg)
MQTT
Scenario
Raspberry Pi 2Web/desktop app
IoT Hub
AMQP/HTTP
![Page 43: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/43.jpg)
AMQP/HTTP
Scenario
MQTT
Raspberry Pi 2Web dashboard
IoT Hub
Photo storageStorage
![Page 44: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/44.jpg)
Beyond BITS
![Page 45: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/45.jpg)
Master (µC or µP)
SPI Serial Peripheral Interface
SCLK
MOSI
Slave (display)
Slave (sensor)
MISO
Slave (other µC)CS0CS1CSn
![Page 46: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/46.jpg)
Raspberry Pi can’t read analog
as we know
![Page 47: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/47.jpg)
ADC MCP3008 via SPI
Light Sensor
![Page 48: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/48.jpg)
Habis gelap, terbitlah terang….or demo to turn on the light when it’s dark,
using light sensor
![Page 49: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/49.jpg)
I made a library to read from MCP3008https://github.com/andriyadi/Win10IoT-
AzureIotHub-SmartLamp/blob/master/SmartLamp/lib/MCP3008.js
![Page 50: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/50.jpg)
All demo setup
1 2 3 4
A
B
C
D
4321
D
C
B
A Title
Number RevisionSizeA4
Date: 7-Oct-2015 Sheet ofFile: D:\DYCODE\Layout PCB\Demo.ddb Drawn By:
Q1TRIAC
U1
OPTOTRIAC_1
R2
1K
R1
470
LAMP
AC PLUG
GPIO
Sound Sensor
Current Sensor
PIR Sensor
Webcam
AC Switch
Light Sensor
![Page 51: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/51.jpg)
Summary
Most common RPi features are accessible via Node.js UWP On-going project, keep checking: https://github.com/ms-iot/ntvsiot All of my demo is here: https://github.com/andriyadi/Win10IoT-AzureIotHub-SmartLamp
![Page 52: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/52.jpg)
Custom IoT/hardware for your startup or any custom requirements?
![Page 54: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/54.jpg)
We contribute100+ seminars, workshops, trainings delivered
Delivered to 20+ communities, organisations,
campuses
Next event could be your event!Just drop us a message:
http://edu.dycode.co.id | [email protected]
![Page 55: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/55.jpg)
Our classes
+ + [Obj-C]
+
![Page 56: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/56.jpg)
Opening soon…
+
![Page 57: Raspberry Pi 2 + Windows 10 IoT Core + Node.js](https://reader034.vdocuments.net/reader034/viewer/2022052305/5876063f1a28ab4a508b6a05/html5/thumbnails/57.jpg)
Thanks!Andri YadiEmail — a at dycode dot com twitter — @andri_yadi www — andriyadi.me github — github.com/andriyadi