This folder contains WebUSB-enabled Serial interface for Zephyr OS.
This code has been tested with the Arduino 101.
-
Make sure you are running the latest dev-channel release of Google Chrome.
-
Make sure "WebUSB" and "Experimental Web Platform Features" flags are enabled in chrome://flags/.
-
Confirm the [Zephyr SDK] https://www.zephyrproject.org/doc/1.4.0/getting_started/installation_linux.html#zephyr-sdk) has been installed in your system.
-
Clone JavaScript* Runtime for Zephyr* OS (i.e zephyr.js) and make the initial setup.
https://github.com/nagineni/zephyr.js.git
-
Check out the 'webusb_ashell' branch. This branch includes the changes that are required to build 'ashell' application with WebUSB support.
$ cd zephyr.js
$ git checkout webusb_ashell
-
Set up ZJS environment variables and get source dependencies
$ cd zephyr.js
$ source zjs-env.sh 256
$ make update
$ source deps/zephyr/zephyr-env.sh 256
-
Build the 'ashell' app
$ cd zephyr.js
$ make DEV=ashell
-
Flash the image: To flash the device with dfu-util, first press the Master Reset button on your Arduino 101, and about three seconds later type:
make dfu
-
Stop
ModemManager
if it is running on your system:On Ubuntu:
sudo service modemmanager stop
-
When the flashing is done press the Master Reset button one more time to boot your new image. Once the device is booted, you should see a notification from Chrome: "Go to webusb-ashell.appspot.com to connect.". Click on the notification and try the demo by connecting and uploading the JS code.