next generation web for connected thingsnode.js vs. iot.js iot.js os node.js js • both node.js and...

Post on 13-Jul-2020

21 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Next generation web for connected things

IoT.js

Samsung Electronics| Software Center | Piotr Marcinkiewicz

2017

Introduction

Architecture

Node.js vs. IoT.js

APIs

You are invited

Community

Q&A

01

02

03

04

05

06

07

Agenda

Introduction

RAM

200kB MCU

200MHz

JavaScript

IoT.js • Node.js and IoT.js provide

same experience

• RAM and FLASH

requirement is ~200kB

• MCU (Micro controller unit)

• No MMU nor GPOS

• MCU is cheap and ultra low

power

Introduction

IoT.js • IoT.js can be compiled for

Linux PC

• It works also for ARM Linux

devices like Raspberry Pi 2/3

• The major target is MCU

• STM32F4 is supported with

Nuttx OS

• Artik053 is supported with

TizenRT OS

Introduction

Artik 053 • 32-bit ARM® Cortex® R4 @ 320MHz

for applications

• 29 GPIO, 2 SPI, 4 UART, 4 ADC, JTAG,

2 I2C

• 5-12 VDC input

• 1280 kB RAM, 8MB flash

• TizenRT RTOS

https://github.com/Samsung/TizenRT

Architecture

JerryScript

API

JavaScript

service

IoT.js • JavaScript service can access

hardware and network using API

• It doesn't have graphical user

interface

• JavaScript is executed in

JerryScript virtual machine at

device

• JS API is implemented using OS

API (SYSFS, Peripheral API)

Architecture

JavaScript service

System API JerryScript

IoT.js

libtuv

Operating System

Node.js vs. IoT.js

IoT.js

OS

Node.js

JS • Both Node.js and IoT.js provide

runtime environment for

JavaScript

• GPOS – general purpose

operating system,

• RTOS – real time operating

system,

• V8 – JavaScript engine from

Chromium

Node.js vs. IoT.js

Basic

API

Peripheral

API

Addons

API

IoT.js Node.js

V8

ECMA7

Jerry

Script

ECMA5.1

libuv libtuv

RTOS

MCU

API

Architecture

Platform

Hardware

JS engine, system I/O

GPOS

CPU

Node.js vs. IoT.js

IoT.js Node.js

• Easy to extend

• More features

• Better CPU

utilization

• Easy to port

• More OSes

• Both CPU and

MCU support

JerryScript

JerryScript • JerryScript is

lightweight JavaScript

engine

• It is intended for very

constrained devices.

• It supports snapshots.

RAM

64kB ROM

200kB

APIs

JS

API

C

Module • Modules are implemented using

C and JavaScript

• C language provides direct

binding from OS API to

JavaScript

• JavaScript defines objects and

validates API calls from

application

APIs

src

js modules

file.js

file.c

file.c

platform

file.js

file.c

file.c

file.c

file.c

Runtime C

implementation

Runtime JS

and modules JS

implementation

compiled into snapshot

Generic module C

implementation

Platform specific

module C

implementation

os_xxx

os_xxx

APIs

Basic API

Node.js style IoT.js style

System

Core

Internet

Extended API

Hardware

Communication

APIs

Basic API

Node.js style

System

Core

Internet DNS HTTP

Net HTTPS*

FS Process Stream

Module Events Console Timer

Buffer

APIs

IoT.js style

Extended API

Hardware GPIO PWM

ADC

I2C SPI

BLE UART Communication

UDP

APIs

GPIO

Copyright ⓒ 2017 SAMSUNG ELECTRONICS. ALL RIGHTS RESERVED

You are invited

https://github.com/Samsung/iotjs

Compilation and CI

Install

Check

Precommit

Build

.travis.yml tools

root folder

Dependencies

jerryscript-project/jerryscript

Samsung/http-parser

Samsung/libtuv

Samsung/TizenRT

Nuttx (Bitbucket)

jerry

http-parser

libtuv

git

submodule

tizenrt

nuttx

precommit

Build process

precommit.py

build.py

http-parser

libtuv

jerryscript

IoT.js

configure

environment deploy test

Tools - install and check

• install: apt-get-install-*

• arm (RaspberryPi)

• nuttx

• tizenrt

• tizen

• travis

• check:

• license

• signed

• test

• tidy

Tools - precommit tests

precommit.py --test flag passes 3 flags to build.py

arch os board

host-linux (tests are executed)

default (x86*) default (linux) default (undefined)

rpi2 arm default

rpi2

artik10 arm tizen artik10

artik053 arm tizenrt artik05x

nuttx arm nuttx stm32f4dis

Folders

IoT.js folders:

• docs – JS API description, build guides

• src – source code of all major components

• tools – build and configuration Python

scripts

• test – JavaScript tests

• samples – JavaScript sample services (e.g.

blink a LED)

Folders

IoT.js folders:

• deps – dependencies compiled with IoT.js

• cmake – cmake configuration for IoT.js

and submodules

• config – configuration for Tizen, TizenRT,

Nuttx

• include – library header

Community

• 48 contributors

• 889 commits

• 266 forks

• 1420 stars

• IRC: freenode.net #iotjs

• Group: iotjs-dev@groups.io

Copyright ⓒ 2017 SAMSUNG ELECTRONICS. ALL RIGHTS RESERVED

Q&A

https://github.com/Samsung/iotjs

Copyright ⓒ 2017 SAMSUNG ELECTRONICS. ALL RIGHTS RESERVED

THANK YOU

https://github.com/Samsung/iotjs

top related