SlideShare uma empresa Scribd logo
1 de 20
Baixar para ler offline
Samsung Open Source Group 1 #CampOSV #InOut2018
Easy IoT with Javascript
Philippe Coval
Samsung Open Source Group / SRUK
philippe.coval@osg.samsung.com
Using FLOSS: Node.js, IoT.js, W3C and more
#CampOSV Hackathon
#InOut2018, Rennes <2018-03-13>
Samsung Open Source Group 2 #CampOSV #InOut2018
$ who am i
● Philippe Coval from Samsung OSG
– Belongs to SRUK team, based in Rennes, France
– Interests: Libre Soft/Hard/ware, IoT, DIY...
– Communities: Tizen, IoTivity, Automotive, Yocto...
– Ask me for help online: https://wiki.tizen.org/wiki/User:Pcoval
Samsung Open Source Group 3 #CampOSV #InOut2018
What is Internet of Things ?
● Any thing:
– Computers, desktop, laptop, servers
●
Cars are 4 wheeled computers
– “Smart” personal/shared product
●
TV, Mobile, Wearable, Home
– Embedded systems
– Low cost constrained devices
●
Micro controllers
●
dummy connected sensor ?
● That can be connected to :
– Other things (using IP)
– Or Internet ? (through a gateway)
● New word for embedded ?
– Scale is really different !
● What matters:
● Connectivity → Security
● Low Cost → Ubiquitous
● Power → Performance
●
Openness
→ OS/Applications/Services
● Interoperability
→IoT not silos!
Samsung Open Source Group 4 #CampOSV #InOut2018
JavaScript history
● Hi level interpreted programming language
– was influenced by Self (Smalltalk) and Scheme
● Invented in 1995 then shipped into:
– Netscape 2.0 Web browser then Enterprise Server
● Standardized in 1997
– by European Computer Manufacturers Association (ECMA)
● JSON: JavaScript object model introduced in 2000 (vs XML)
● Massive adoption by Web Community and more:
– 2009: NodeJS, CommonJS, 2011: WebGL NaCL, 2017: WebAssembly
Samsung Open Source Group 5 #CampOSV #InOut2018
Motivations for JavaScript for IoT
● JavaScript is everywhere!
– Many web developers → Many application developers
● Easy leaning curve, Faster and Lower cost of development:
– Standardized and established communities
● Node.JS is the leading JavaScript runtime (based on V8 engine)
– NPM repo over 500K modules
● JS Interpreter can fit even into constrained devices
– Embedded devs to focus more on platforms than apps
Samsung Open Source Group 6
“The secret of getting ahead
is getting started.”
~ Mark Twain
Samsung Open Source Group 7 #CampOSV #InOut2018
IoT Platforms, supporting JavaScript ?
● No OS (Baremetal): Optimal, low portability, slow and costly
– Usually in C or Assembly
● Full featured OS? Like GNU/Linux (or derived Tizen)
– Standard APIs: POSIX, Huge community: distros, packages...
● but more resource consuming: Memory, Power (on battery?), slower to boot
● Or dedicated platforms for constrained devices:
– JerryScript engine featured in: IoT.js, Zephyr.js (on Linux or Zephyr kernel), RIOT
● Tizen:RT is supporting IoT.js (based on NuttX kernel)
– Others JS: ducktape, Espruino, MuJS, tiny-js, v7/mjs, quad-wheel
● Alternatives: Johnny Five, CyclonJS, Ruff, Micro Python or many RTOS
Samsung Open Source Group 8 #CampOSV #InOut2018
Installing IoT.js runtime
● Rebuild for OS/Hardware:
– https://github.com/Samsung/iotjs/
● Or install for Raspberry Pi 0+
– download .deb package
– https://dl.bintray.com/rzr/
● Write hello world & run it:
Hello IoT.js
{
"env": { //...
"IOTJS_ENV": "",
"IOTJS_EXTRA_MODULE_PATH":
""
},
"builtin_modules": { //...
"platform": "linux", (...) }
"iotjs": {
"board": ""
},
"argv": [
"iotjs",
"demo.js"
],
// (...)
}
● cat demo.js
console.log(“Hello IoT.js”)
console.log(process)
● iotjs demo.js
Samsung Open Source Group 9 #CampOSV #InOut2018
Connectivity and protocols
● Different contexts:
– Permanent or intermittent connected ?
– Single of both way channels?
– Topologies & architectures: Mesh/P2P, Star, Gateway, Cloud centric...
– Fixed or moving ? Wired or Radio ?
● Personal (Bluetooth, BLE, NFC), Local (Ethernet, WiFi, Zigbee, Zwave, Thread, 6loWPAN)
● City (DSL, Cellular, WiMax, 5G, LPWAN, NB-IoT, V2X), Region, Global (Sat)
● No single protocols !
– Publisher/ Subscriber: MQTT
– Request/Response: HTTP/S, RESTful API, CoAP, IoTivity
– Real time: plain sockets, WebSockets
● Will be somehow visible/monitored/controlled using Internet technologies (browsers, apps)
Samsung Open Source Group 10 #CampOSV #InOut2018
Example: Using IoT.js’ HTTP module
●
Post message to mastodon micro blogging service
– Create account on: https://instances.social
● Or use nodejs’s NPM: https://www.npmjs.com/package/mastodon-lite
● Try many WebServices, APIs
– Examples: Rennes OpenData, PSA’s Connected Car
– https://www.programmableweb.com/apis/directory
var config = {
method: “POST”,
hostname : 'mastodon.social',
port : 443,
path: “/api/v1/statuses”,
headers: {...(access_token)...}
}
http.request(config,
function(res) {
receive(res, callback);
}).end();
git clone https://github.com/rzr/mastodon-lite
cd mastodon-lite
IOTJS_EXTRA_MODULE_PATH=. 
iotjs main.js 
"Hi @TizenHelper from #IotJs"
Samsung Open Source Group 11 #CampOSV #InOut2018
Physical world and Input/Output
● Analog: Measured phenomena
– Physics, Chemicals, Probabilities
● Digital: States (ON/OFF)
– →Several bits
● Analog↔Digital conversion
– Quantification
● Time matters
– Periodic (frequencies)
● Sensors and actuators
● I/O Pins
– GPIO: General Input (or) Output
●
Numeric: 3.3v = 1 , 0v = 0
●
Used for input: buttons, switch
– or output: relay, LED, lights
– PWM: Pulse width modulation
● Pulse signal (frequency)
●
Used for buzzer, motors, dimmed LED
– UART: Universal Asynchronous Receiver Transmitter
●
Serial line: Send (TX) / Receive (RX) data
●
Speed in baud (bit per second)
●
Used for console, modems, peripheral MCU
– I2C & SPI buses
●
Used for chips (ADC/DAC, sensors, memory)
Samsung Open Source Group 12 #CampOSV #InOut2018
Using generic sensors
● Easy High level abstractions of sensors for Node.js or IoT.js:
git clone https://github.com/rzr/generic-sensors-lite
● + Temperature (BMPx80), gaz (MQ), accelerometer, proximity….
var ambientlight = new GenericSensors.AmbientLight({ frequency: 1 });
ambientlight.onreading = function() {
console.log("log: ambientlight: " + ambientlight.illuminance);
};
iotjs example
log: ambientlight: 42
...
pulls bh1750
patched NPM module
(for iotjs’s i2c API)
Samsung Open Source Group 13 #CampOSV #InOut2018
Standards and interoperability
● Web success:
– Common protocol:
● HTTP based on IP
– With network neutrality
– Common data models
● HTML/XML (subset of SGML)
– Working implementation
● Web browsers
– = Massive adoption by humans
● IoT challenges:
– Interoperability between
● protocols:
– Seamless connectivity
– Support non IP networks
● products & API:
– What is a lamp ?
● How to turn it on/off?
– Easy and Reliable
● Secure & Privacy friendly
Samsung Open Source Group 14 #CampOSV #InOut2018
Automotive Hackathon challenge
● Embed a computer on Vehicle
– expose some vehicle data,
● RPM, sensor, position, speed, ...
– to nearby devices:
● phone, tablet, others...
● Using JS & web standards
– WebSockets
– RESTful:
● HTTP(s), OCF/IoTivity
● Along existing FLOSS:
– Avoid “Not Invented Here” (NIH)
● Automotive projects/communities:
– W3C: Vehicle Information S, WoT
● https://www.w3.org/TR/
● http://schema.org/Car
– Automotive Grade Linux (AGL):
● https://www.automotivelinux.org/
– GENIVI:
● https://www.genivi.org/
– Open Connectivity: ocf-automotive
● https://wiki.iotivity.org/automotive
Samsung Open Source Group 15
“Any sufficiently
advanced technology
is indistinguishable
from magic.”
~ Arthur C. Clarke
Samsung Open Source Group 16 https://fosdem.org/2018/schedule/event/tizen_rt/
DIY: mobile air quality monitor, and beyond?
Demo code (WIP):
https://github.com/rzr/TizenRT
LoRaLoRa
LoRa
LoRa
GPS
GPS
OCFOCF
OCF
OCF
Samsung Open Source Group 17 https://fosdem.org/2018/schedule/event/tizen_rt/
Showcase: Tizen:RT, LoRaWAN, IoT.js
https://youtu.be/S7zpBpnpflU#tizen-rt-lpwan-20180204rzr
● https://my.wirelessthings.be/index.php/device/device_view/1229
18 #LFALS
Showcase: SmartHome+Automotive #CES2017
https://youtu.be/3d0uZE6lHvo#smarthome-ces2017
Samsung Open Source Group 19 #CampOSV #InOut2018
References
● Entry points:
– http://iotjs.net
● More:
– https://fosdem.org/2018/schedule/track/internet_of_things/
– https://blogs.s-osg.org/?s=iotjs
– http://wiki.iotivity.org/automotive
● Keep in touch online:
– https://blogs.s-osg.org/author/pcoval/
– https://wiki.tizen.org/wiki/Meeting
Samsung Open Source Group 20 #CampOSV #InOut2018
Thanks / Merci
Contact:
https://wiki.tizen.org/wiki/User:Pcoval
Resources: flaticons CC

