SlideShare a Scribd company logo
Samsung Open Source Group
1
https://social.samsunginter.net/@rzr
WebThings in VR
…towards ”DigitalTwins”
#GrafikLabor, Rennes, France <2019-05-12>
https://afgral.org/grafiklabor-2019
Philippe Coval
Samsung Open Source Group / SRUK
pcoval@samsung.com
Samsung Open Source Group
2
https://social.samsunginter.net/@rzr
$ who is Philippe Coval
●
Software engineer for Samsung OSG
– Belongs to SRUK team, based in Rennes, France
– Interest: Web of Things with “Privacy by Design”
●
Some past 3D experiences (OpenGL, VRML, ArtoolKit+, etc)
●
After FOSDEM 2019, I was inspired to blend IoT and XR
●
Join the fediverse: https://social.samsunginter.net/@rzr
Samsung Open Source Group
3
https://social.samsunginter.net/@rzr
Immersive Web
Samsung Open Source Group
4
https://social.samsunginter.net/@rzr
Immersive Web
●
A successful evolution: 3D, VR, AR, XR
– HTML5, WebGL, Three.js, WebVR, OpenVR, OpenXR and WebXR !
●
Several FLOSS frameworks:
– Three.js: High-level library on top on WebGL with WebVR support (for devices)
– A-Frame: Originally from Mozilla, HTML for VR (built on Three.js)
– Babylon.js: from MS and more ...
●
Support: most desktop Web Browsers and VR browsers (for headsets)
– I use GearVR2017 (with controller)
●
Runs SamungInternet for VR (chromium based)
Samsung Open Source Group
5
https://social.samsunginter.net/@rzr
A-Frame’s static scene in DOM
<script src="https://aframe.io/releases/0.9.0/aframe.min.js">
</script>
<a-scene>
<a-box
color='blue' rotation="0 42 0">
</a-box>
<a-camera position="1 1 3">
</a-camera>
</a-scene>
Samsung Open Source Group
6
https://social.samsunginter.net/@rzr
A-Frame’s static scene in DOM
<script src="https://aframe.io/releases/0.9.0/aframe.min.js">
</script>
<a-scene>
<a-box id='foo’
color='blue' rotation="0 42 0">
</a-box>
<a-camera position="1 1 3">
</a-camera>
</a-scene>
<script>
var el = document.getElementById("foo");
el.setAttribute("color", "red"); // via DOM API
el.object3D.rotateY(43); // via Three.js API
</script>
Samsung Open Source Group
7
https://social.samsunginter.net/@rzr
A-Frame components
<script>
AFRAME.registerComponent('motor', {
schema: {
angle: { type: 'number', default: 0},
}, init: function() {
this.child = document.createElement('a-box');
this.child.setAttribute('color', ‘green’);
this.el.appendChild(this.child);
}, update: function(old) {
var angle = Number(this.data.angle);
this.child.object3D.rotation.set(0, Number(this.data.angle), 0);
}
});
</script>
<a-scene>
<a-entity motor="angle: 45"></a-entity>
<a-camera position="1 1 3"></a-camera>
</a-scene>
Samsung Open Source Group
8
https://social.samsunginter.net/@rzr
WebThings
Samsung Open Source Group
9
https://social.samsunginter.net/@rzr
Mozilla WebThing Project
●
An open platform for monitoring and controlling devices over the web.
– With “Privacy by Design” (data stay home)
●
Inspired by Web of Things works (Web Tech for IoT)
– RESTful API, Schema, Data model (JSON)
– Proposed to W3C
●
Implemented in Mozilla’s WebThings gateway
– To connect and connect webthings with “Privacy by Design” (data stay home)
– To be controlled from Web UI
Samsung Open Source Group
10
https://social.samsunginter.net/@rzr
Webthings are standalone HTTP servers
●
Exposing Mozilla Things API (REST, JSON)
– Self described using Things schema
●
by properties which contains values:
– Example: a MotorThing has an AngleProperty of value 42
●
Can be implemented for many runtimes (C, Python, Java, JS…):
– Physical objects
●
Internet access is not required (uses home network/LAN)
– Or services? can be deployed anywhere
●
on gateway as adapters: privacy matters!
●
on cloud as micro services?
– Eg: for development purpose try glitch.com
Samsung Open Source Group
11
https://social.samsunginter.net/@rzr
Angle/Motor example simulator
●
curl https://rzr-webthing-example.glitch.me/
{"name":"Angle" …
"properties":{"angle":{"title":"Angle","type":"number"…
"links":[{"rel":"property","href":"/properties/angle"…
●
curl https://rzr-webthing-example.glitch.me/properties
{"angle":0}
●
curl -X PUT -d '{"angle": 42}' https://rzr-webthing-example.glitch.me/properties/angle
{"angle": 42}
Samsung Open Source Group
12
https://social.samsunginter.net/@rzr
●
var webthing = require('webthing-iotjs');
●
function AngleProperty(thing){
webthing.Property.call(this, thing, 'angle',
new webthing.Value(0), { type: 'number' });
}
●
var thing = new webthing.Thing('Motor');
thing.addProperty(new AngleProperty(thing));
●
var server = new webthing.WebThingServer(new webthing.SingleThing(thing),
8888);
●
server.start();
Implementing a WebThing Actuator
Samsung Open Source Group
13
https://social.samsunginter.net/@rzr
Deploy to micro controllers using IoT.js
●
IoT.js an alternative runtime inspired by Node.js:
– Powered by JerryScript engine optimized for micro-controllers
– Supporting JS modules: mastodon-lite, generic-sensors-lite
●
WebThings can be built using webthing-iotjs module:
– Supporting IoT.js runtime:
●
OS: RT, NuttX, GNU/Linux …
●
MCU: ARTIK05X, STM32*
– Or use Node.js runtime:
●
for development/simulation (glitch)
– Note: webthing-iotjs is based on webthing-node
Samsung Open Source Group
14
https://social.samsunginter.net/@rzr
●
SG90: 9g Micro Servo
– Angle: [-90°, +90°]
– I/O:
●
Power: 4.8V, GND
●
PWM Signal
Servo motors and PWM
●
Pulse Width Modulation (PWM):
– Constant frequency: 1/.02
– Variable duty cycle:
●
[1 ms = -90°, 2 ms = +90°]
●
(angle + 90 / 180) + 1
SG90
Samsung Open Source Group
15
https://social.samsunginter.net/@rzr
●
Nucleo-F767ZI
– Nucleo-144 I/O
●
32.768 Khz
●
Ethernet
●
4 PWMs *
– STM32F7
●
ARM Cortex M7
●
RAM: 320KB
●
Supporting
– NuttX
●
* nuttx-7.29-115-gf06a2cabb5+
●
Origin of TizenRT
– TizenRT possible
– Arduino API
Micro Controller
PWM1.CH1_1 @PA8
(CN12: 12th
from top on right)
PWM2.CH1_1 @PA0
(CN10: 3th
from bottom on left)
PWM3.CH1_1 @PA6
(CN7: 6th
from top on right)
GND
PWM4.CH1_1 @PB6
(CN12: 9th
from top on left)
Samsung Open Source Group
16
https://social.samsunginter.net/@rzr
Generating a PWM using IoT.js
●
Example:
●
Note: dutyCycle [0, 1] adapt Row 1 Row 2 Row 3 Row 4
0
2
4
6
8
10
12
Column 1
Column 2
Column 3
var pwm = require('pwm');
var config =
{ pin: 0,
period: 20,
dutyCycle: 0.5}
var port = pwm.open(config,
function(err) {
port.setDutyCycle(0.42);
});
Samsung Open Source Group
17
https://social.samsunginter.net/@rzr
From webthings…
to “Digital Twins”
Samsung Open Source Group
18
https://social.samsunginter.net/@rzr
Updating XR view from webthing
●
function update(id, type, url) {
fetch(url)
.then( response => { return response.json(); } )
.then( json => {
for (var property of Object.keys(json)) {
document.getElementById(id).setAttribute(type, property, json[property]);
}})
.catch(function() { console.log('error: ') })
}
●
var url = 'https://rzr-webthing-example.glitch.me/'; // For simulator
// url = ‘http://webthinghost:8888’; // For device
update('foo’, 'motor', url + ‘/properties’);
●
curl -X PUT -d '{ "angle": 5}' $url/properties/angle
<a-scene>
<a-entity id="foo" motor="angle: 45"></a-entity>
<a-camera position="1 1 3"></a-camera>
</a-scene>
Samsung Open Source Group
19
https://social.samsunginter.net/@rzr
Digital Twins with WebThing-IoTjs (on MCU)
https://purl.org/rzr/digitaltwins-webthings-iotjs-20190512rzr
Samsung Open Source Group
20
https://social.samsunginter.net/@rzr
Live control in 3D using A-Frame on GearVR:
https://youtu.be/s3r8pQtzhAU#wotxr-20190320rzr
21
https://social.samsunginter.net/@rzrSamsung Open Source Group
Q&A ?
(or Extras?)
Ask now or online:
https://social.samsunginter.net/@rzr
Samsung Open Source Group
22
https://social.samsunginter.net/@rzr
Controlling real devices / consuming OpenData
https://purl.org/rzr/webthing-iotjs-opendata-20190202rzr
23
https://social.samsunginter.net/@rzrSamsung Open Source Group
Social Web of Things demo (#MozFest)
https://purl.org/rzr/webthing-iotjs-20181027rzr
24
https://social.samsunginter.net/@rzr
References & Resources
●
Open Source:
– https://github.com/rzr/webthing-iotjs
– https://github.com/SamsungInternet/color-sensor-js
– https://github.com/samsunginternet/webthings-webapp
– https://github.com/pando-project/iotjs
– http://opensource.samsung.com/
– https://github.com/aframevr/aframe
– https://github.com/mozilla-iot/webthing-node
●
Docs:
– https://github.com/rzr/webthing-iotjs/wiki
– https://github.com/rzr/webthing-iotjs/wiki/XR
– https://github.com/rzr/webthing-iotjs/wiki/Actuator
– https://github.com/rzr/webthing-iotjs/wiki/IotJs
– https://github.com/rzr/webthing-iotjs/wiki/MCU
– https://hacks.mozilla.org/2019/03/connecting-real-things-to-virtual-worlds-using-web/
●
Community:
– https://afgral.org/grafiklabor-2019
– https://social.samsunginter.net/@rzr
– https://hacks.mozilla.org/author/rzrusers-sf-net/
25
https://social.samsunginter.net/@rzrSamsung Open Source Group
Thanks !
Resources:
Flaticons CC,
PixBay.com
https://Social.SamsungInter.net/@rzr

More Related Content

Similar to digital-twins-webthings-iotjs-20190512rzr

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
 
tizen-rt-javascript-20181011
tizen-rt-javascript-20181011tizen-rt-javascript-20181011
tizen-rt-javascript-20181011
Phil www.rzr.online.fr
 
Connected TIZEN
Connected TIZENConnected TIZEN
Tizen Connected with IoTivity
Tizen Connected with IoTivityTizen Connected with IoTivity
Tizen Connected with IoTivity
Samsung Open Source Group
 
wotxr-20190320rzr
wotxr-20190320rzrwotxr-20190320rzr
wotxr-20190320rzr
Phil www.rzr.online.fr
 
IoT: From Arduino Microcontrollers to Tizen Products using IoTivity
IoT: From Arduino Microcontrollers to Tizen Products using IoTivityIoT: From Arduino Microcontrollers to Tizen Products using IoTivity
IoT: From Arduino Microcontrollers to Tizen Products using IoTivity
Samsung Open Source Group
 
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
 
IoTivity: From Devices to the Cloud
IoTivity: From Devices to the CloudIoTivity: From Devices to the Cloud
IoTivity: From Devices to the Cloud
Samsung Open Source Group
 
IoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT InteroperabilityIoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT Interoperability
Samsung Open Source Group
 
Gluing the IoT world with Java and LoRaWAN
Gluing the IoT world with Java and LoRaWANGluing the IoT world with Java and LoRaWAN
Gluing the IoT world with Java and LoRaWAN
Pance Cavkovski
 
Monkey Server
Monkey ServerMonkey Server
Monkey Server
Eduardo Silva Pereira
 
LoRaWAN Overview for Retail
LoRaWAN Overview for RetailLoRaWAN Overview for Retail
LoRaWAN Overview for Retail
Alex Sneed Miller
 
Cc internet of things @ Thomas More
Cc internet of things @ Thomas MoreCc internet of things @ Thomas More
Cc internet of things @ Thomas More
JWORKS powered by Ordina
 
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
Samsung Open Source Group
 
IoT with Ruby/mruby - RubyWorld Conference 2015
IoT with Ruby/mruby - RubyWorld Conference 2015IoT with Ruby/mruby - RubyWorld Conference 2015
IoT with Ruby/mruby - RubyWorld Conference 2015
哲也 廣田
 
Netflix Open Source: Building a Distributed and Automated Open Source Program
Netflix Open Source:  Building a Distributed and Automated Open Source ProgramNetflix Open Source:  Building a Distributed and Automated Open Source Program
Netflix Open Source: Building a Distributed and Automated Open Source Program
aspyker
 
Building a Distributed & Automated Open Source Program at Netflix
Building a Distributed & Automated Open Source Program at NetflixBuilding a Distributed & Automated Open Source Program at Netflix
Building a Distributed & Automated Open Source Program at Netflix
All Things Open
 
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
Samsung Open Source Group
 
IoT-javascript-2019-fosdem
IoT-javascript-2019-fosdemIoT-javascript-2019-fosdem
IoT-javascript-2019-fosdem
Phil www.rzr.online.fr
 

Similar to digital-twins-webthings-iotjs-20190512rzr (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)
 
tizen-rt-javascript-20181011
tizen-rt-javascript-20181011tizen-rt-javascript-20181011
tizen-rt-javascript-20181011
 
Connected TIZEN
Connected TIZENConnected TIZEN
Connected TIZEN
 
Tizen Connected with IoTivity
Tizen Connected with IoTivityTizen Connected with IoTivity
Tizen Connected with IoTivity
 
wotxr-20190320rzr
wotxr-20190320rzrwotxr-20190320rzr
wotxr-20190320rzr
 
IoT: From Arduino Microcontrollers to Tizen Products using IoTivity
IoT: From Arduino Microcontrollers to Tizen Products using IoTivityIoT: From Arduino Microcontrollers to Tizen Products using IoTivity
IoT: From Arduino Microcontrollers to Tizen Products using IoTivity
 
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...
 
IoTivity: From Devices to the Cloud
IoTivity: From Devices to the CloudIoTivity: From Devices to the Cloud
IoTivity: From Devices to the Cloud
 
IoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT InteroperabilityIoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT Interoperability
 
Gluing the IoT world with Java and LoRaWAN
Gluing the IoT world with Java and LoRaWANGluing the IoT world with Java and LoRaWAN
Gluing the IoT world with Java and LoRaWAN
 
Monkey Server
Monkey ServerMonkey Server
Monkey Server
 
LoRaWAN Overview for Retail
LoRaWAN Overview for RetailLoRaWAN Overview for Retail
LoRaWAN Overview for Retail
 
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
 
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
 
IoT with Ruby/mruby - RubyWorld Conference 2015
IoT with Ruby/mruby - RubyWorld Conference 2015IoT with Ruby/mruby - RubyWorld Conference 2015
IoT with Ruby/mruby - RubyWorld Conference 2015
 
Netflix Open Source: Building a Distributed and Automated Open Source Program
Netflix Open Source:  Building a Distributed and Automated Open Source ProgramNetflix Open Source:  Building a Distributed and Automated Open Source Program
Netflix Open Source: Building a Distributed and Automated Open Source Program
 
Building a Distributed & Automated Open Source Program at Netflix
Building a Distributed & Automated Open Source Program at NetflixBuilding a Distributed & Automated Open Source Program at Netflix
Building a Distributed & Automated Open Source Program at Netflix
 
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
 
IoT-javascript-2019-fosdem
IoT-javascript-2019-fosdemIoT-javascript-2019-fosdem
IoT-javascript-2019-fosdem
 

More from Phil www.rzr.online.fr

Iot privacy-soscon-2019
Iot privacy-soscon-2019Iot privacy-soscon-2019
Iot privacy-soscon-2019
Phil www.rzr.online.fr
 
up-down-stream-flows-20190411rzr
up-down-stream-flows-20190411rzrup-down-stream-flows-20190411rzr
up-down-stream-flows-20190411rzr
Phil www.rzr.online.fr
 
mozilla-things-fosdem-2019
mozilla-things-fosdem-2019mozilla-things-fosdem-2019
mozilla-things-fosdem-2019
Phil www.rzr.online.fr
 
osvehicle-connected-20160429
osvehicle-connected-20160429osvehicle-connected-20160429
osvehicle-connected-20160429
Phil www.rzr.online.fr
 
tdc2015-strategy-devel-20150916
tdc2015-strategy-devel-20150916tdc2015-strategy-devel-20150916
tdc2015-strategy-devel-20150916
Phil www.rzr.online.fr
 
tizen-maintain-20150413rzr
tizen-maintain-20150413rzrtizen-maintain-20150413rzr
tizen-maintain-20150413rzr
Phil www.rzr.online.fr
 
Iotivity atmel-20150328rzr
Iotivity atmel-20150328rzrIotivity atmel-20150328rzr
Iotivity atmel-20150328rzr
Phil www.rzr.online.fr
 
Tizen store-z1-20150228rzr
Tizen store-z1-20150228rzrTizen store-z1-20150228rzr
Tizen store-z1-20150228rzr
Phil 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 devices
Phil www.rzr.online.fr
 
tizen-oshw-tds14sh
tizen-oshw-tds14shtizen-oshw-tds14sh
tizen-oshw-tds14sh
Phil www.rzr.online.fr
 
Tizen platform-dev-tds14sh
Tizen platform-dev-tds14shTizen platform-dev-tds14sh
Tizen platform-dev-tds14sh
Phil www.rzr.online.fr
 
Tdc2014 tizen common_20140603
Tdc2014 tizen common_20140603Tdc2014 tizen common_20140603
Tdc2014 tizen common_20140603
Phil www.rzr.online.fr
 
tizen-upstream-coop-tdc2014-pcoval
tizen-upstream-coop-tdc2014-pcovaltizen-upstream-coop-tdc2014-pcoval
tizen-upstream-coop-tdc2014-pcoval
Phil www.rzr.online.fr
 
Tizen contrib-fosdem-20140201
Tizen contrib-fosdem-20140201Tizen contrib-fosdem-20140201
Tizen contrib-fosdem-20140201
Phil www.rzr.online.fr
 
Tizen architecture-solutionslinux-20130529
Tizen architecture-solutionslinux-20130529Tizen architecture-solutionslinux-20130529
Tizen architecture-solutionslinux-20130529Phil www.rzr.online.fr
 

More from Phil www.rzr.online.fr (17)

Iot privacy-soscon-2019
Iot privacy-soscon-2019Iot privacy-soscon-2019
Iot privacy-soscon-2019
 
up-down-stream-flows-20190411rzr
up-down-stream-flows-20190411rzrup-down-stream-flows-20190411rzr
up-down-stream-flows-20190411rzr
 
mozilla-things-fosdem-2019
mozilla-things-fosdem-2019mozilla-things-fosdem-2019
mozilla-things-fosdem-2019
 
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
 
tizen-upstream-coop-tdc2014-pcoval
tizen-upstream-coop-tdc2014-pcovaltizen-upstream-coop-tdc2014-pcoval
tizen-upstream-coop-tdc2014-pcoval
 
Tizen contrib-fosdem-20140201
Tizen contrib-fosdem-20140201Tizen contrib-fosdem-20140201
Tizen contrib-fosdem-20140201
 
Tizen sdk-solutionslinux-20130529
Tizen sdk-solutionslinux-20130529Tizen sdk-solutionslinux-20130529
Tizen sdk-solutionslinux-20130529
 
Tizen architecture-solutionslinux-20130529
Tizen architecture-solutionslinux-20130529Tizen architecture-solutionslinux-20130529
Tizen architecture-solutionslinux-20130529
 

Recently uploaded

Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 

Recently uploaded (20)

Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 

digital-twins-webthings-iotjs-20190512rzr

  • 1. Samsung Open Source Group 1 https://social.samsunginter.net/@rzr WebThings in VR …towards ”DigitalTwins” #GrafikLabor, Rennes, France <2019-05-12> https://afgral.org/grafiklabor-2019 Philippe Coval Samsung Open Source Group / SRUK pcoval@samsung.com
  • 2. Samsung Open Source Group 2 https://social.samsunginter.net/@rzr $ who is Philippe Coval ● Software engineer for Samsung OSG – Belongs to SRUK team, based in Rennes, France – Interest: Web of Things with “Privacy by Design” ● Some past 3D experiences (OpenGL, VRML, ArtoolKit+, etc) ● After FOSDEM 2019, I was inspired to blend IoT and XR ● Join the fediverse: https://social.samsunginter.net/@rzr
  • 3. Samsung Open Source Group 3 https://social.samsunginter.net/@rzr Immersive Web
  • 4. Samsung Open Source Group 4 https://social.samsunginter.net/@rzr Immersive Web ● A successful evolution: 3D, VR, AR, XR – HTML5, WebGL, Three.js, WebVR, OpenVR, OpenXR and WebXR ! ● Several FLOSS frameworks: – Three.js: High-level library on top on WebGL with WebVR support (for devices) – A-Frame: Originally from Mozilla, HTML for VR (built on Three.js) – Babylon.js: from MS and more ... ● Support: most desktop Web Browsers and VR browsers (for headsets) – I use GearVR2017 (with controller) ● Runs SamungInternet for VR (chromium based)
  • 5. Samsung Open Source Group 5 https://social.samsunginter.net/@rzr A-Frame’s static scene in DOM <script src="https://aframe.io/releases/0.9.0/aframe.min.js"> </script> <a-scene> <a-box color='blue' rotation="0 42 0"> </a-box> <a-camera position="1 1 3"> </a-camera> </a-scene>
  • 6. Samsung Open Source Group 6 https://social.samsunginter.net/@rzr A-Frame’s static scene in DOM <script src="https://aframe.io/releases/0.9.0/aframe.min.js"> </script> <a-scene> <a-box id='foo’ color='blue' rotation="0 42 0"> </a-box> <a-camera position="1 1 3"> </a-camera> </a-scene> <script> var el = document.getElementById("foo"); el.setAttribute("color", "red"); // via DOM API el.object3D.rotateY(43); // via Three.js API </script>
  • 7. Samsung Open Source Group 7 https://social.samsunginter.net/@rzr A-Frame components <script> AFRAME.registerComponent('motor', { schema: { angle: { type: 'number', default: 0}, }, init: function() { this.child = document.createElement('a-box'); this.child.setAttribute('color', ‘green’); this.el.appendChild(this.child); }, update: function(old) { var angle = Number(this.data.angle); this.child.object3D.rotation.set(0, Number(this.data.angle), 0); } }); </script> <a-scene> <a-entity motor="angle: 45"></a-entity> <a-camera position="1 1 3"></a-camera> </a-scene>
  • 8. Samsung Open Source Group 8 https://social.samsunginter.net/@rzr WebThings
  • 9. Samsung Open Source Group 9 https://social.samsunginter.net/@rzr Mozilla WebThing Project ● An open platform for monitoring and controlling devices over the web. – With “Privacy by Design” (data stay home) ● Inspired by Web of Things works (Web Tech for IoT) – RESTful API, Schema, Data model (JSON) – Proposed to W3C ● Implemented in Mozilla’s WebThings gateway – To connect and connect webthings with “Privacy by Design” (data stay home) – To be controlled from Web UI
  • 10. Samsung Open Source Group 10 https://social.samsunginter.net/@rzr Webthings are standalone HTTP servers ● Exposing Mozilla Things API (REST, JSON) – Self described using Things schema ● by properties which contains values: – Example: a MotorThing has an AngleProperty of value 42 ● Can be implemented for many runtimes (C, Python, Java, JS…): – Physical objects ● Internet access is not required (uses home network/LAN) – Or services? can be deployed anywhere ● on gateway as adapters: privacy matters! ● on cloud as micro services? – Eg: for development purpose try glitch.com
  • 11. Samsung Open Source Group 11 https://social.samsunginter.net/@rzr Angle/Motor example simulator ● curl https://rzr-webthing-example.glitch.me/ {"name":"Angle" … "properties":{"angle":{"title":"Angle","type":"number"… "links":[{"rel":"property","href":"/properties/angle"… ● curl https://rzr-webthing-example.glitch.me/properties {"angle":0} ● curl -X PUT -d '{"angle": 42}' https://rzr-webthing-example.glitch.me/properties/angle {"angle": 42}
  • 12. Samsung Open Source Group 12 https://social.samsunginter.net/@rzr ● var webthing = require('webthing-iotjs'); ● function AngleProperty(thing){ webthing.Property.call(this, thing, 'angle', new webthing.Value(0), { type: 'number' }); } ● var thing = new webthing.Thing('Motor'); thing.addProperty(new AngleProperty(thing)); ● var server = new webthing.WebThingServer(new webthing.SingleThing(thing), 8888); ● server.start(); Implementing a WebThing Actuator
  • 13. Samsung Open Source Group 13 https://social.samsunginter.net/@rzr Deploy to micro controllers using IoT.js ● IoT.js an alternative runtime inspired by Node.js: – Powered by JerryScript engine optimized for micro-controllers – Supporting JS modules: mastodon-lite, generic-sensors-lite ● WebThings can be built using webthing-iotjs module: – Supporting IoT.js runtime: ● OS: RT, NuttX, GNU/Linux … ● MCU: ARTIK05X, STM32* – Or use Node.js runtime: ● for development/simulation (glitch) – Note: webthing-iotjs is based on webthing-node
  • 14. Samsung Open Source Group 14 https://social.samsunginter.net/@rzr ● SG90: 9g Micro Servo – Angle: [-90°, +90°] – I/O: ● Power: 4.8V, GND ● PWM Signal Servo motors and PWM ● Pulse Width Modulation (PWM): – Constant frequency: 1/.02 – Variable duty cycle: ● [1 ms = -90°, 2 ms = +90°] ● (angle + 90 / 180) + 1 SG90
  • 15. Samsung Open Source Group 15 https://social.samsunginter.net/@rzr ● Nucleo-F767ZI – Nucleo-144 I/O ● 32.768 Khz ● Ethernet ● 4 PWMs * – STM32F7 ● ARM Cortex M7 ● RAM: 320KB ● Supporting – NuttX ● * nuttx-7.29-115-gf06a2cabb5+ ● Origin of TizenRT – TizenRT possible – Arduino API Micro Controller PWM1.CH1_1 @PA8 (CN12: 12th from top on right) PWM2.CH1_1 @PA0 (CN10: 3th from bottom on left) PWM3.CH1_1 @PA6 (CN7: 6th from top on right) GND PWM4.CH1_1 @PB6 (CN12: 9th from top on left)
  • 16. Samsung Open Source Group 16 https://social.samsunginter.net/@rzr Generating a PWM using IoT.js ● Example: ● Note: dutyCycle [0, 1] adapt Row 1 Row 2 Row 3 Row 4 0 2 4 6 8 10 12 Column 1 Column 2 Column 3 var pwm = require('pwm'); var config = { pin: 0, period: 20, dutyCycle: 0.5} var port = pwm.open(config, function(err) { port.setDutyCycle(0.42); });
  • 17. Samsung Open Source Group 17 https://social.samsunginter.net/@rzr From webthings… to “Digital Twins”
  • 18. Samsung Open Source Group 18 https://social.samsunginter.net/@rzr Updating XR view from webthing ● function update(id, type, url) { fetch(url) .then( response => { return response.json(); } ) .then( json => { for (var property of Object.keys(json)) { document.getElementById(id).setAttribute(type, property, json[property]); }}) .catch(function() { console.log('error: ') }) } ● var url = 'https://rzr-webthing-example.glitch.me/'; // For simulator // url = ‘http://webthinghost:8888’; // For device update('foo’, 'motor', url + ‘/properties’); ● curl -X PUT -d '{ "angle": 5}' $url/properties/angle <a-scene> <a-entity id="foo" motor="angle: 45"></a-entity> <a-camera position="1 1 3"></a-camera> </a-scene>
  • 19. Samsung Open Source Group 19 https://social.samsunginter.net/@rzr Digital Twins with WebThing-IoTjs (on MCU) https://purl.org/rzr/digitaltwins-webthings-iotjs-20190512rzr
  • 20. Samsung Open Source Group 20 https://social.samsunginter.net/@rzr Live control in 3D using A-Frame on GearVR: https://youtu.be/s3r8pQtzhAU#wotxr-20190320rzr
  • 21. 21 https://social.samsunginter.net/@rzrSamsung Open Source Group Q&A ? (or Extras?) Ask now or online: https://social.samsunginter.net/@rzr
  • 22. Samsung Open Source Group 22 https://social.samsunginter.net/@rzr Controlling real devices / consuming OpenData https://purl.org/rzr/webthing-iotjs-opendata-20190202rzr
  • 23. 23 https://social.samsunginter.net/@rzrSamsung Open Source Group Social Web of Things demo (#MozFest) https://purl.org/rzr/webthing-iotjs-20181027rzr
  • 24. 24 https://social.samsunginter.net/@rzr References & Resources ● Open Source: – https://github.com/rzr/webthing-iotjs – https://github.com/SamsungInternet/color-sensor-js – https://github.com/samsunginternet/webthings-webapp – https://github.com/pando-project/iotjs – http://opensource.samsung.com/ – https://github.com/aframevr/aframe – https://github.com/mozilla-iot/webthing-node ● Docs: – https://github.com/rzr/webthing-iotjs/wiki – https://github.com/rzr/webthing-iotjs/wiki/XR – https://github.com/rzr/webthing-iotjs/wiki/Actuator – https://github.com/rzr/webthing-iotjs/wiki/IotJs – https://github.com/rzr/webthing-iotjs/wiki/MCU – https://hacks.mozilla.org/2019/03/connecting-real-things-to-virtual-worlds-using-web/ ● Community: – https://afgral.org/grafiklabor-2019 – https://social.samsunginter.net/@rzr – https://hacks.mozilla.org/author/rzrusers-sf-net/
  • 25. 25 https://social.samsunginter.net/@rzrSamsung Open Source Group Thanks ! Resources: Flaticons CC, PixBay.com https://Social.SamsungInter.net/@rzr