31
SDK in the Browser for Zephyr™ Sakari Poussa @spoussa Intel Zephyr is a trademark of the Linux Foundation. *Other names and brands may be claimed as the property of others.

SDK in the Browser for Zephyr™...1. Supported URLs 2. Tell URLs 3. Show USB Dialog 4. Get URL 5. Load Application 6. Connect DATA Development Flow Edit Run Copy Edit Compile Reboot

  • Upload
    others

  • View
    8

  • Download
    0

Embed Size (px)

Citation preview

Page 1: SDK in the Browser for Zephyr™...1. Supported URLs 2. Tell URLs 3. Show USB Dialog 4. Get URL 5. Load Application 6. Connect DATA Development Flow Edit Run Copy Edit Compile Reboot

SDK in the Browserfor Zephyr™

Sakari Poussa@spoussa

Intel

Zephyr is a trademark of the Linux Foundation. *Other names and brands may be claimed as the property of others.

Page 2: SDK in the Browser for Zephyr™...1. Supported URLs 2. Tell URLs 3. Show USB Dialog 4. Get URL 5. Load Application 6. Connect DATA Development Flow Edit Run Copy Edit Compile Reboot

AgendaProblem StatementSolutionDemoHow does it Work?JavaScript*

Web USBWeb Application

*Other names and brands may be claimed as the property of others.

Page 3: SDK in the Browser for Zephyr™...1. Supported URLs 2. Tell URLs 3. Show USB Dialog 4. Get URL 5. Load Application 6. Connect DATA Development Flow Edit Run Copy Edit Compile Reboot

Problem Statement

Page 4: SDK in the Browser for Zephyr™...1. Supported URLs 2. Tell URLs 3. Show USB Dialog 4. Get URL 5. Load Application 6. Connect DATA Development Flow Edit Run Copy Edit Compile Reboot

IoT is Hard!

Page 5: SDK in the Browser for Zephyr™...1. Supported URLs 2. Tell URLs 3. Show USB Dialog 4. Get URL 5. Load Application 6. Connect DATA Development Flow Edit Run Copy Edit Compile Reboot

Starting New IoT Project is HardDevelopment Environment SetupCablesSensorsDocumentationSample codeBIOS, firmware, OS updates

Page 6: SDK in the Browser for Zephyr™...1. Supported URLs 2. Tell URLs 3. Show USB Dialog 4. Get URL 5. Load Application 6. Connect DATA Development Flow Edit Run Copy Edit Compile Reboot

Solution

Page 7: SDK in the Browser for Zephyr™...1. Supported URLs 2. Tell URLs 3. Show USB Dialog 4. Get URL 5. Load Application 6. Connect DATA Development Flow Edit Run Copy Edit Compile Reboot

What if……this is all you need?

Page 8: SDK in the Browser for Zephyr™...1. Supported URLs 2. Tell URLs 3. Show USB Dialog 4. Get URL 5. Load Application 6. Connect DATA Development Flow Edit Run Copy Edit Compile Reboot

Demo

Page 9: SDK in the Browser for Zephyr™...1. Supported URLs 2. Tell URLs 3. Show USB Dialog 4. Get URL 5. Load Application 6. Connect DATA Development Flow Edit Run Copy Edit Compile Reboot

How Does It Work?

Page 10: SDK in the Browser for Zephyr™...1. Supported URLs 2. Tell URLs 3. Show USB Dialog 4. Get URL 5. Load Application 6. Connect DATA Development Flow Edit Run Copy Edit Compile Reboot

How Does It Work?

MCU

Zephyr

JerryScript

JS Runtime

WebUSB

ashell

Web Site

USB Cable

1. Supported URLs

2. Tell URLs 3. Show USB Dialog

4. Get URL

5. Load Application

6. Connect

DATA

Page 11: SDK in the Browser for Zephyr™...1. Supported URLs 2. Tell URLs 3. Show USB Dialog 4. Get URL 5. Load Application 6. Connect DATA Development Flow Edit Run Copy Edit Compile Reboot

Development Flow

Edit

CopyRun

Edit

Compile

Reboot

Flash

Reboot

Run

Native JavaScript*

*Other names and brands may be claimed as the property of others.

WebIDE

WebUSBJS Runtime for

Zephyr

Page 12: SDK in the Browser for Zephyr™...1. Supported URLs 2. Tell URLs 3. Show USB Dialog 4. Get URL 5. Load Application 6. Connect DATA Development Flow Edit Run Copy Edit Compile Reboot

JavaScript*

*Other names and brands may be claimed as the property of others.