Mais conteúdo relacionado

Mais procurados

Mais procurados (19)

IoTivity: Smart Home to Automotive and Beyond
IoTivity: Smart Home to Automotive and BeyondIoTivity: Smart Home to Automotive and Beyond
IoTivity: Smart Home to Automotive and Beyond
 
IoTivity on Tizen: How to
IoTivity on Tizen: How toIoTivity on Tizen: How to
IoTivity on Tizen: How to
 
IoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT InteroperabilityIoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT Interoperability
 
Tizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT DevicesTizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
 
SOSCON 2016 JerryScript
SOSCON 2016 JerryScriptSOSCON 2016 JerryScript
SOSCON 2016 JerryScript
 
tdc2015-strategy-devel-20150916
tdc2015-strategy-devel-20150916tdc2015-strategy-devel-20150916
tdc2015-strategy-devel-20150916
 
IoTivity for Automotive: meta-ocf-automotive tutorial
IoTivity for Automotive: meta-ocf-automotive tutorialIoTivity for Automotive: meta-ocf-automotive tutorial
IoTivity for Automotive: meta-ocf-automotive tutorial
 
Internet of Smaller Things
Internet of Smaller ThingsInternet of Smaller Things
Internet of Smaller Things
 
Iotivity atmel-20150328rzr
Iotivity atmel-20150328rzrIotivity atmel-20150328rzr
Iotivity atmel-20150328rzr
 
