20150317 firefox os_studymtg_engver

Post on 17-Jul-2015

421 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

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

Profile

• Naoki Sekiguchi

• KDDI R&D Laboratories, Inc

• Web Development?

Agenda

• What is MozOpenHard?

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

• Development of CHIRIMEN

• MWC2015 short report

What is MozOpenHard?

Current WoT

By Satoru Takagi

Our vision

By Satoru Takagi

Pervasive Browsers!

By Satoru Takagi

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

Collaboration Project

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

Satellite x Web(w/ FABSAT project)

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)

Size

48mm

80mm

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, …)

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

Development of CHIRIMEN

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

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

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/

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 git@github.com: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

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

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)

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

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

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

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

Architecture of Lantern Demo

node(http server)

gecko

gonk

gaia(Web app)

Arduino

Serial communication

Browser

Other terminal

HTTP

GPIO、I2C

MWC2015

Working at Barcelona (In MOB/Fabcafe)

Firefox Banner fill the aisel

Huge fox in the Mozilla booth

Fox den (session space)

Firefox Logo

Our Lantern Device

Agenda

• What is MozOpenHard?

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

• Development of CHIRIMEN

• MWC2015 short report

Future plan

• Maker Faire @ all over the world!

– Tokyo, NY,…

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

top related