Naive implementation of w3c specs for IoT.js
Clone or download
rzr iotjs: Relocate iotjs-async in iotjs_modules/async
To avoid tweeking path on TizenRT

Also Let iotjs_modules to be overriden

Change-Id: I8505b3533d0e129d6b1e8fc182d8f8b299b2d69e
Signed-off-by: Philippe Coval <p.coval@samsung.com>
Latest commit 3a0b497 Nov 9, 2018

README.md

GENERIC-SENSORS-LITE

Lightweight implementation of W3C spec, targeting constrained devices.

Several JavaScript runtimes are supported (node.js, IoT.js using JerryScript)

GitHub forks license NPM Build Status dependencies Status FOSSA Status

NPM

USAGE:

Following sensors can be plugged on pins of your favorite single board computer:

  • I2C:
    • BH1650: for measuring illuminance
    • BMP085: for measuring temperature, or any compatible sensor (ie: BMP180)

SETUP:

Privileged access to hardware resources is also required too (setup or use sudo).

For instance on Raspbian:

sudo raspi-config # Enable I2C
ls -l /dev/i2c* || sudo reboot
sudo apt-get install i2c-tools
/usr/sbin/i2cdetect -y 1

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- 23 -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- 77

USING NODE.JS:

git clone --recursive https://github.com/rzr/generic-sensors-lite
cd generic-sensors-lite
npm install
npm test
(...)
log: temperature: 28.1
log: ambientlight: 51
log: temperature: 28.1
log: temperature: 28.1
log: ambientlight: 51
(...)

USING IOT.JS

For constrained environments:

make runtime=iotjs run
# (...)
# iotjs example/index.js 
# log: temperature: 31.8
# log: ambientlight: 16.666666666666668
# (...)

DEMO:

web-of-things-agriculture-20180712rzr.webm

RESOURCES:

LICENSE:

FOSSA Status