{"id":22860005,"url":"https://github.com/reelyactive/advlib","last_synced_at":"2025-04-13T07:48:44.115Z","repository":{"id":33176978,"uuid":"36818146","full_name":"reelyactive/advlib","owner":"reelyactive","description":"Open source, protocol-agnostic library for decoding ambient wireless packets.  We believe in an open Internet of Things.","archived":false,"fork":false,"pushed_at":"2025-02-19T13:26:02.000Z","size":1495,"stargazers_count":109,"open_issues_count":1,"forks_count":23,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-13T07:48:19.352Z","etag":null,"topics":["advertising-packet-library","advlib","bluetooth-low-energy","epc","node-js","packet-decoding","pareto-anywhere","rain-rfid","rfid"],"latest_commit_sha":null,"homepage":"https://reelyactive.github.io/advlib/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reelyactive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-06-03T17:06:02.000Z","updated_at":"2025-02-19T13:26:07.000Z","dependencies_parsed_at":"2023-12-08T23:26:32.965Z","dependency_job_id":"dfe11423-878b-46c9-8d24-21d30a9dda57","html_url":"https://github.com/reelyactive/advlib","commit_stats":{"total_commits":228,"total_committers":4,"mean_commits":57.0,"dds":"0.14035087719298245","last_synced_commit":"45ec3c55856854a81d10e44afed081edb36dab40"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reelyactive%2Fadvlib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reelyactive%2Fadvlib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reelyactive%2Fadvlib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reelyactive%2Fadvlib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reelyactive","download_url":"https://codeload.github.com/reelyactive/advlib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248681494,"owners_count":21144700,"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":["advertising-packet-library","advlib","bluetooth-low-energy","epc","node-js","packet-decoding","pareto-anywhere","rain-rfid","rfid"],"created_at":"2024-12-13T09:08:39.556Z","updated_at":"2025-04-13T07:48:44.071Z","avatar_url":"https://github.com/reelyactive.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"advlib\n======\n\n__advlib__ is a library for decoding ambient wireless packets into web-standard JSON with a vendor/technology/application-agnostic set of properties.\n\n![Overview of advlib](https://reelyactive.github.io/advlib/images/overview.png)\n\n__advlib__ is a lightweight [Node.js package](https://www.npmjs.com/package/advlib) that can run on resource-constrained edge devices as well as on powerful cloud servers and anything in between.  It is included in reelyActive's [Pareto Anywhere](https://www.reelyactive.com/pareto/anywhere/) open source IoT middleware with its complementary _processor_ and _interpreter_ modules.  There's even an interactive, browser-based version hosted from the [gh-pages branch](https://github.com/reelyactive/advlib/tree/gh-pages) of this repository: [reelyactive.github.io/advlib/](https://reelyactive.github.io/advlib/)\n\n\nOpen Source _and_ Published\n---------------------------\n\nIn addition to being permissively-licensed open source software, our paper [Low-Power Wireless Advertising Software Library for Distributed M2M and Contextual IoT](https://ieeexplore.ieee.org/document/7389121/) was published and presented at the 2015 2nd IEEE World Forum on Internet of Things (WF-IoT) in Milan, Italy.  Learn more at [reelyactive.com/science](https://www.reelyactive.com/science/).\n\n\nProcessor modules\n-----------------\n\n__advlib__ is protocol-agnostic and currently supports the following _processor_ modules:\n- [advlib-ble](https://github.com/reelyactive/advlib-ble) for Bluetooth Low Energy\n- [advlib-epc-tds](https://github.com/reelyactive/advlib-epc-tds) for RAIN RFID (Electronic Product Code Tag Data Standard)\n- [advlib-esp](https://github.com/reelyactive/advlib-esp) for the EnOcean Wireless Standard (via the EnOcean Serial Protocol)\n\n\nInterpreter modules\n-------------------\n\n__advlib__ currently supports the following _interpreter_ module:\n- [advlib-interoperable](https://github.com/reelyactive/advlib-interoperable) for [InteroperaBLE identifiers](https://reelyactive.github.io/interoperable-identifier/).\n\n\nHello advlib!\n-------------\n\nFor example, process several raw packets received from a beacon by selecting Bluetooth Low Energy as the processor ([advlib-ble](https://github.com/reelyactive/advlib-ble)) and including any relevant processor and interpreter libraries.\n\n```javascript\nconst advlib = require('advlib');\n\nconst PROCESSORS = [\n    { processor: require('advlib-ble'),\n      libraries: [ require('advlib-ble-services'),\n                   require('advlib-ble-manufacturers') ],\n      options: { ignoreProtocolOverhead: true } }\n];\nconst INTERPRETERS = [ require('advlib-interoperable') ];\n\nlet packets = [\n    'c21d04acbe55daba16096164766c6962206279207265656c79416374697665',\n    'c21904acbe55daba1216aafe10fc017265656c7961637469766507',\n    'c21804acbe55daba1116aafe20000c4815200000004500000258'\n];\nlet processedPackets = advlib.process(packets, PROCESSORS, INTERPRETERS);\nconsole.log(processedPackets);\n```\n\nPaste the code above into a decoder.js file.  From the same folder, install package dependencies with the commands `npm install advlib`, `npm install advlib-ble`, ..., `npm install advlib-interoperable`.  Then run the code with the command `node decoder.js` and observe the packets combined, in order of precedence, into a single JSON:\n\n```javascript\n{ name: \"advlib by reelyActive\",\n  txPower: -4,\n  uri: \"https://www.reelyactive.com\",\n  batteryVoltage: 3.144,\n  temperature: 21.125,\n  txCount: 69,\n  uptime: 60000 }\n```\n\n\nStandard Properties\n-------------------\n\n__advlib__ observes the following standard properties to represent the information extracted from ambient data packets.  New standard properties are added whenever new data cannot be effectively represented using the existing properties.  Once established, a standard property should not change (unless otherwise noted).\n\n| Property                     | Type             | Notes               |\n|:-----------------------------|:-----------------|---------------------|\n| acceleration                 | Array of Number  | [ x, y, z ] In g    |\n| accelerationSamplingRate     | Number           | In Hz               |\n| accelerationTimeSeries       | Array of Array   | [[x],[y],[z] ] In g |\n| ammoniaConcentration         | Number           | In ppm              |\n| amperage                     | Number           | In amps             |\n| amperages                    | Array of Number  | In amps             |\n| angleOfRotation              | Number           | In degrees          |\n| appearance                   | String           | From Bluetooth      |\n| batteryPercentage            | Number           | 0 to 100 (%)        |\n| batteryVoltage               | Number           | In volts            |\n| carbonDioxideConcentration   | Number           | In ppm              |\n| carbonMonoxideConcentration  | Number           | In ppm              |\n| deviceIds                    | Array of String  |                     |\n| dissolvedOxygen              | Number           | 0 to 100+ (%)       |\n| distance                     | Number           | In m                |\n| elevation                    | Number           | In m                |\n| heading                      | Number           | In degrees          |\n| heartRate                    | Number           | In beats per minute |\n| illuminance                  | Number           | In lx               |\n| interactionDigest            | Array of Object  |                     |\n| isButtonPressed              | Array of Boolean |                     |\n| isContactDetected            | Array of Boolean |                     |\n| isLiquidDetected             | Array of Boolean |                     |\n| isMotionDetected             | Array of Boolean |                     |\n| languages                    | Array of String  | ISO 639-1           |\n| levelPercentage              | Number           | 0 to 100 (%)        |\n| magneticField                | Array of Number  | [ x, y, z ] In G    |\n| methaneConcentration         | Number           | In ppm              |\n| name                         | String           |                     |\n| nearest                      | Array of Object  |                     |\n| nitrogenDioxideConcentration | Number           | In ppm              |\n| numberOfOccupants            | Number           |                     |\n| passageCounts                | Array of Number  | [ entries, exits ]  |\n| pH                           | Number           | 0 to 14 (typical)   |\n| pm1.0                        | Number           | In ug/m3            |\n| pm2.5                        | Number           | In ug/m3            |\n| pm10                         | Number           | In ug/m3            |\n| position                     | Array of Number  | [ lon, lat, ele ]   |\n| pressure                     | Number           | In Pa               |\n| pressures                    | Array of Number  | In Pa               |\n| relativeHumidity             | Number           | 0 to 100 (%)        |\n| relay                        | Object           | See note below      |\n| soundPressure                | Number           | In dB               |\n| speed                        | Number           | In m/s              |\n| temperature                  | Number           | In Celcius          |\n| temperatures                 | Array of Number  | In Celcius          |\n| txCount                      | Number           |                     |\n| txPower                      | Number           | In dBm              |\n| uptime                       | Number           | In milliseconds     |\n| uri                          | String           |                     |\n| uuids                        | Array of String  |                     |\n| velocityOverall              | Array of Number  | [ x, y, z ] In m/s  |\n| version                      | String           | Format pending      |\n| volatileOrganicCompoundsConcentration | Number  | In ppm              |\n| voltage                      | Number           | In volts            |\n| voltages                     | Array of Number  | In volts            |\n\nProperties are intended to be as flat as possible to facilitate data manipulation, especially with respect to database schemas.  One exception is the _relay_ property which encapsulates ambient data intended for external processing by a third party.  A _relay_ Object has only one mandatory property, _type_, which is a String identifying the third party, and may also include any number of third-party-specific properties.\n\nSome properties have a singular and plural form where the latter is to represent multiple properties of the same type from a single device (ex: sensor beacon with multiple temperature probes).  In this case, the length of the Array is expected to correspond to the number of such instances supported by the device, with Array elements represented as `null` in the absence of a value.\n\nSome properties represent values captured over time, and are referenced against a cyclic counter to indicate a new capture or sample.  In this case, the cyclic count is represented as a separate property which adds a _Cycle_ suffix, for example, _passageCounts_ and _passageCountsCycle_.\n\nSome properties may be extended to represent time series data, sampled at a given rate.  In this case the data is represented as separate properties adding a _TimeSeries_ suffix and a _SamplingRate_ suffix, for example _accelerationTimeSeries_ and _accelerationSamplingRate_.\n\nSee the [reelyActive Developer's Cheatsheet](https://reelyactive.github.io/diy/cheatsheet/) for more details about the standard properties above which are considered to be dynamic ambient (dynamb) data.\n\n\n![advlib logo](https://reelyactive.github.io/advlib/images/advlib-bubble.png)\n\n\nWhat's in a name?\n-----------------\n\nThe name __advlib__, which is derived from \"advertising library\", sounds like _ad-lib_, hinting at the fact that decoding [ambient data](https://www.reelyactive.com/ambient-data/) is often improvised, especially when little or no documentation is available!\n\nThe function of __advlib__ is not unlike the Babel fish in Hitchiker's Guide to the Galaxy: _\"if you stick a Babel fish in your ear you can instantly understand anything said to you in any form of language.\"_  Hence, the Babel fish would make an obvious choice of mascot.\n\nWhy then did we choose the cuneiform symbol 𒄩 (KU\u003csub\u003e6\u003c/sub\u003e) as the __advlib__ mascot?  _Something's fishy..._\n\nLet's _ad-lib_ shall we?  The Babel fish is likely a reference to the [Tower of Babel](https://en.wikipedia.org//wiki/Tower_of_Babel) which itself is a parable meant to explain why the world's peoples speak different languages.  The tower may well have existed in ancient Babylon where the Sumerian/Akkadian languages were spoken.  [Cuneiform](https://en.wikipedia.org/wiki/Cuneiform), the earliest known writing system, was originally developed to write the Sumerian language.  And 𒄩 is the [Sumerian cuneiform symbol for fish](https://en.wiktionary.org/wiki/%F0%92%84%A9#Sumerian).  So 𒄩 can arguably be _decoded_ as Babel fish: the obvious choice of mascot indeed!\n\nDoes that seem like a completely implausable decoding of a cryptic message?  Well that's exactly what __advlib__ development often seemed like over the years!\n\n\nProject History\n---------------\n\nThe __advlib__ project began in 2015 and was published in a scientific paper entitled [Low-Power Wireless Advertising Software Library for Distributed M2M and Contextual IoT](https://www.reelyactive.com/science/reelyActive-IoT2015.pdf) presented at the [2nd IEEE World Forum on Internet of Things (WF-IoT)](http://wfiot2015.ieee-wf-iot.org/) in Milan, Italy that same year.\n\nIn 2020, __advlib__ was redesigned and updated to v1.x which is modular, more efficient, protocol-agnostic and better supports the broad range of use cases that have emerged since its initial conception.  The previous version remains available in the [release-0.1 branch](https://github.com/reelyactive/advlib/tree/release-0.1) and as [advlib@0.1.4 on npm](https://www.npmjs.com/package/advlib/v/0.1.4).\n\n\nModular Architecture\n--------------------\n\n__advlib__ is easily combined with the following complementary software modules:\n- [barnowl](https://github.com/reelyactive/barnowl)\n- [barnacles](https://github.com/reelyactive/barnacles)\n\nLearn more about the [reelyActive Open Source Software packages](https://reelyactive.github.io/diy/oss-packages/), all of which are bundled together as [Pareto Anywhere](https://github.com/reelyactive/pareto-anywhere) open source IoT middleware.\n\n\nContributing\n------------\n\nDiscover [how to contribute](CONTRIBUTING.md) to this open source project which upholds a standard [code of conduct](CODE_OF_CONDUCT.md).\n\n\nSecurity\n--------\n\nConsult our [security policy](SECURITY.md) for best practices using this open source software and to report vulnerabilities.\n\n\nLicense\n-------\n\nMIT License\n\nCopyright (c) 2015-2025 [reelyActive](https://www.reelyactive.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR \nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE \nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER \nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN \nTHE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freelyactive%2Fadvlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freelyactive%2Fadvlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freelyactive%2Fadvlib/lists"}