20150317 firefox os_studymtg_engver

34
B2G (OSS version of FirefoxOS) Embedded Board FirefoxOS Study Meeting 17/03/2015 (English version) Naoki Sekiguchi KDDI R&D Laboratories, Inc Mozilla Factory MozOpenHard Project

Upload: naoki-sekiguchi

Post on 17-Jul-2015

421 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: 20150317 firefox os_studymtg_engver

B2G (OSS version of FirefoxOS) Embedded Board@FirefoxOS Study Meeting 17/03/2015 (English

version)

Naoki Sekiguchi

KDDI R&D Laboratories, Inc

Mozilla Factory MozOpenHard Project

Page 2: 20150317 firefox os_studymtg_engver

Profile

• Naoki Sekiguchi

• KDDI R&D Laboratories, Inc

• Web Development?

Page 3: 20150317 firefox os_studymtg_engver

Agenda

• What is MozOpenHard?

• B2G(OSS version of FirefoxOS) EmbeddedBoard “CHIRIMEN”

• Development of CHIRIMEN

• MWC2015 short report

Page 4: 20150317 firefox os_studymtg_engver

What is MozOpenHard?

Page 5: 20150317 firefox os_studymtg_engver

Current WoT

By Satoru Takagi

Page 6: 20150317 firefox os_studymtg_engver

Our vision

By Satoru Takagi

Page 7: 20150317 firefox os_studymtg_engver

Pervasive Browsers!

By Satoru Takagi

Page 8: 20150317 firefox os_studymtg_engver

Web of Lanterns(Demos)

• Revolving Lantern~ A Web browser ~

– 360 Rendering

– Physical Interface

• NyoroNyoro Lantern~ duplicate and fork physical ~

– Real 3D Transformation

– Download the Motion

– CSS lighting

Page 9: 20150317 firefox os_studymtg_engver

Collaboration Project

Welfare x Web(w/ WATERDESIGN Co.,Ltd.)

Satellite x Web(w/ FABSAT project)

Page 10: 20150317 firefox os_studymtg_engver
Page 11: 20150317 firefox os_studymtg_engver

Spec (2015.03. now)

B2G(OSS版FirefoxOS)2.5Hardware:● Rockchip RK3066 (1.6Ghz)

● 1GB DDR3 DRAM

● 8GB Nand Flash

● HDMI Micro x 1

● Micro SD Slot x 1

● USB (Micro x 2, Full x 1)

● I/O 28pin

(incl. I2C, UART, GPIO, SPI, Sound in/out etc)

Page 12: 20150317 firefox os_studymtg_engver

Size

48mm

80mm

Page 13: 20150317 firefox os_studymtg_engver

Interface

micro USB (OTG)

micro HDMI

micro UWB(DEBUG)

For adb connectionAC Power

Full USB

For serial console

For WiFi adapterrecovery key

Low level I/Fs(GPIO, I2C, SPI, …)

Page 14: 20150317 firefox os_studymtg_engver

Derivation of “CHIRIMEN”

Web

Hardware

CHIRIMEN = Japanese fabric, crape

Weave “Web” and “Hardware (Physical world)”to create innovative “Thing”.

Reference:http://ja.wikipedia.org/wiki/%E3%81%A1%E3%82%8A%E3%82%81%E3%82%93

Page 15: 20150317 firefox os_studymtg_engver

Development of CHIRIMEN

Page 16: 20150317 firefox os_studymtg_engver

Preparation

Currently(2015.3), only 5 CHIRIMENs have existed.

• Marsboard RK3066– It is build from the same soc.

– A same firmwarea image can be installed.

– http://www.marsboard.com/

Alternative board

Page 17: 20150317 firefox os_studymtg_engver

Install B2G

Procedure• Build B2G image• Create an update.img• Install the image

• tools– https://github.com/MozOpenHard/CHIRIMEN-tools

• Detail procedure is available– https://github.com/MozOpenHard/CHIRIMEN-

tools/blob/master/doc/installFirefoxOS.pdf

Page 18: 20150317 firefox os_studymtg_engver

Build B2G image

• Install all necessary packages for building B2G

• Copy the B2G repository ( for Matchstick)

• Copy the MozOpenHard repository

• Build B2G

$ git clone https://github.com/flingone/B2G-FlingOne.git $ cd B2G-FlingOne $ ./config.sh –j 4 rk30sdk

$ cd.repo$ git clone https://github.com/MozOpenHard/local_manifests.git $ cd .. $ repo sync –d –j 4

$ ./build.sh –j 4 $ ./flash.sh

rockdev/Image/にboot.img, kernel.img, recovery.img, system.img are generated in rockdev/Image/

Page 19: 20150317 firefox os_studymtg_engver

Create an update.img

• Copy tools

• Put in the boot.img, kernel.img, recovery.img and system.img according to the package-file.

• Execute mkupdate.sh -> update.img will be created