Page 13: SDK in the Browser for Zephyr™...1. Supported URLs 2. Tell URLs 3. Show USB Dialog 4. Get URL 5. Load Application 6. Connect DATA Development Flow Edit Run Copy Edit Compile Reboot

JavaScript* Runtime for Zephyr OSEnable JavaScript application development on Zephyr OSAddress large JavaScript developer communityFast development cycle - No flashing, just copy .js filesBased on open source JerryScript JS engine and API layerWell known JavaScript APIs (Node.js* like)Application portability between MCU and MPU platformsSupport now for Arduino101* board and FRDM-K64F, all Zephyr OS supported boards in the future

*Other names and brands may be claimed as the property of others.

Page 14: SDK in the Browser for Zephyr™...1. Supported URLs 2. Tell URLs 3. Show USB Dialog 4. Get URL 5. Load Application 6. Connect DATA Development Flow Edit Run Copy Edit Compile Reboot

ArchitectureJavaScript* App

Business logic by the app developer

JS Runtime for ZephyrAPI bindingsBuild toolsSample and demo appsAPI docsOpen source (Apache 2.0)

JS EngineMicro JS engine - JerryScriptOpen source (Apache 2.0)

MCU

Zephyr

JerryScript

JS Runtime for Zephyr

JavaScript App Application

JavaScript APIs

*Other names and brands may be claimed as the property of others.

Page 15: SDK in the Browser for Zephyr™...1. Supported URLs 2. Tell URLs 3. Show USB Dialog 4. Get URL 5. Load Application 6. Connect DATA Development Flow Edit Run Copy Edit Compile Reboot

Two ModesRuntime Mode

JavaScript* source is converted into C string and embedded into zephyr.bin imageOnly the embedded JavaScript application is executed

Developer ModeJavaScript application is executed from Zephyr OS filesystemJavaScript application replaceable via USB or BLE using browser IDE or CLI tool

*Other names and brands may be claimed as the property of others.

Page 16: SDK in the Browser for Zephyr™...1. Supported URLs 2. Tell URLs 3. Show USB Dialog 4. Get URL 5. Load Application 6. Connect DATA Development Flow Edit Run Copy Edit Compile Reboot

Build$ git clone [email protected]/01org/zephyr.js

$ cd zephyr.js$ make DEV=ashell

MCU

Zephyr OS

JerryScript

JS Runtime for Zephyr

JavaScript* App

Building…

zephyr.bin$ make dfu

*Other names and brands may be claimed as the property of others.

Runtime M

ode

Developer M

ode

Page 17: SDK in the Browser for Zephyr™...1. Supported URLs 2. Tell URLs 3. Show USB Dialog 4. Get URL 5. Load Application 6. Connect DATA Development Flow Edit Run Copy Edit Compile Reboot

Browser IDEOnly in DEV modeCopy-n-Run3rd Party IDEsCLI ToolsWeb USB

Zephyr OS

JS Runtime

Web USB

JavaScript* App

Host PCUSB/BLE

*Other names and brands may be claimed as the property of others.

Page 18: SDK in the Browser for Zephyr™...1. Supported URLs 2. Tell URLs 3. Show USB Dialog 4. Get URL 5. Load Application 6. Connect DATA Development Flow Edit Run Copy Edit Compile Reboot

JavaScript* APIsAPI Zephyr OS Node.js

Events, Timers, Console Now Core API

Buffer Now Core API

BLE Now Bleno NPM

GPIO, I2C, AIO, PWM, UART Now Johnny-Five like

OCF Now IoTivity-node NPM

CoAP Planned CoAP NPM

MQTT Planned MQTT NPM

W3C Sensors, Performance Now TBD

UDP Now Core API

TCP, HTTP Coming Core API

File System Coming Core API

*Other names and brands may be claimed as the property of others.

Page 19: SDK in the Browser for Zephyr™...1. Supported URLs 2. Tell URLs 3. Show USB Dialog 4. Get URL 5. Load Application 6. Connect DATA Development Flow Edit Run Copy Edit Compile Reboot

Web USB

Page 20: SDK in the Browser for Zephyr™...1. Supported URLs 2. Tell URLs 3. Show USB Dialog 4. Get URL 5. Load Application 6. Connect DATA Development Flow Edit Run Copy Edit Compile Reboot

Web USB - Why It MattersUSB is a de-facto standard for connecting devices over short distancesIt is fast, reliable and inexpensiveIt allows for powering devices while communicatingAdvances over Bluetooth® and other wireless techs

Faster and more reliable - just worksWorks with laptop, desktop and phoneAllows for powering the deviceCan be used in places where signals are disallowed (planes, hospitals)Access to a device can be guarded physically