JerryScript on RIOT
JerryScript on RIOTJerryScript on RIOT
JerryScript on RIOT
 
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...
 
IoT Meets Security
IoT Meets SecurityIoT Meets Security
IoT Meets Security
 
Introduction to Linux-wpan and Potential Collaboration
Introduction to Linux-wpan and Potential CollaborationIntroduction to Linux-wpan and Potential Collaboration
Introduction to Linux-wpan and Potential Collaboration
 
Tizen Connected with IoTivity
Tizen Connected with IoTivityTizen Connected with IoTivity
Tizen Connected with IoTivity
 
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux DeviceAdding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
 
Introduction to IoT.JS
Introduction to IoT.JSIntroduction to IoT.JS
Introduction to IoT.JS
 
The complex IoT equation, and FLOSS solutions, OW2con'18, June 7-8, 2018, Paris
The complex IoT equation, and FLOSS solutions, OW2con'18, June 7-8, 2018, ParisThe complex IoT equation, and FLOSS solutions, OW2con'18, June 7-8, 2018, Paris
The complex IoT equation, and FLOSS solutions, OW2con'18, June 7-8, 2018, Paris
 
webthing-floss-iot-20180607rzr
webthing-floss-iot-20180607rzrwebthing-floss-iot-20180607rzr
webthing-floss-iot-20180607rzr
 
