Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

IoT.JS: A JavaScript Platform for the Internet of Things

Ziran Sun introduces Iot.JS: A JavaScirpt platform for building IoT devices.

  • Login to see the comments

  • Be the first to like this

IoT.JS: A JavaScript Platform for the Internet of Things

  1. 1. 1Samsung Open Source Group Ziran Sun Samsung Open Source Group Samsung Research, UK FOSDEM 2018 Brussels, Belgium, February 3 &4, 2018. IoT.js A JavaScript platform for the Internet of Things
  2. 2. 2Samsung Open Source Group Overview • IoT.js Blinkt! light demo • Demo walk-through  IoT.js  Blinkt! module • Questions
  3. 3. 3Samsung Open Source Group IoT.js Blinkt! Light Demo
  4. 4. 4Samsung Open Source Group IoT.js Blinkt! Light Demo Blinkt Light GPIO Raspberry Pi Zero W (512k RAM, 8GB flash) Blinkt Module IoT.js JerryScript Linux OpenWeatherMapAPI from Weather data https.request
  5. 5. 5Samsung Open Source Group IoT.js Blinkt! Light Demo Demo implemented Fully in JavaScript
  6. 6. 6Samsung Open Source Group IoT.js
  7. 7. 7Samsung Open Source Group IoT.js • IoT.js aims to provide inter-operable service platform in the world of IoT. • Based on web technology and run on top of JerryScript • Designed to bring the success of Node.js to constrained IoT devices. • Runs ECMASCript application which can access device resource (network, File system)
  8. 8. 8Samsung Open Source Group IoT.js architecture
  9. 9. 9Samsung Open Source Group JerryScript • An ultra lightweight JavaScript engine • Originally developed from scratch by Samsung • Heavily optimized for low memory footprint • Self-contained and extremely portable
  10. 10. 10Samsung Open Source Group JerryScript • Transferred to JS Foundation in 2016 • Lightweight,modular, ECMAScript • Features added: – Introduced a debugger – ES6 related features: promise, TypedArray – More hardware support: e.g. ARM m-bed
  11. 11. 11Samsung Open Source Group IoT.js • Released 1.0 (July 2017) – Asynchronous, event driven I/O (libtuv) – Module system: native (C) and JavaScript modules – Node.js friendly architecture – Supports a subset of core Node.js modules, e.g. fs, events, http, net and stream etc – Provide a list of I/O control hardware modules
  12. 12. 12Samsung Open Source Group Blinkt! Light Module
  13. 13. 13Samsung Open Source Group Blinkt! Light Module • A JavaScript library to Interact with Blinkt! LEDs on RPi • Use GPIO interfaces in IoT.js var gpio = require('gpio');; Blinkt.prototype.setup= function setup() { gpio_dat ={ pin: DAT, direction: gpio.DIRECTION.OUT }, function(err) { }); } functionwriteByte(byte) { var bit; … gpio_dat.write(bit); … }
  14. 14. 14Samsung Open Source Group Integrate Blinkt! Module in IoT.js • Add module in iotjs/src/modules.json "blinkt":{ "js_file":"js/blinkt.js“, "require":[“gpio"] } • Enable module in Build -- ENABLE_MODULE_BLINKT
  15. 15. Thank you. 15Samsung Open Source Group