Page 21: SDK in the Browser for Zephyr™...1. Supported URLs 2. Tell URLs 3. Show USB Dialog 4. Get URL 5. Load Application 6. Connect DATA Development Flow Edit Run Copy Edit Compile Reboot

Introducing Web USBA new W3C standard allowing web sites and apps access to USB devicesNew USB headers creates further security and allows for a popup when plugging in the peripheralHeaders will become optional, but are recommended and required for popupWorks in Chrome* today on Linux*, Macintosh*, and Windows*

*Other names and brands may be claimed as the property of others.

Page 22: SDK in the Browser for Zephyr™...1. Supported URLs 2. Tell URLs 3. Show USB Dialog 4. Get URL 5. Load Application 6. Connect DATA Development Flow Edit Run Copy Edit Compile Reboot

Issues Web USBLinux*

modemmanager hijacks USB CDC devices unless their VID/PID are blacklisted

Windows*Does not autoload Web USB driver but requires MS OS descriptors (or INF file)Earlier versions (< 10) of Windows, requires a signed "driver", which is basically a signed INF text file, binding the VIP/PID to usbser.sys (the default USB serial driver)

Macintosh*No issues !

*Other names and brands may be claimed as the property of others.

Page 23: SDK in the Browser for Zephyr™...1. Supported URLs 2. Tell URLs 3. Show USB Dialog 4. Get URL 5. Load Application 6. Connect DATA Development Flow Edit Run Copy Edit Compile Reboot

Web Application

Page 24: SDK in the Browser for Zephyr™...1. Supported URLs 2. Tell URLs 3. Show USB Dialog 4. Get URL 5. Load Application 6. Connect DATA Development Flow Edit Run Copy Edit Compile Reboot
Page 25: SDK in the Browser for Zephyr™...1. Supported URLs 2. Tell URLs 3. Show USB Dialog 4. Get URL 5. Load Application 6. Connect DATA Development Flow Edit Run Copy Edit Compile Reboot

JavaScript* Web IDE for Zephyr OS Browser only Web Application - no server componentJavaScript code editor (Monaco from Microsoft*)Console (Google* console module)Board Viewer (new)Web USB for device communicationMultiple tabs and devicesGit Hub IntegrationAngular2

*Other names and brands may be claimed as the property of others.

Page 26: SDK in the Browser for Zephyr™...1. Supported URLs 2. Tell URLs 3. Show USB Dialog 4. Get URL 5. Load Application 6. Connect DATA Development Flow Edit Run Copy Edit Compile Reboot

JavaScript Web IDE for Zephyr OS (#2)

Open Sourcehttps://github.com/01org/zephyrjs-ide

Live sitehttps://01org.github.io/zephyrjs-ide/

Apache* 2.0

*Other names and brands may be claimed as the property of others.

Page 27: SDK in the Browser for Zephyr™...1. Supported URLs 2. Tell URLs 3. Show USB Dialog 4. Get URL 5. Load Application 6. Connect DATA Development Flow Edit Run Copy Edit Compile Reboot

Next Steps and Summary

Page 28: SDK in the Browser for Zephyr™...1. Supported URLs 2. Tell URLs 3. Show USB Dialog 4. Get URL 5. Load Application 6. Connect DATA Development Flow Edit Run Copy Edit Compile Reboot

Next StepsMore boards to board viewerCommunication between panelsProper API documentation to MonacoPlugins to other IDEsFlashing with Web USBAccess to local file systemWebUSB changesArduino 101* board ROM sizeTesting with other boards

*Other names and brands may be claimed as the property of others.

Page 29: SDK in the Browser for Zephyr™...1. Supported URLs 2. Tell URLs 3. Show USB Dialog 4. Get URL 5. Load Application 6. Connect DATA Development Flow Edit Run Copy Edit Compile Reboot

SummaryEasy to use development environmentLower the entry barrier to start IoT ProjectsGood fit for class rooms, hackathons and demos

Join the Open Source Projects !We are looking for contributionshttps://github.com/01org/zephyr.jshttps://github.com/01org/zephyrjs-ide

Page 30: SDK in the Browser for Zephyr™...1. Supported URLs 2. Tell URLs 3. Show USB Dialog 4. Get URL 5. Load Application 6. Connect DATA Development Flow Edit Run Copy Edit Compile Reboot

Questions ?

Page 31: SDK in the Browser for Zephyr™...1. Supported URLs 2. Tell URLs 3. Show USB Dialog 4. Get URL 5. Load Application 6. Connect DATA Development Flow Edit Run Copy Edit Compile Reboot

Try it Out @HackathonWed 1-4 pmForum SuiteSpace is limited, registration required

http://sched.co/9XjO