Iotivity tizen-fosdem-2015
Iotivity tizen-fosdem-2015Iotivity tizen-fosdem-2015
Iotivity tizen-fosdem-2015
 

Semelhante a Easy IoT with JavaScript

IoT: From Arduino MicroControllers to Tizen Products Using IoTivity - Philipp...
IoT: From Arduino MicroControllers to Tizen Products Using IoTivity - Philipp...IoT: From Arduino MicroControllers to Tizen Products Using IoTivity - Philipp...
IoT: From Arduino MicroControllers to Tizen Products Using IoTivity - Philipp...
WithTheBest
 
BYOD Revisited: Build Your Own Device (Embedded Linux Conference 2014)
BYOD Revisited: Build Your Own Device (Embedded Linux Conference 2014)BYOD Revisited: Build Your Own Device (Embedded Linux Conference 2014)
BYOD Revisited: Build Your Own Device (Embedded Linux Conference 2014)
Ron Munitz
 
The internet of things in now , see how golang is a part of this evolution
The internet of things in now , see how golang is a part of this evolutionThe internet of things in now , see how golang is a part of this evolution
The internet of things in now , see how golang is a part of this evolution
Yoni Davidson
 

Semelhante a Easy IoT with JavaScript (20)

The Complex IoT Equation (and FLOSS solutions)
The Complex IoT Equation (and FLOSS solutions)The Complex IoT Equation (and FLOSS solutions)
The Complex IoT Equation (and FLOSS solutions)
 
webthing-iotjs-20181027rzr
webthing-iotjs-20181027rzrwebthing-iotjs-20181027rzr
webthing-iotjs-20181027rzr
 
webthing-iotjs-tizenrt-cdl2018-20181117rzr
webthing-iotjs-tizenrt-cdl2018-20181117rzrwebthing-iotjs-tizenrt-cdl2018-20181117rzr
webthing-iotjs-tizenrt-cdl2018-20181117rzr
 
web-of-twins-20190604rzr
web-of-twins-20190604rzrweb-of-twins-20190604rzr
web-of-twins-20190604rzr
 
tizen-rt-javascript-20181011
tizen-rt-javascript-20181011tizen-rt-javascript-20181011
tizen-rt-javascript-20181011
 
digital-twins-webthings-iotjs-20190512rzr
digital-twins-webthings-iotjs-20190512rzrdigital-twins-webthings-iotjs-20190512rzr
digital-twins-webthings-iotjs-20190512rzr
 
Connected TIZEN
Connected TIZENConnected TIZEN
Connected TIZEN
 
IoT: From Arduino MicroControllers to Tizen Products Using IoTivity - Philipp...
IoT: From Arduino MicroControllers to Tizen Products Using IoTivity - Philipp...IoT: From Arduino MicroControllers to Tizen Products Using IoTivity - Philipp...
IoT: From Arduino MicroControllers to Tizen Products Using IoTivity - Philipp...
 
mozilla-things-fosdem-2019
mozilla-things-fosdem-2019mozilla-things-fosdem-2019
mozilla-things-fosdem-2019
 
BYOD Revisited: Build Your Own Device (Embedded Linux Conference 2014)
BYOD Revisited: Build Your Own Device (Embedded Linux Conference 2014)BYOD Revisited: Build Your Own Device (Embedded Linux Conference 2014)
BYOD Revisited: Build Your Own Device (Embedded Linux Conference 2014)
 
Wearables and IoT Strategy
Wearables and IoT StrategyWearables and IoT Strategy
Wearables and IoT Strategy
 
The internet of things in now , see how golang is a part of this evolution
The internet of things in now , see how golang is a part of this evolutionThe internet of things in now , see how golang is a part of this evolution
The internet of things in now , see how golang is a part of this evolution
 
Headless Android (Wearable DevCon 2014)
Headless Android (Wearable DevCon 2014)Headless Android (Wearable DevCon 2014)
Headless Android (Wearable DevCon 2014)
 
Introduction to NodeJS
Introduction to NodeJSIntroduction to NodeJS
Introduction to NodeJS
 
