6. 6/31
IoT (Internet of Things)
Connect various things to the Internet
By computers on cloud
Summarize informations
Control devices
Cloud
Things
Traffic accident
occurredControl signals,
digital signage
7. 7/31
WoT (Web of Things)
Web = HTTP ?
IoT = IP、Web = HTTP no diferent→
Application
HTTP
IP
Things
Application
Things
IP
IoT WoT
8. 8/31
WoT (Web of Things)
Web = Browser?
We can write all with JavaScript
Browser
HTTP
IP
Things
WoT
ApplicationApplication
IP
Things
IoT
C
C/Java
JavaScript
9. 9/31
Browser as a platform
“Web = Browser” is more acceptable
Accessing to things and connection to the network
could be done via Browser
JavaScript can control things and HTTP protocol
At the standard IoT, almost things will be controlled
with native languages (like C)
⇒Browser as a platform
WoT means this
11. 11/31
Should all the things run
browser ?
Smart Endpoint vs Dumb Endpoint
This question causes debates on IoT
Should the “Things” on IoT be intelligent ?
Don' be involved in the debates. Make an layer
between them. Fog computing⇒
Smart Endpoint Dumb Endpoint
Unintelligent
- Pass the raw data to upper layer
- Do ordered actions
Intelligent
- Pass the summarized data
to upper layer
- Acts autonomously
12. 12/31
What is Fog Computing
Create a Fog Layer between Cloud and Things
Cloud
Things
Cloud
Things
Fog
Data reception server, Database,
Statistical Analytics Server, etc...
temperature, accelerometer,
Geiger-Müller counter, other sensors.
Cloud
Computing
Fog
Computing
Summarize data,
Transform format, etc...
13. 13/31
Example of Fog Layer
Cloud
Things
Fog
Urban planning by AI
Fog
Things
Notify to neighbors
Accidents statistics
Traffic accident
occurredControl signals,
digital signage
15. 15/31
Fog with Firefox OS
Firefox OS
Fog with Firefox OS
Firefox OS has more hardware access Web APIs than
Chrome、Safari、IE
16. 16/31
What is required for Fog ?
Hardware access via Firefox OS
Firefox OS is built with Web Technology
There is no mechanism like the Android NDK
Can not use native language
Hardware control with JavaScript is required
17. 17/31
The way to control Things via
Web (1)
Via Network
HTTP, nodejs, WebSocket, WebRTC
This way is already used
sensorFirefox OS
network
18. 18/31
The way to control Things via
Web (2)
Control locally
Without network connection
There is not any path for this
⇒ Let them make API
⇒ Create new Web APIs !
sensor
Direct connectionFirefox OS
20. 20/31
What is Web API ?
“Web API” has two means
Services on the Web
Twitter API、Youtube API、...
JavaScript API on the Browser (I expect this today)
navigator.getUserMedia, navigator.geolocation, …
21. 21/31
Hardware access Web API
What will we create ?
Create navigator.hardwareaccessxxx API like
navigator.getusermedia
How to create new Web API ?
Modify Firefox
22. 22/31
Modify Firefox
On Firefox, Gecko implements Web APIs
So will add some new code to Gecko to create some new
Web APIs
gecko/dom/geolocation etc...
Gecko
Web Application
Web API
23. 23/31
Required Web API
Popular hardware for IoT
input: sensor
output: motor
Such hardwares has GPIO or I2C interface
Create Web API for GPIO and I2C
24. 24/31
What is GPIO ?
What is GPIO ?
General Purpose Input/Output
Pins connects computers and peripherals
Configure on/of or read on/of of specific pin
Control on/of of LEDs or motors
25. 25/31
What is I2C ?
What is I2C ?
Bus for serial communication
Enables you to read/write a value
GPIO deals only on/of
Almost sensors and motors has this interface
26. 26/31
Web GPIO API
Web GPIO API (part)
navigator.requestGPIOAccess()
Get a GPIO access object
gpio.ports.get(GPIO pin number)
Get a GPIO port object
port.write(value)
Write to a port
port.read()
Read from a port
27. 27/31
Web I2C API
Web I2C API (in progress)
navigator.requestI2CAccess(device_name,address)
Get an I2C device access object
i2c_device.write/read(register address, value);
Write to a register, read from a register
example
Drive a motor with DRV8830
var i2c_device =
navigator.requestI2CAccess("/dev/i2c-1", 0x64);
i2c_device.write(0x00, 0xfd);
29. 29/31
Standardization
WoT is not only Gecko
WoT with V8 or Trident
Standard way is required
Web GPIO is discussed on W3C Browsers and
Robotics Community Group
http://www.w3.org/community/browserobo/
30. 30/31
Example of discussion
Promise vs Return value
Promise
merit: async enabled
demerit: deep nest
Return value
merit: shallow nest
demerit: async disabled