SlideShare a Scribd company logo
1 of 20
Download to read 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

More Related Content

What's hot

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 BeyondSamsung Open Source Group
 
IoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT InteroperabilityIoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT InteroperabilitySamsung Open Source Group
 
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 DevicesSamsung Open Source Group
 
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 tutorialSamsung Open Source Group
 
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...Samsung Open Source Group
 
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 CollaborationSamsung Open Source Group
 
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 DeviceSamsung Open Source Group
 
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, ParisOW2
 

What's hot (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
 

Similar to Easy IoT with JavaScript

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)Samsung Open Source Group
 
webthing-iotjs-tizenrt-cdl2018-20181117rzr
webthing-iotjs-tizenrt-cdl2018-20181117rzrwebthing-iotjs-tizenrt-cdl2018-20181117rzr
webthing-iotjs-tizenrt-cdl2018-20181117rzrPhil www.rzr.online.fr
 
digital-twins-webthings-iotjs-20190512rzr
digital-twins-webthings-iotjs-20190512rzrdigital-twins-webthings-iotjs-20190512rzr
digital-twins-webthings-iotjs-20190512rzrPhil www.rzr.online.fr
 
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
 
Wearables and IoT Strategy
Wearables and IoT StrategyWearables and IoT Strategy
Wearables and IoT StrategyAllSeen Alliance
 
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 evolutionYoni Davidson
 
Headless Android (Wearable DevCon 2014)
Headless Android (Wearable DevCon 2014)Headless Android (Wearable DevCon 2014)
Headless Android (Wearable DevCon 2014)Ron Munitz
 
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 HTML5Leon Anavi
 
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 StoryLinaro
 
Node-RED Interoperability Test
Node-RED Interoperability TestNode-RED Interoperability Test
Node-RED Interoperability TestBoris Adryan
 

Similar to 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
 

More from Samsung Open Source Group

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 USBSamsung Open Source Group
 
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 StrategySamsung Open Source Group
 
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 ThingsSamsung Open Source Group
 
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 devicesSamsung Open Source Group
 

More from 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
 

Recently uploaded

Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 

Recently uploaded (20)

Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 

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