SlideShare uma empresa Scribd logo
1 de 35
Baixar para ler offline
Bring JavaScript to the Internet of
Things - From Embedded Device to Smart
Gateway
Ziran Sun ( ziran.sun@samsung.com)
Philippe Coval (p.coval@samsung.com)
Samsung Research, UK
Feb, 2019
FOSDEM, Brussels
1. Why JavaScript in IoT?
2. JavaScript on Embedded Device
a. Ultra-Light JS Engine - JerryScript
b. IoT Platforms on JerryScript
3. JavaScript on Smart Gateway
4. Put It Together - A Simple Demo
5. WebThings API
6. There Are MORE You Can Do...
Contents
1. Why JavaScript in IoT?
JavaScript is a good fit for IoT:
● Popularity
● Maturity
● Productivity
“Any application that can be written in JavaScript will eventually be written in
JavaScript.” - Jeff Atwood
2. JavaScript on Embedded
Device
IoT HardWare [1]
(Table credit to Tilmann Scheller)
2a. Ultra-light JS Engine
-JerryScript by Samsung
JerryScript
● An ultra lightweight JavaScript engine (<64KB RAM, <200 KB ROM,
160KB binary size compiled for ARM Thumb-2)
● Originally developed from scratch by Samsung
● Transferred to JS Foundation in 2016 (https://js.foundation/)
● Self-contained and extremely portable
● Mature C API, easy to embed in applications
JerryScript
● Optimization and performance have been top priorities
● Adding new features:
– Jerry-debugger
– ES6 related features
– More hardware and OS supports
● Fast growing community
ESP8266 ARM MBED STM32F4 discovery
Board with Nuttx, RIOT
OpenWrt
Particle firmware on
Photon board
TizenRT on
ARTIK 05x
Hardware and OS Supports (JerryScript Github)
Zephyr OS on
Arduino 101
Raspberry Pi 2
JerryScript in Smartwatch [2]
2b. IoT platforms based on
JerryScript
IoT JavaScript Platforms based on JerryScript
● IoT.js by Samsung
a. Lightweight version of node.js for constrained devices
b. Hardware and OS supports are well inline with JerryScript.
● Zephyr.js by Intel
a. JavaScript* Runtime for Zephyr OS
b. Node.js* like APIs
3. JavaScript on Smart
Gateway
Things Gateway By Mozilla [4]
Project Things
(Diagram credit to Ben Francis)
Things Gateway - Security
● HTTPS via mozilla-iot.org tunnelling service
a. Allow setting up a secure subdomains with
LetsEncrypt TLS certificates
b. TCP tunnel uses PageKite from Mozilla cloud
server to Gateway
● OAuth to authorise third party apps & services
● JSON Web Tokens (JWT) used for authentication
4. Put it Together - A
Simple Demo
Turn on your light by clapping hands
https://vimeo.com/user90242752/review/293325534/5d519c4bc7
Demo video
Software on Device
5. WebThings API
WebThings API
● Thing: standalone HTTP server (+Websockets)
○ REST Endpoints (for gateway’s interaction):
■ Things / Properties / Values
■ Plus Actions & Events
○ Models are described using schemas (JSON)
● Several Technologies:
○ JavaScript: using Node.js or IoT.js
○ Native (C++), Python (& uPy), RUST…
WebThings-IoT.js
● Fork of webthing-node for IoT.js runtime
○ Port to older ECMAScript 5.1
○ Backward compatible for Node.JS
● Support: ADC, GPIO (+ some NPMs)
● Some features not yet implemented:
○ Websockets for real time (events & actions)
○ mDNS for discovery
● https://www.npmjs.com/package/webthing-iotjs
Implementing a Webthing server:
var webthing = require('webthing-iotjs');
var thing = new webthing.Thing(‘SomeSensor’);
var server = new webthing.WebThingServer
(new webthing.SingleThing(thing), 8888);
server.start();
$ curl http://localhost:8888
{ "name":"SomeSensor", "href":"/",
"@context":"https://iot.mozilla.org/schemas",
"@type":[null],
"properties":{},
"links":[{"rel":"properties","href":"/properties"}]}
Color as webthing property:
function ColorProperty(thing) {
webthing.Property.call(this, thing, 'Color',
new webthing.Value(‘#000000’),
{ '@type': 'ColorProperty', type: 'string',
readOnly: true });
}
//…
var thing = new webthing.Thing(‘ColorSensor’,
[‘ColorControl’]);
thing.addProperty(new ColorProperty(thing));
//…
server.start();
$ curl http://localhost:8888
{ ...
"properties":{"Color": ...
"links":[
{"rel":"property",
"href":"/properties/Color"
…
Sensor updating webthing
var ColorSensor = require('color-sensor-js/example’); // H.A.L.
function ColorProperty(thing) {
var self = this;
Webthing.Property.call(..., 'Color', new webthing.Value...
this.sensor = new ColorSensor();
this.sensor.onreading = function() {
self.value.notifyOfExternalUpdate(self.sensor.color);
};
this.sensor.start();
}
// More hints: https://github.com/rzr/webthing-iotjs/wiki/Sensor
$ curl http://localhost:8888/properties/Color
{"Color":”#af0695”}
6. There are more you can do...
Live demo !
https://youtu.be/OT0Ahuy3Cv4#webthing-iotjs-opendata-20190202rzr
Extra demos
● Tutorial & Demo recipes:
○ https://github.com/rzr/webthing-iotjs/wiki
● Alternative browser using TAU framework
○ For Tizen or as Progressive Web App:
■ supported by SamsungInternet (Android)
● From IoT to Social Web:
○ using mastodon-lite, IoT.js/Node.js module
● MCU: TizenRT and hints (STM, ESP, Arduino)
WebThing-IoT.js on TizenRT
https://youtu.be/ZT1T-B6I3IM#webthing-iotjs-20181027rzr
WebThing-IoT.js on TizenRT
https://youtu.be/vzoUJ-v5h38#webthing-esp8266-webapp-20180602rzr
Bridge Web to any framework ?
https://youtu.be/k4C9FmsXV30#webthing-iotivity-cdl2018-20181118rzr
Websockets for real time feedback to WebApp
https://youtu.be/xI6eweCZLe8/#web-iot-automotive-20180315rzr
Thank You!
References:
1. “Introduction to IoT.js’,Tillman Scheller, OpenIoT & ELC 2016, San
Diego, CA, Apr 2016..
2. “Fitbit loves JerryScript: JavaScript Breaks into the Internet of
Things”, Michelle Gienow,
https://thenewstack.io/fitbit-%E2%9D%A4%EF%B8%8Fs-jerryscri
pt-javascript-breaks-internet-things/
3. “IoT.js and JerryScript: a JS platform for the embedded world”, Zoltan
Herczeg, Hosung Ki, Node Summit 2017
4. “Building the Web of Things”, Ben Francis,
https://hacks.mozilla.org/2017/06/building-the-web-of-things/

Mais conteúdo relacionado

Mais procurados

OpenStack Introduction
OpenStack IntroductionOpenStack Introduction
OpenStack Introductionopenstackindia
 
Cloud networking deep dive
Cloud networking deep diveCloud networking deep dive
Cloud networking deep diveamylynn11
 
Deploying vn fs with kubernetes pods and vms
Deploying vn fs with kubernetes pods and vmsDeploying vn fs with kubernetes pods and vms
Deploying vn fs with kubernetes pods and vmsLibbySchulze1
 
Introduction to Openstack Network
Introduction to Openstack NetworkIntroduction to Openstack Network
Introduction to Openstack Networksalv_orlando
 
Inside Architecture of Neutron
Inside Architecture of NeutronInside Architecture of Neutron
Inside Architecture of Neutronmarkmcclain
 
Kubernetes Security Updates from Kubecon 2018 Seattle
Kubernetes Security Updates from Kubecon 2018 SeattleKubernetes Security Updates from Kubecon 2018 Seattle
Kubernetes Security Updates from Kubecon 2018 SeattleSuraj Deshmukh
 
Networking For Nested Containers: Magnum, Kuryr, Neutron Integration
Networking For Nested Containers: Magnum, Kuryr, Neutron IntegrationNetworking For Nested Containers: Magnum, Kuryr, Neutron Integration
Networking For Nested Containers: Magnum, Kuryr, Neutron IntegrationFawad Khaliq
 
Istio (service mesh) why and how
Istio (service mesh) why and howIstio (service mesh) why and how
Istio (service mesh) why and howMilan Das
 
OpenStack Neutron Havana Overview - Oct 2013
OpenStack Neutron Havana Overview - Oct 2013OpenStack Neutron Havana Overview - Oct 2013
OpenStack Neutron Havana Overview - Oct 2013Edgar Magana
 
Introducing OpenStack for Beginners
Introducing OpenStack for Beginners Introducing OpenStack for Beginners
Introducing OpenStack for Beginners openstackindia
 
Intro to creating kubernetes operators
Intro to creating kubernetes operators Intro to creating kubernetes operators
Intro to creating kubernetes operators Juraj Hantak
 
CoreOS Battle Stories
CoreOS Battle StoriesCoreOS Battle Stories
CoreOS Battle StoriesKontena, Inc.
 
MQTT - REST Bridge using the Smart Object API
MQTT - REST Bridge using the Smart Object APIMQTT - REST Bridge using the Smart Object API
MQTT - REST Bridge using the Smart Object APIMichael Koster
 
Cncf storage-final-filip
Cncf storage-final-filipCncf storage-final-filip
Cncf storage-final-filipJuraj Hantak
 
Microservices: AutoScaling in Hyper-Microservice Architecture | Nguyễn Trung ...
Microservices: AutoScaling in Hyper-Microservice Architecture | Nguyễn Trung ...Microservices: AutoScaling in Hyper-Microservice Architecture | Nguyễn Trung ...
Microservices: AutoScaling in Hyper-Microservice Architecture | Nguyễn Trung ...Vietnam Open Infrastructure User Group
 
OpenStack Israel Meetup - Project Kuryr: Bringing Container Networking to Neu...
OpenStack Israel Meetup - Project Kuryr: Bringing Container Networking to Neu...OpenStack Israel Meetup - Project Kuryr: Bringing Container Networking to Neu...
OpenStack Israel Meetup - Project Kuryr: Bringing Container Networking to Neu...Cloud Native Day Tel Aviv
 
How to deal second interface service discovery and load balancer in kubernetes
How to deal second interface  service discovery and load balancer  in kubernetesHow to deal second interface  service discovery and load balancer  in kubernetes
How to deal second interface service discovery and load balancer in kubernetesMeng-Ze Lee
 
Slow things down to make them go faster [FOSDEM 2022]
Slow things down to make them go faster [FOSDEM 2022]Slow things down to make them go faster [FOSDEM 2022]
Slow things down to make them go faster [FOSDEM 2022]Jimmy Angelakos
 

Mais procurados (20)

OpenStack Introduction
OpenStack IntroductionOpenStack Introduction
OpenStack Introduction
 
Cloud networking deep dive
Cloud networking deep diveCloud networking deep dive
Cloud networking deep dive
 
Deploying vn fs with kubernetes pods and vms
Deploying vn fs with kubernetes pods and vmsDeploying vn fs with kubernetes pods and vms
Deploying vn fs with kubernetes pods and vms
 
Introduction to Openstack Network
Introduction to Openstack NetworkIntroduction to Openstack Network
Introduction to Openstack Network
 
Inside Architecture of Neutron
Inside Architecture of NeutronInside Architecture of Neutron
Inside Architecture of Neutron
 
Kubernetes Security Updates from Kubecon 2018 Seattle
Kubernetes Security Updates from Kubecon 2018 SeattleKubernetes Security Updates from Kubecon 2018 Seattle
Kubernetes Security Updates from Kubecon 2018 Seattle
 
Networking For Nested Containers: Magnum, Kuryr, Neutron Integration
Networking For Nested Containers: Magnum, Kuryr, Neutron IntegrationNetworking For Nested Containers: Magnum, Kuryr, Neutron Integration
Networking For Nested Containers: Magnum, Kuryr, Neutron Integration
 
Istio (service mesh) why and how
Istio (service mesh) why and howIstio (service mesh) why and how
Istio (service mesh) why and how
 
OpenStack Neutron Havana Overview - Oct 2013
OpenStack Neutron Havana Overview - Oct 2013OpenStack Neutron Havana Overview - Oct 2013
OpenStack Neutron Havana Overview - Oct 2013
 
Introducing OpenStack for Beginners
Introducing OpenStack for Beginners Introducing OpenStack for Beginners
Introducing OpenStack for Beginners
 
Intro to creating kubernetes operators
Intro to creating kubernetes operators Intro to creating kubernetes operators
Intro to creating kubernetes operators
 
CoreOS Battle Stories
CoreOS Battle StoriesCoreOS Battle Stories
CoreOS Battle Stories
 
MQTT - REST Bridge using the Smart Object API
MQTT - REST Bridge using the Smart Object APIMQTT - REST Bridge using the Smart Object API
MQTT - REST Bridge using the Smart Object API
 
Cncf storage-final-filip
Cncf storage-final-filipCncf storage-final-filip
Cncf storage-final-filip
 
Microservices: AutoScaling in Hyper-Microservice Architecture | Nguyễn Trung ...
Microservices: AutoScaling in Hyper-Microservice Architecture | Nguyễn Trung ...Microservices: AutoScaling in Hyper-Microservice Architecture | Nguyễn Trung ...
Microservices: AutoScaling in Hyper-Microservice Architecture | Nguyễn Trung ...
 
OpenStack Israel Meetup - Project Kuryr: Bringing Container Networking to Neu...
OpenStack Israel Meetup - Project Kuryr: Bringing Container Networking to Neu...OpenStack Israel Meetup - Project Kuryr: Bringing Container Networking to Neu...
OpenStack Israel Meetup - Project Kuryr: Bringing Container Networking to Neu...
 
How to deal second interface service discovery and load balancer in kubernetes
How to deal second interface  service discovery and load balancer  in kubernetesHow to deal second interface  service discovery and load balancer  in kubernetes
How to deal second interface service discovery and load balancer in kubernetes
 
OpenStack Storage Overview
OpenStack Storage OverviewOpenStack Storage Overview
OpenStack Storage Overview
 
OpenStack Neutron behind the Scenes
OpenStack Neutron behind the ScenesOpenStack Neutron behind the Scenes
OpenStack Neutron behind the Scenes
 
Slow things down to make them go faster [FOSDEM 2022]
Slow things down to make them go faster [FOSDEM 2022]Slow things down to make them go faster [FOSDEM 2022]
Slow things down to make them go faster [FOSDEM 2022]
 

Semelhante a IoT-javascript-2019-fosdem

An Introduction to Node.js Development with Windows Azure
An Introduction to Node.js Development with Windows AzureAn Introduction to Node.js Development with Windows Azure
An Introduction to Node.js Development with Windows AzureTroy Miles
 
Netflix oss season 1 episode 3
Netflix oss season 1 episode 3 Netflix oss season 1 episode 3
Netflix oss season 1 episode 3 Ruslan Meshenberg
 
ITT 2014 - Erik Hellmann - Android Programming - Smarter and Better Networking
ITT 2014 - Erik Hellmann - Android Programming - Smarter and Better NetworkingITT 2014 - Erik Hellmann - Android Programming - Smarter and Better Networking
ITT 2014 - Erik Hellmann - Android Programming - Smarter and Better NetworkingIstanbul Tech Talks
 
Event-driven IO server-side JavaScript environment based on V8 Engine
Event-driven IO server-side JavaScript environment based on V8 EngineEvent-driven IO server-side JavaScript environment based on V8 Engine
Event-driven IO server-side JavaScript environment based on V8 EngineRicardo Silva
 
DIY: Computer Vision with GWT.
DIY: Computer Vision with GWT.DIY: Computer Vision with GWT.
DIY: Computer Vision with GWT.JooinK
 
DIY- computer vision with GWT
DIY- computer vision with GWTDIY- computer vision with GWT
DIY- computer vision with GWTFrancesca Tosi
 
IDEALIZE 2023 - NodeJS & Firebase Session
IDEALIZE 2023 - NodeJS & Firebase SessionIDEALIZE 2023 - NodeJS & Firebase Session
IDEALIZE 2023 - NodeJS & Firebase SessionBrion Mario
 
Nodejs and WebSockets
Nodejs and WebSocketsNodejs and WebSockets
Nodejs and WebSocketsGonzalo Ayuso
 
Fullstack workshop
Fullstack workshopFullstack workshop
Fullstack workshopAssaf Gannon
 
Tech io nodejs_20130531_v0.6
Tech io nodejs_20130531_v0.6Tech io nodejs_20130531_v0.6
Tech io nodejs_20130531_v0.6Ganesh Kondal
 
Real-time Chat Backend on AWS IoT 20160422
Real-time Chat Backend on AWS IoT 20160422Real-time Chat Backend on AWS IoT 20160422
Real-time Chat Backend on AWS IoT 20160422akitsukada
 
Practical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.jsPractical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.jsasync_io
 
Front-end. Global domination
Front-end. Global dominationFront-end. Global domination
Front-end. Global dominationStfalcon Meetups
 
Building AR and VR Experiences for Web Apps with JavaScript
Building AR and VR Experiences for Web Apps with JavaScriptBuilding AR and VR Experiences for Web Apps with JavaScript
Building AR and VR Experiences for Web Apps with JavaScriptFITC
 

Semelhante a IoT-javascript-2019-fosdem (20)

Node azure
Node azureNode azure
Node azure
 
An Introduction to Node.js Development with Windows Azure
An Introduction to Node.js Development with Windows AzureAn Introduction to Node.js Development with Windows Azure
An Introduction to Node.js Development with Windows Azure
 
Netflix oss season 1 episode 3
Netflix oss season 1 episode 3 Netflix oss season 1 episode 3
Netflix oss season 1 episode 3
 
Deep dive into serverless on Google Cloud
Deep dive into serverless on Google CloudDeep dive into serverless on Google Cloud
Deep dive into serverless on Google Cloud
 
ITT 2014 - Erik Hellmann - Android Programming - Smarter and Better Networking
ITT 2014 - Erik Hellmann - Android Programming - Smarter and Better NetworkingITT 2014 - Erik Hellmann - Android Programming - Smarter and Better Networking
ITT 2014 - Erik Hellmann - Android Programming - Smarter and Better Networking
 
Node js
Node jsNode js
Node js
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Event-driven IO server-side JavaScript environment based on V8 Engine
Event-driven IO server-side JavaScript environment based on V8 EngineEvent-driven IO server-side JavaScript environment based on V8 Engine
Event-driven IO server-side JavaScript environment based on V8 Engine
 
The WebKit project
The WebKit projectThe WebKit project
The WebKit project
 
DIY: Computer Vision with GWT.
DIY: Computer Vision with GWT.DIY: Computer Vision with GWT.
DIY: Computer Vision with GWT.
 
DIY- computer vision with GWT
DIY- computer vision with GWTDIY- computer vision with GWT
DIY- computer vision with GWT
 
IDEALIZE 2023 - NodeJS & Firebase Session
IDEALIZE 2023 - NodeJS & Firebase SessionIDEALIZE 2023 - NodeJS & Firebase Session
IDEALIZE 2023 - NodeJS & Firebase Session
 
Nodejs and WebSockets
Nodejs and WebSocketsNodejs and WebSockets
Nodejs and WebSockets
 
Fullstack workshop
Fullstack workshopFullstack workshop
Fullstack workshop
 
Tech io nodejs_20130531_v0.6
Tech io nodejs_20130531_v0.6Tech io nodejs_20130531_v0.6
Tech io nodejs_20130531_v0.6
 
Real-time Chat Backend on AWS IoT 20160422
Real-time Chat Backend on AWS IoT 20160422Real-time Chat Backend on AWS IoT 20160422
Real-time Chat Backend on AWS IoT 20160422
 
Practical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.jsPractical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.js
 
Front-end. Global domination
Front-end. Global dominationFront-end. Global domination
Front-end. Global domination
 
Frontend. Global domination.
Frontend. Global domination.Frontend. Global domination.
Frontend. Global domination.
 
Building AR and VR Experiences for Web Apps with JavaScript
Building AR and VR Experiences for Web Apps with JavaScriptBuilding AR and VR Experiences for Web Apps with JavaScript
Building AR and VR Experiences for Web Apps with JavaScript
 

Mais de Phil 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
 
webthing-iotjs-tizenrt-cdl2018-20181117rzr
webthing-iotjs-tizenrt-cdl2018-20181117rzrwebthing-iotjs-tizenrt-cdl2018-20181117rzr
webthing-iotjs-tizenrt-cdl2018-20181117rzrPhil www.rzr.online.fr
 
FOSDEM2015: Porting Tizen:Common to open source hardware devices
FOSDEM2015: Porting Tizen:Common to open source hardware devicesFOSDEM2015: Porting Tizen:Common to open source hardware devices
FOSDEM2015: Porting Tizen:Common to open source hardware devicesPhil www.rzr.online.fr
 

Mais de Phil www.rzr.online.fr (20)

Iot privacy-soscon-2019
Iot privacy-soscon-2019Iot privacy-soscon-2019
Iot privacy-soscon-2019
 
aframe-webthing-20190710
aframe-webthing-20190710aframe-webthing-20190710
aframe-webthing-20190710
 
web-of-twins-20190604rzr
web-of-twins-20190604rzrweb-of-twins-20190604rzr
web-of-twins-20190604rzr
 
digital-twins-webthings-iotjs-20190512rzr
digital-twins-webthings-iotjs-20190512rzrdigital-twins-webthings-iotjs-20190512rzr
digital-twins-webthings-iotjs-20190512rzr
 
up-down-stream-flows-20190411rzr
up-down-stream-flows-20190411rzrup-down-stream-flows-20190411rzr
up-down-stream-flows-20190411rzr
 
wotxr-20190320rzr
wotxr-20190320rzrwotxr-20190320rzr
wotxr-20190320rzr
 
webthing-iotjs-tizenrt-cdl2018-20181117rzr
webthing-iotjs-tizenrt-cdl2018-20181117rzrwebthing-iotjs-tizenrt-cdl2018-20181117rzr
webthing-iotjs-tizenrt-cdl2018-20181117rzr
 
webthing-iotjs-20181027rzr
webthing-iotjs-20181027rzrwebthing-iotjs-20181027rzr
webthing-iotjs-20181027rzr
 
tizen-rt-javascript-20181011
tizen-rt-javascript-20181011tizen-rt-javascript-20181011
tizen-rt-javascript-20181011
 
webthing-floss-iot-20180607rzr
webthing-floss-iot-20180607rzrwebthing-floss-iot-20180607rzr
webthing-floss-iot-20180607rzr
 
osvehicle-connected-20160429
osvehicle-connected-20160429osvehicle-connected-20160429
osvehicle-connected-20160429
 
tdc2015-strategy-devel-20150916
tdc2015-strategy-devel-20150916tdc2015-strategy-devel-20150916
tdc2015-strategy-devel-20150916
 
tizen-maintain-20150413rzr
tizen-maintain-20150413rzrtizen-maintain-20150413rzr
tizen-maintain-20150413rzr
 
Iotivity atmel-20150328rzr
Iotivity atmel-20150328rzrIotivity atmel-20150328rzr
Iotivity atmel-20150328rzr
 
Tizen store-z1-20150228rzr
Tizen store-z1-20150228rzrTizen store-z1-20150228rzr
Tizen store-z1-20150228rzr
 
Iotivity tizen-fosdem-2015
Iotivity tizen-fosdem-2015Iotivity tizen-fosdem-2015
Iotivity tizen-fosdem-2015
 
FOSDEM2015: Porting Tizen:Common to open source hardware devices
FOSDEM2015: Porting Tizen:Common to open source hardware devicesFOSDEM2015: Porting Tizen:Common to open source hardware devices
FOSDEM2015: Porting Tizen:Common to open source hardware devices
 
tizen-oshw-tds14sh
tizen-oshw-tds14shtizen-oshw-tds14sh
tizen-oshw-tds14sh
 
Tizen platform-dev-tds14sh
Tizen platform-dev-tds14shTizen platform-dev-tds14sh
Tizen platform-dev-tds14sh
 
Tdc2014 tizen common_20140603
Tdc2014 tizen common_20140603Tdc2014 tizen common_20140603
Tdc2014 tizen common_20140603
 

Último

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 

Último (20)

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

IoT-javascript-2019-fosdem

  • 1. Bring JavaScript to the Internet of Things - From Embedded Device to Smart Gateway Ziran Sun ( ziran.sun@samsung.com) Philippe Coval (p.coval@samsung.com) Samsung Research, UK Feb, 2019 FOSDEM, Brussels
  • 2. 1. Why JavaScript in IoT? 2. JavaScript on Embedded Device a. Ultra-Light JS Engine - JerryScript b. IoT Platforms on JerryScript 3. JavaScript on Smart Gateway 4. Put It Together - A Simple Demo 5. WebThings API 6. There Are MORE You Can Do... Contents
  • 4. JavaScript is a good fit for IoT: ● Popularity ● Maturity ● Productivity “Any application that can be written in JavaScript will eventually be written in JavaScript.” - Jeff Atwood
  • 5. 2. JavaScript on Embedded Device
  • 6. IoT HardWare [1] (Table credit to Tilmann Scheller)
  • 7. 2a. Ultra-light JS Engine -JerryScript by Samsung
  • 8. JerryScript ● An ultra lightweight JavaScript engine (<64KB RAM, <200 KB ROM, 160KB binary size compiled for ARM Thumb-2) ● Originally developed from scratch by Samsung ● Transferred to JS Foundation in 2016 (https://js.foundation/) ● Self-contained and extremely portable ● Mature C API, easy to embed in applications
  • 9. JerryScript ● Optimization and performance have been top priorities ● Adding new features: – Jerry-debugger – ES6 related features – More hardware and OS supports ● Fast growing community
  • 10. ESP8266 ARM MBED STM32F4 discovery Board with Nuttx, RIOT OpenWrt Particle firmware on Photon board TizenRT on ARTIK 05x Hardware and OS Supports (JerryScript Github) Zephyr OS on Arduino 101 Raspberry Pi 2
  • 12. 2b. IoT platforms based on JerryScript
  • 13. IoT JavaScript Platforms based on JerryScript ● IoT.js by Samsung a. Lightweight version of node.js for constrained devices b. Hardware and OS supports are well inline with JerryScript. ● Zephyr.js by Intel a. JavaScript* Runtime for Zephyr OS b. Node.js* like APIs
  • 14. 3. JavaScript on Smart Gateway
  • 15. Things Gateway By Mozilla [4] Project Things (Diagram credit to Ben Francis)
  • 16. Things Gateway - Security ● HTTPS via mozilla-iot.org tunnelling service a. Allow setting up a secure subdomains with LetsEncrypt TLS certificates b. TCP tunnel uses PageKite from Mozilla cloud server to Gateway ● OAuth to authorise third party apps & services ● JSON Web Tokens (JWT) used for authentication
  • 17. 4. Put it Together - A Simple Demo
  • 18. Turn on your light by clapping hands
  • 22. WebThings API ● Thing: standalone HTTP server (+Websockets) ○ REST Endpoints (for gateway’s interaction): ■ Things / Properties / Values ■ Plus Actions & Events ○ Models are described using schemas (JSON) ● Several Technologies: ○ JavaScript: using Node.js or IoT.js ○ Native (C++), Python (& uPy), RUST…
  • 23. WebThings-IoT.js ● Fork of webthing-node for IoT.js runtime ○ Port to older ECMAScript 5.1 ○ Backward compatible for Node.JS ● Support: ADC, GPIO (+ some NPMs) ● Some features not yet implemented: ○ Websockets for real time (events & actions) ○ mDNS for discovery ● https://www.npmjs.com/package/webthing-iotjs
  • 24. Implementing a Webthing server: var webthing = require('webthing-iotjs'); var thing = new webthing.Thing(‘SomeSensor’); var server = new webthing.WebThingServer (new webthing.SingleThing(thing), 8888); server.start(); $ curl http://localhost:8888 { "name":"SomeSensor", "href":"/", "@context":"https://iot.mozilla.org/schemas", "@type":[null], "properties":{}, "links":[{"rel":"properties","href":"/properties"}]}
  • 25. Color as webthing property: function ColorProperty(thing) { webthing.Property.call(this, thing, 'Color', new webthing.Value(‘#000000’), { '@type': 'ColorProperty', type: 'string', readOnly: true }); } //… var thing = new webthing.Thing(‘ColorSensor’, [‘ColorControl’]); thing.addProperty(new ColorProperty(thing)); //… server.start(); $ curl http://localhost:8888 { ... "properties":{"Color": ... "links":[ {"rel":"property", "href":"/properties/Color" …
  • 26. Sensor updating webthing var ColorSensor = require('color-sensor-js/example’); // H.A.L. function ColorProperty(thing) { var self = this; Webthing.Property.call(..., 'Color', new webthing.Value... this.sensor = new ColorSensor(); this.sensor.onreading = function() { self.value.notifyOfExternalUpdate(self.sensor.color); }; this.sensor.start(); } // More hints: https://github.com/rzr/webthing-iotjs/wiki/Sensor $ curl http://localhost:8888/properties/Color {"Color":”#af0695”}
  • 27. 6. There are more you can do...
  • 29. Extra demos ● Tutorial & Demo recipes: ○ https://github.com/rzr/webthing-iotjs/wiki ● Alternative browser using TAU framework ○ For Tizen or as Progressive Web App: ■ supported by SamsungInternet (Android) ● From IoT to Social Web: ○ using mastodon-lite, IoT.js/Node.js module ● MCU: TizenRT and hints (STM, ESP, Arduino)
  • 32. Bridge Web to any framework ? https://youtu.be/k4C9FmsXV30#webthing-iotivity-cdl2018-20181118rzr
  • 33. Websockets for real time feedback to WebApp https://youtu.be/xI6eweCZLe8/#web-iot-automotive-20180315rzr
  • 35. References: 1. “Introduction to IoT.js’,Tillman Scheller, OpenIoT & ELC 2016, San Diego, CA, Apr 2016.. 2. “Fitbit loves JerryScript: JavaScript Breaks into the Internet of Things”, Michelle Gienow, https://thenewstack.io/fitbit-%E2%9D%A4%EF%B8%8Fs-jerryscri pt-javascript-breaks-internet-things/ 3. “IoT.js and JerryScript: a JS platform for the embedded world”, Zoltan Herczeg, Hosung Ki, Node Summit 2017 4. “Building the Web of Things”, Ben Francis, https://hacks.mozilla.org/2017/06/building-the-web-of-things/