{"id":15684418,"url":"https://github.com/rzr/generic-sensors-lite","last_synced_at":"2025-05-07T08:28:08.162Z","repository":{"id":30259905,"uuid":"124417993","full_name":"rzr/generic-sensors-lite","owner":"rzr","description":"Naive implementation of w3c specs for IoT.js","archived":false,"fork":false,"pushed_at":"2024-03-28T18:20:01.000Z","size":509,"stargazers_count":10,"open_issues_count":9,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-23T18:00:33.667Z","etag":null,"topics":["i2c","iot","sensor","w3c-specs","webthing-iotjs"],"latest_commit_sha":null,"homepage":"https://purl.org/rzr/sensors","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rzr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":["rzr"],"custom":["https://www.paypal.me/rzrfreefr","www.rzr.online.fr"]}},"created_at":"2018-03-08T16:25:35.000Z","updated_at":"2024-02-07T19:23:08.000Z","dependencies_parsed_at":"2023-12-15T21:17:45.753Z","dependency_job_id":"7ab1d220-d7ca-4fff-8ec3-aa48a28f1b05","html_url":"https://github.com/rzr/generic-sensors-lite","commit_stats":{"total_commits":309,"total_committers":10,"mean_commits":30.9,"dds":0.4239482200647249,"last_synced_commit":"abc03773ce683d0fa9aab9d64cbabac23c6a14e5"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rzr%2Fgeneric-sensors-lite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rzr%2Fgeneric-sensors-lite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rzr%2Fgeneric-sensors-lite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rzr%2Fgeneric-sensors-lite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rzr","download_url":"https://codeload.github.com/rzr/generic-sensors-lite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222688211,"owners_count":17023296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["i2c","iot","sensor","w3c-specs","webthing-iotjs"],"created_at":"2024-10-03T17:16:23.595Z","updated_at":"2024-11-02T08:06:27.084Z","avatar_url":"https://github.com/rzr.png","language":"JavaScript","funding_links":["https://github.com/sponsors/rzr","https://www.paypal.me/rzrfreefr","www.rzr.online.fr"],"categories":[],"sub_categories":[],"readme":"# GENERIC-SENSORS-LITE #\n\n[![GitHub forks](https://img.shields.io/github/forks/rzr/generic-sensors-lite.svg?style=social\u0026label=Fork\u0026maxAge=2592000)](https://GitHub.com/rzr/generic-sensors-lite/network/)\n[![license](https://img.shields.io/badge/license-Apache-2.0.svg)](LICENSE)\n[![NPM](https://img.shields.io/npm/v/generic-sensors-lite.svg)](https://www.npmjs.com/package/generic-sensors-lite)\n[![Build Status](https://api.travis-ci.org/rzr/generic-sensors-lite.svg?branch=master)](https://travis-ci.org/rzr/generic-sensors-lite)\n[![dependencies Status](https://david-dm.org/rzr/generic-sensors-lite/status.svg)](https://david-dm.org/rzr/generic-sensors-lite)\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frzr%2Fgeneric-sensors-lite.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Frzr%2Fgeneric-sensors-lite?ref=badge_shield)\n[![IRC Channel](https://img.shields.io/badge/chat-on%20freenode-brightgreen.svg)](https://kiwiirc.com/client/irc.freenode.net/#iot)\n\n[![NPM](https://nodei.co/npm/generic-sensors-lite.png)](https://npmjs.org/package/generic-sensors-lite)\n\n\n## INTRODUCTION: ##\n\nLightweight implementation of W3C spec, targeting constrained devices.\n\nSeveral JavaScript runtimes are supported (node.js, IoT.js using JerryScript)\n\n[![Presentation](https://image.slidesharecdn.com/webthing-iotjs-20181022rzr-181027220201/95/webthingiotjs20181022rzr-34-638.jpg)](https://www.slideshare.net/slideshow/embed_code/key/BGdKOn9HHRF4Oa#webthing-iotjs# \"WebThingIotJs\")\n\n\n## USAGE: ##\n\nBy default simulator are used and generate random values,\nbut following sensors can be plugged on pins of your favorite single board computer:\n\n* BH1650: for measuring illuminance  (i2c=0x23)\n* BMPx80: for measuring temperature, or any compatible sensor (ie: BMP180, i2c=0x77)\n* TCS34725: for measuring colors (i2c=0x29)\n* HTU21D: for measuring humidity (i2c=0x40) [Buy](\nhttps://www.amazon.com/HiLetgo%C2%AE-Temperature-Humidity-1-5V-3-6V-Compatible/dp/B00XR7CR1I/ref=rzr-21#\n)\n\n#### SETUP: ####\n\nPrivileged access to hardware resources is also required too (setup or use sudo).\n\nFor instance on Raspbian:\n\n``` \nsudo raspi-config # Enable I2C\nls -l /dev/i2c* || sudo reboot\nsudo apt-get install i2c-tools\n/usr/sbin/i2cdetect -y 1\n#|      0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f\n#| 00:          -- -- -- -- -- -- -- -- -- -- -- -- -- \n#| 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- \n#| 20: -- -- -- 23 -- -- -- -- -- 29 -- -- -- -- -- -- \n#| 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- \n#| 40: 40 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- \n#| 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- \n#| 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- \n#| 70: -- -- -- -- -- -- -- 77\n```\n\n#### USING NODE.JS: ####\n\n```\ngit clone --recursive https://github.com/rzr/generic-sensors-lite\ncd generic-sensors-lite\n\nnpm install\nnpm start\n#| node example/index.js \n#| (...)\n#| {\"illuminance\": 123.}\n#| (...)\n#| {\"celsius\": 42.}\n#| (...)\n(...)\n\n```\n\n\n#### USING IOT.JS ####\n\nFirst install IoT.js as explained at:\n\n-   \u003chttps://github.com/rzr/webthing-iotjs/wiki/IotJs\u003e\n\nFor Debian and derived (Ubuntu, Rasbian, Armbian):\n\n```sh\ncurl https://raw.githubusercontent.com/rzr/iotjs-express/master/extra/tools/iotjs/setup.sh \\\n| bash -x -e\n```\n\nFor constrained environments:\n\n```\nmake start\n#| (...)\n#| iotjs example/index.js \n#| (...)\n#| {\"illuminance\": 123.}\n#| (...)\n#| {\"celsius\": 42.}\n#| (...)\n```\n\nNote: It has been verified on GNU/Linux not TizenRT yet (TODO).\n\n\n#### USING NODE.JS ####\n\n```sh\nnode lib/ambientlight \"{ \\\"controller\\\": \\\"bh1750\\\"}\"\n```\n\n\n### DEMO: ###\n\n[![web-of-things-agriculture-20180712rzr.webm\n](\nhttps://camo.githubusercontent.com/8c693d7e5d3950831e7f7fd62aa1dc790a6100f8/68747470733a2f2f732d6f70656e736f757263652e6f72672f77702d636f6e74656e742f75706c6f6164732f323031382f30372f7765622d6f662d7468696e67732d6167726963756c747572652d3230313830373132727a722e676966#/generic-sensors-lite.gif\n)](\nhttps://player.vimeo.com/video/279677314#web-of-things-agriculture-20180712rzr.webm\n\"Video Demo\"\n)\n\nAn extra example is provided to show integration in WebThings project.\nSensors are powered by webthing-iotjs and monitored on dashboard as progressive web app (PWA).\n\nUsage:\n\n```sh\nmake runtime=iotjs start\nmake -C example/webthing runtime=iotjs start\n#| (...)\nlog: Serving: http://localhost:8888/properties\n#| (...)\n\ncurl  http://localhost:8888/properties\n#| { (...) \"illuminance\":123., \"celsius\":42., \"color\":\"#c0a175\" (...) } \n```\n\nRespectively node could be supported too,\njust adapt to webthing-node API instead of webthing-iotjs (TODO):\n\n```sh\nmake -C example/webthing runtime=node start\n#| (...)\n```\n\n\n## RESOURCES: ##\n\n* \u003chttps://purl.org/rzr/\u003e\n* \u003chttps://purl.org/rzr/sensors\u003e\n* \u003chttp://rzr.github.io/rzr-presentations/docs/sensors-webthings\u003e\n* \u003chttps://www.npmjs.com/package/generic-sensors-lite/\u003e\n* \u003chttps://github.com/rzr/generic-sensors-lite/\u003e\n* \u003chttps://libraries.io/npm/generic-sensors-lite/\u003e\n* \u003chttps://www.openhub.net/p/generic-sensors-lite\u003e\n* \u003chttps://medium.com/samsung-internet-dev/sensors-webthings-bc48ad9963dd#\u003e\n* \u003chttps://w3c.github.io/sensors/#section-mock-sensor-type\u003e\n* \u003chttps://developer.mozilla.org/en-US/docs/Web/API/Sensor_APIs\u003e\n* \u003chttps://github.com/rzr/generic-sensors-webthing/\u003e\n* \u003chttps://web.archive.org/web/20181208022842/https://s-opensource.org/2018/04/25/mozilla-iot-generic-sensors/\u003e\n* \u003chttps://github.com/miroRucka/bh1750/pull/17\u003e\n* \u003chttps://github.com/dbridges/bmp085-sensor/pull/7\u003e\n* \u003chttps://github.com/samsunginternet/color-sensor-js\u003e\n* \u003chttps://github.com/samsung/iotjs/wiki\u003e\n* \u003chttps://github.com/samsung/iotjs\u003e\n* \u003chttps://www.iotjs.net/\u003e\n* \u003chttps://jerryscript.net/\u003e\n* \u003chttps://github.com/rzr/webthing-iotjs/wiki/IotJs\u003e\n* \u003chttps://github.com/rzr/webthing-iotjs/wiki/Sensor\u003e\n* \u003chttps://social.samsunginter.net/@rzr/100969945665369600\u003e\n* \u003chttps://travis-ci.org/rzr/generic-sensors-lite\u003e\n\n\n## LICENSE: ##\n\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frzr%2Fgeneric-sensors-lite.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Frzr%2Fgeneric-sensors-lite?ref=badge_large)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frzr%2Fgeneric-sensors-lite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frzr%2Fgeneric-sensors-lite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frzr%2Fgeneric-sensors-lite/lists"}