Create IoT with Open Source Hardware, Tizen and HTML5
Create IoT with Open Source Hardware, Tizen and HTML5Create IoT with Open Source Hardware, Tizen and HTML5
Create IoT with Open Source Hardware, Tizen and HTML5
 
aframe-webthing-20190710
aframe-webthing-20190710aframe-webthing-20190710
aframe-webthing-20190710
 
BKK16-500K2 CTO talk - The End to End Story
BKK16-500K2 CTO talk - The End to End StoryBKK16-500K2 CTO talk - The End to End Story
BKK16-500K2 CTO talk - The End to End Story
 
Node-RED Interoperability Test
Node-RED Interoperability TestNode-RED Interoperability Test
Node-RED Interoperability Test
 
IoT Session Thomas More
IoT Session Thomas MoreIoT Session Thomas More
IoT Session Thomas More
 
Cc internet of things @ Thomas More
Cc internet of things @ Thomas MoreCc internet of things @ Thomas More
Cc internet of things @ Thomas More
 

Mais de Samsung Open Source Group

Mais de Samsung Open Source Group (9)

Spawny: A New Approach to Logins
Spawny: A New Approach to LoginsSpawny: A New Approach to Logins
Spawny: A New Approach to Logins
 
Rapid SPi Device Driver Development over USB
Rapid SPi Device Driver Development over USBRapid SPi Device Driver Development over USB
Rapid SPi Device Driver Development over USB
 
Open Source Metrics to Inform Corporate Strategy
Open Source Metrics to Inform Corporate StrategyOpen Source Metrics to Inform Corporate Strategy
Open Source Metrics to Inform Corporate Strategy
 
Run Your Own 6LoWPAN Based IoT Network
Run Your Own 6LoWPAN Based IoT NetworkRun Your Own 6LoWPAN Based IoT Network
Run Your Own 6LoWPAN Based IoT Network
 
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of ThingsJerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
 
Clang: More than just a C/C++ Compiler
Clang: More than just a C/C++ CompilerClang: More than just a C/C++ Compiler
Clang: More than just a C/C++ Compiler
 
OIC AGL Collaboration
OIC AGL CollaborationOIC AGL Collaboration
OIC AGL Collaboration
 
IoTivity Connects RVI from GENIVI's Develoment Platform to Tizen devices
IoTivity Connects RVI from GENIVI's Develoment Platform to Tizen devicesIoTivity Connects RVI from GENIVI's Develoment Platform to Tizen devices
IoTivity Connects RVI from GENIVI's Develoment Platform to Tizen devices
 
6LoWPAN: An Open IoT Networking Protocol
6LoWPAN: An Open IoT Networking Protocol6LoWPAN: An Open IoT Networking Protocol
6LoWPAN: An Open IoT Networking Protocol
 

Último

Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
chiefasafspells
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 

Último (20)

%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 