$ git clone [email protected]:MozOpenHard/CHIRIMEN.git

$ cd B2G-FlingOne/rockdev/Image$ cp boot.img kernel.img recovery.img system.img CHIRIMEN/rockdev-rk3066/Image/

$ cd CHIRIMEN/rockdev-rk3066/$ ./mkupdate.sh

Page 20: 20150317 firefox os_studymtg_engver

Install the image(ubuntu)• Set the PATH to Linux_Upgrade_Tool_v1.2.1

• Connect the CHIRIMEN in loader mode.– Turn on the power with pushing recovery key.

– # In case of Marsboard, Vol+ is recovery key.

• Install the image.

# Wait until automatically rebooting B2G

# If your board failed to reboot, you should try ti install two or three times

iteratively.

$ cd CHIRIMEN$ PATH=${PATH}:`pwd`/Linux_Upgrade_Tool_v1.2.1

$ upgrade_tool uf update.img

Page 21: 20150317 firefox os_studymtg_engver

Control GPIO by Web App

node(http server)

gecko

gonk

gaia(Web app)

WebGPIOAPI

Control GPIO via Gecko API (Future Path)

Control GPIO via node.js (Current Path)

Page 22: 20150317 firefox os_studymtg_engver

Control GPIO by sysfs

• Check the number of GPIO pins.– In case of CHIRIMEN, a LED on the board can be controlled from

GPIO6_B3(gpio363).– 6*32 + 160 + 8+3 = 363– Reference: http://www.hotmcu.com/wiki/Use_GPIO_in_marsboard_RK3066

• Control GPIO by sysfs

# echo 363 > /sys/class/gpio/export# echo “out” > /sys/class/gpio/gpio363/direction# echo 1 > /sys/class/gpio/gpio363/value

$ adb shell

Login to the CHIRIMEN

ledon.sh

Page 23: 20150317 firefox os_studymtg_engver

Install node.js• Push node.js binaries to CHIRIMEN.

– Node.js binaries

• https://www.facebook.com/groups/305208196333685/353904911464013/

• Execute a script for controlling GPIO by node.js.– # Make a symbolic link from /bin to /system/bin so that shell script can

be executed by node.js

$ adb root$ adb remount$ adb push node /system/bin/node

$ adb shell# mount –o remount, rm /# ln –s /system/bin /bin

Page 24: 20150317 firefox os_studymtg_engver

Sample Codevar http = require('http'),

url = require("url");exec = require('child_process').exec;

http.createServer(function (req, res) { var path = url.parse(req.url).pathname;if(path.charAt(0) == "/"){if(path.split("/")[1] == "ledon"){console.log("ledon");ledOn();

}}

}).listen(8000);console.log('Server running at port 8000');

function ledOn(){var child = exec("/etc/www/nodeGpio/ledon.sh", function(err,

stdout, stderr) {if (!err) {console.log("success");

}else{}

});}

server.js

Page 25: 20150317 firefox os_studymtg_engver

Execute Server Program• Push server.js and ledon.sh to the board

• Change the permission of the shell script, and then execute the server program.

• Send a request to the server.

→ A LED on the board will turn on.

$ adb push server.js /etc/www/nodeGpio$ adb push ledon.sh /etc/www/nodeGpio

$ adb shell# cd /etc/www/nodeGpio# chmod 755 ledon.sh# node server.js

# busybox wget http://127.0.0.1:8000/ledon

Page 26: 20150317 firefox os_studymtg_engver

Architecture of Lantern Demo

node(http server)

gecko

gonk

gaia(Web app)

Arduino

Serial communication

Browser

Other terminal

HTTP

GPIO、I2C

Page 27: 20150317 firefox os_studymtg_engver

MWC2015

Page 28: 20150317 firefox os_studymtg_engver

Working at Barcelona (In MOB/Fabcafe)

Page 29: 20150317 firefox os_studymtg_engver

Firefox Banner fill the aisel

Page 30: 20150317 firefox os_studymtg_engver

Huge fox in the Mozilla booth

Page 31: 20150317 firefox os_studymtg_engver

Fox den (session space)

Firefox Logo

Our Lantern Device

Page 32: 20150317 firefox os_studymtg_engver

Agenda

• What is MozOpenHard?

• B2G(OSS version of FirefoxOS) EmbeddedBoard “CHIRIMEN”

• Development of CHIRIMEN

• MWC2015 short report

Page 33: 20150317 firefox os_studymtg_engver

Future plan

• Maker Faire @ all over the world!

– Tokyo, NY,…

Page 34: 20150317 firefox os_studymtg_engver

Project Information• MozOpenHard

– http://mozopenhard.mozillafactory.org/

• Facebook

– https://www.facebook.com/groups/305208196333685/?pnref=lhc

• CHIRIMEN Technical Information

– http://mozopenhard.mozillafactory.org/techinfo#hardspec