Upload
honma-masashi
View
1.188
Download
2
Tags:
Embed Size (px)
Citation preview
Firefox OS study group tokyo 9th
Firefox OS for Embedded System and Web APIs(English version)
2/31
Self Introduction
Twitter: @masap Embedded System Engineer(mainly Wi-Fi)
3/31
Table of contents
What is WoT ? Position of Firefox OS on WoT Add the Web APIs for Firefox OS Standardization of Web APIs
4/31
What is WoT ?
5/31
review
Today's thema is “Go for it WoT ”! Review on WoT
6/31
IoT (Internet of Things)
Connect various things to the Internet By computers on cloud
Summarize informations Control devices
Cloud
Things
Traffic accidentoccurredControl signals,
digital signage
7/31
WoT (Web of Things)
Web = HTTP ? IoT = IP、Web = HTTP no diferent→
Application
HTTP
IP
Things
Application
Things
IP
IoT WoT
8/31
WoT (Web of Things)
Web = Browser? We can write all with JavaScript
Browser
HTTP
IP
Things
WoT
ApplicationApplication
IP
Things
IoT
CC/Java
JavaScript
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
10/31
Position of Firefox OS on WoT
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/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.
CloudComputing
FogComputing
Summarize data,Transform format, etc...
13/31
Example of Fog Layer
Cloud
Things
Fog
Urban planning by AI
Fog
Things
Notify to neighborsAccidents statistics
Traffic accidentoccurredControl signals,
digital signage
14/31
Fog Computing Products
Cisco Cisco proposes Fog Computing Cisco has “Cisco Iox” Fog Development Platform It's too expensive for almost companies
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/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/31
The way to control Things via Web (1)
Via Network HTTP, nodejs, WebSocket, WebRTC This way is already used
sensorFirefox OS
network
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
19/31
Add the Web APIs for Firefox OS
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/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/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/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/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/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/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/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);
28/31
Standardization of Web APIs
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 Grouphttp://www.w3.org/community/browserobo/
30/31
Example of discussion
Promise vs Return value Promise
merit: async enabled demerit: deep nest
Return value merit: shallow nest demerit: async disabled
31/31
end