SlideShare uma empresa Scribd logo
1 de 25
Baixar para ler offline
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

Mais conteúdo relacionado

Semelhante a 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
 
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 IoTivitySamsung 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 for Automotive IoT Interoperability
IoTivity for Automotive IoT InteroperabilityIoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT InteroperabilitySamsung 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 LoRaWANPance Cavkovski
 
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
 
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哲也 廣田
 
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 NetflixAll Things Open
 
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 Programaspyker
 
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
 

Semelhante a 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
 
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
 
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
 
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
 

Mais de 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
 

Último

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 

Último (20)

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 

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