Easy IoT with JavaScript

  • 1. Samsung Open Source Group 1 #CampOSV #InOut2018 Easy IoT with Javascript Philippe Coval Samsung Open Source Group / SRUK philippe.coval@osg.samsung.com Using FLOSS: Node.js, IoT.js, W3C and more #CampOSV Hackathon #InOut2018, Rennes <2018-03-13>
  • 2. Samsung Open Source Group 2 #CampOSV #InOut2018 $ who am i ● Philippe Coval from Samsung OSG – Belongs to SRUK team, based in Rennes, France – Interests: Libre Soft/Hard/ware, IoT, DIY... – Communities: Tizen, IoTivity, Automotive, Yocto... – Ask me for help online: https://wiki.tizen.org/wiki/User:Pcoval
  • 3. Samsung Open Source Group 3 #CampOSV #InOut2018 What is Internet of Things ? ● Any thing: – Computers, desktop, laptop, servers ● Cars are 4 wheeled computers – “Smart” personal/shared product ● TV, Mobile, Wearable, Home – Embedded systems – Low cost constrained devices ● Micro controllers ● dummy connected sensor ? ● That can be connected to : – Other things (using IP) – Or Internet ? (through a gateway) ● New word for embedded ? – Scale is really different ! ● What matters: ● Connectivity → Security ● Low Cost → Ubiquitous ● Power → Performance ● Openness → OS/Applications/Services ● Interoperability →IoT not silos!
  • 4. Samsung Open Source Group 4 #CampOSV #InOut2018 JavaScript history ● Hi level interpreted programming language – was influenced by Self (Smalltalk) and Scheme ● Invented in 1995 then shipped into: – Netscape 2.0 Web browser then Enterprise Server ● Standardized in 1997 – by European Computer Manufacturers Association (ECMA) ● JSON: JavaScript object model introduced in 2000 (vs XML) ● Massive adoption by Web Community and more: – 2009: NodeJS, CommonJS, 2011: WebGL NaCL, 2017: WebAssembly
  • 5. Samsung Open Source Group 5 #CampOSV #InOut2018 Motivations for JavaScript for IoT ● JavaScript is everywhere! – Many web developers → Many application developers ● Easy leaning curve, Faster and Lower cost of development: – Standardized and established communities ● Node.JS is the leading JavaScript runtime (based on V8 engine) – NPM repo over 500K modules ● JS Interpreter can fit even into constrained devices – Embedded devs to focus more on platforms than apps
  • 6. Samsung Open Source Group 6 “The secret of getting ahead is getting started.” ~ Mark Twain
  • 7. Samsung Open Source Group 7 #CampOSV #InOut2018 IoT Platforms, supporting JavaScript ? ● No OS (Baremetal): Optimal, low portability, slow and costly – Usually in C or Assembly ● Full featured OS? Like GNU/Linux (or derived Tizen) – Standard APIs: POSIX, Huge community: distros, packages... ● but more resource consuming: Memory, Power (on battery?), slower to boot ● Or dedicated platforms for constrained devices: – JerryScript engine featured in: IoT.js, Zephyr.js (on Linux or Zephyr kernel), RIOT ● Tizen:RT is supporting IoT.js (based on NuttX kernel) – Others JS: ducktape, Espruino, MuJS, tiny-js, v7/mjs, quad-wheel ● Alternatives: Johnny Five, CyclonJS, Ruff, Micro Python or many RTOS
  • 8. Samsung Open Source Group 8 #CampOSV #InOut2018 Installing IoT.js runtime ● Rebuild for OS/Hardware: – https://github.com/Samsung/iotjs/ ● Or install for Raspberry Pi 0+ – download .deb package – https://dl.bintray.com/rzr/ ● Write hello world & run it: Hello IoT.js { "env": { //... "IOTJS_ENV": "", "IOTJS_EXTRA_MODULE_PATH": "" }, "builtin_modules": { //... "platform": "linux", (...) } "iotjs": { "board": "" }, "argv": [ "iotjs", "demo.js" ], // (...) } ● cat demo.js console.log(“Hello IoT.js”) console.log(process) ● iotjs demo.js
  • 9. Samsung Open Source Group 9 #CampOSV #InOut2018 Connectivity and protocols ● Different contexts: – Permanent or intermittent connected ? – Single of both way channels? – Topologies & architectures: Mesh/P2P, Star, Gateway, Cloud centric... – Fixed or moving ? Wired or Radio ? ● Personal (Bluetooth, BLE, NFC), Local (Ethernet, WiFi, Zigbee, Zwave, Thread, 6loWPAN) ● City (DSL, Cellular, WiMax, 5G, LPWAN, NB-IoT, V2X), Region, Global (Sat) ● No single protocols ! – Publisher/ Subscriber: MQTT – Request/Response: HTTP/S, RESTful API, CoAP, IoTivity – Real time: plain sockets, WebSockets ● Will be somehow visible/monitored/controlled using Internet technologies (browsers, apps)
  • 10. Samsung Open Source Group 10 #CampOSV #InOut2018 Example: Using IoT.js’ HTTP module ● Post message to mastodon micro blogging service – Create account on: https://instances.social ● Or use nodejs’s NPM: https://www.npmjs.com/package/mastodon-lite ● Try many WebServices, APIs – Examples: Rennes OpenData, PSA’s Connected Car – https://www.programmableweb.com/apis/directory var config = { method: “POST”, hostname : 'mastodon.social', port : 443, path: “/api/v1/statuses”, headers: {...(access_token)...} } http.request(config, function(res) { receive(res, callback); }).end(); git clone https://github.com/rzr/mastodon-lite cd mastodon-lite IOTJS_EXTRA_MODULE_PATH=. iotjs main.js "Hi @TizenHelper from #IotJs"
  • 11. Samsung Open Source Group 11 #CampOSV #InOut2018 Physical world and Input/Output ● Analog: Measured phenomena – Physics, Chemicals, Probabilities ● Digital: States (ON/OFF) – →Several bits ● Analog↔Digital conversion – Quantification ● Time matters – Periodic (frequencies) ● Sensors and actuators ● I/O Pins – GPIO: General Input (or) Output ● Numeric: 3.3v = 1 , 0v = 0 ● Used for input: buttons, switch – or output: relay, LED, lights – PWM: Pulse width modulation ● Pulse signal (frequency) ● Used for buzzer, motors, dimmed LED – UART: Universal Asynchronous Receiver Transmitter ● Serial line: Send (TX) / Receive (RX) data ● Speed in baud (bit per second) ● Used for console, modems, peripheral MCU – I2C & SPI buses ● Used for chips (ADC/DAC, sensors, memory)
  • 12. Samsung Open Source Group 12 #CampOSV #InOut2018 Using generic sensors ● Easy High level abstractions of sensors for Node.js or IoT.js: git clone https://github.com/rzr/generic-sensors-lite ● + Temperature (BMPx80), gaz (MQ), accelerometer, proximity…. var ambientlight = new GenericSensors.AmbientLight({ frequency: 1 }); ambientlight.onreading = function() { console.log("log: ambientlight: " + ambientlight.illuminance); }; iotjs example log: ambientlight: 42 ... pulls bh1750 patched NPM module (for iotjs’s i2c API)
  • 13. Samsung Open Source Group 13 #CampOSV #InOut2018 Standards and interoperability ● Web success: – Common protocol: ● HTTP based on IP – With network neutrality – Common data models ● HTML/XML (subset of SGML) – Working implementation ● Web browsers – = Massive adoption by humans ● IoT challenges: – Interoperability between ● protocols: – Seamless connectivity – Support non IP networks ● products & API: – What is a lamp ? ● How to turn it on/off? – Easy and Reliable ● Secure & Privacy friendly
  • 14. Samsung Open Source Group 14 #CampOSV #InOut2018 Automotive Hackathon challenge ● Embed a computer on Vehicle – expose some vehicle data, ● RPM, sensor, position, speed, ... – to nearby devices: ● phone, tablet, others... ● Using JS & web standards – WebSockets – RESTful: ● HTTP(s), OCF/IoTivity ● Along existing FLOSS: – Avoid “Not Invented Here” (NIH) ● Automotive projects/communities: – W3C: Vehicle Information S, WoT ● https://www.w3.org/TR/ ● http://schema.org/Car – Automotive Grade Linux (AGL): ● https://www.automotivelinux.org/ – GENIVI: ● https://www.genivi.org/ – Open Connectivity: ocf-automotive ● https://wiki.iotivity.org/automotive
  • 15. Samsung Open Source Group 15 “Any sufficiently advanced technology is indistinguishable from magic.” ~ Arthur C. Clarke
  • 16. Samsung Open Source Group 16 https://fosdem.org/2018/schedule/event/tizen_rt/ DIY: mobile air quality monitor, and beyond? Demo code (WIP): https://github.com/rzr/TizenRT LoRaLoRa LoRa LoRa GPS GPS OCFOCF OCF OCF
  • 17. Samsung Open Source Group 17 https://fosdem.org/2018/schedule/event/tizen_rt/ Showcase: Tizen:RT, LoRaWAN, IoT.js https://youtu.be/S7zpBpnpflU#tizen-rt-lpwan-20180204rzr ● https://my.wirelessthings.be/index.php/device/device_view/1229
  • 18. 18 #LFALS Showcase: SmartHome+Automotive #CES2017 https://youtu.be/3d0uZE6lHvo#smarthome-ces2017
  • 19. Samsung Open Source Group 19 #CampOSV #InOut2018 References ● Entry points: – http://iotjs.net ● More: – https://fosdem.org/2018/schedule/track/internet_of_things/ – https://blogs.s-osg.org/?s=iotjs – http://wiki.iotivity.org/automotive ● Keep in touch online: – https://blogs.s-osg.org/author/pcoval/ – https://wiki.tizen.org/wiki/Meeting
  • 20. Samsung Open Source Group 20 #CampOSV #InOut2018 Thanks / Merci Contact: https://wiki.tizen.org/wiki/User:Pcoval Resources: flaticons CC