• Stars
    star
    108
  • Rank 321,259 (Top 7 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 9 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Open source, protocol-agnostic library for decoding ambient wireless packets. We believe in an open Internet of Things.

advlib

advlib is a library for decoding ambient wireless packets into web-standard JSON with a vendor/technology/application-agnostic set of properties.

Overview of advlib

advlib is a lightweight Node.js package 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 open source middleware suite with its complementary processor and interpreter modules.

Processor modules

advlib is protocol-agnostic and currently supports the following processor modules:

  • advlib-ble for Bluetooth Low Energy
  • advlib-epc-tds for RAIN RFID (Electronic Product Code Tag Data Standard)
  • advlib-esp for the EnOcean Wireless Standard (via the EnOcean Serial Protocol)

Interpreter modules

advlib currently supports the following interpreter module:

Hello advlib!

For example, process several raw packets received from a beacon by selecting Bluetooth Low Energy as the processor (advlib-ble) and including any relevant processor and interpreter libraries.

const advlib = require('advlib');

const PROCESSORS = [
    { processor: require('advlib-ble'),
      libraries: [ require('advlib-ble-services'),
                   require('advlib-ble-manufacturers') ],
      options: { ignoreProtocolOverhead: true } }
];
const INTERPRETERS = [ require('advlib-interoperable') ];

let packets = [
    'c21d04acbe55daba16096164766c6962206279207265656c79416374697665',
    'c21904acbe55daba1216aafe10fc017265656c7961637469766507',
    'c21804acbe55daba1116aafe20000c4815200000004500000258'
];
let processedPackets = advlib.process(packets, PROCESSORS, INTERPRETERS);
console.log(processedPackets);

Paste 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:

{ name: "advlib by reelyActive",
  txPower: -4,
  uri: "https://www.reelyactive.com",
  batteryVoltage: 3.144,
  temperature: 21.125,
  txCount: 69,
  uptime: 60000 }

Standard Properties

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).

Property Type Notes
acceleration Array of Number [ x, y, z ] In g
amperage Number In amps
amperages Array of Number In amps
angleOfRotation Number In degrees
appearance String From Bluetooth
batteryPercentage Number 0 to 100 (%)
batteryVoltage Number In volts
deviceIds Array of String
distance Number In m
elevation Number In m
heading Number In degrees
heartRate Number In beats per minute
illuminance Number In lx
interactionDigest Array of Object
isButtonPressed Array of Boolean
isContactDetected Array of Boolean
isLiquidDetected Array of Boolean
isMotionDetected Array of Boolean
magneticField Array of Number [ x, y, z ] In G
name String
nearest Array of Object
numberOfOccupants Number
passageCounts Array of Number [ entries, exits ]
position Array of Number [ lon, lat, ele ]
pressure Number In Pa
pressures Array of Number In Pa
relativeHumidity Number 0 to 100 (%)
relay Object See note below
speed Number In m/s
temperature Number In Celcius
temperatures Array of Number In Celcius
txCount Number
txPower Number In dBm
uptime Number In milliseconds
uri String
uuids Array of String
version String Format pending
voltage Number In volts
voltages Array of Number In volts

Properties 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.

Some 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.

Some 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.

See the reelyActive Developer's Cheatsheet for more details about the standard properties above which are considered to be dynamic ambient (dynamb) data.

advlib logo

What's in a name?

The name advlib, which is derived from "advertising library", sounds like ad-lib, hinting at the fact that decoding ambient data is often improvised, especially when little or no documentation is available!

The 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.

Why then did we choose the cuneiform symbol ð’„© (KU6) as the advlib mascot? Something's fishy...

Let's ad-lib shall we? The Babel fish is likely a reference to the 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, the earliest known writing system, was originally developed to write the Sumerian language. And ð’„© is the Sumerian cuneiform symbol for fish. So ð’„© can arguably be decoded as Babel fish: the obvious choice of mascot indeed!

Does that seem like a completely implausable decoding of a cryptic message? Well that's exactly what advlib development often seemed like over the years!

Project History

The 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 presented at the 2nd IEEE World Forum on Internet of Things (WF-IoT) in Milan, Italy that same year.

In 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 and as [email protected] on npm.

Contributing

Discover how to contribute to this open source project which upholds a standard code of conduct.

Security

Consult our security policy for best practices using this open source software and to report vulnerabilities.

License

MIT License

Copyright (c) 2015-2023 reelyActive

Permission 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:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

barnowl

Universal converter of ambient RF decodings into standard JSON that is vendor/technology/application-agnostic. We believe in an open Internet of Things.
JavaScript
35
star
2

pi-suite

Enable context-aware physical spaces with a Raspberry Pi and Pareto Anywhere open source software. We believe in an open Internet of Things.
JavaScript
22
star
3

pareto-anywhere

Open source IoT middleware suite for context-aware physical spaces. We believe in an open Internet of Things.
JavaScript
22
star
4

diract

Proximity interaction detection embedded software for Bluetooth beacons. We believe in an open Internet of Things.
JavaScript
16
star
5

ble-android-sdk

SDK for Android devices to interact with reelyActive reelceivers via Bluetooth Smart (BLE). We believe in an open Internet of Things.
Java
16
star
6

web-ble-demo

Detect and identify nearby BLE devices via the web, in a web browser. We believe in an open Internet of Things.
HTML
16
star
7

advlib-ble-manufacturers

Open source library for decoding ambient Bluetooth Low Energy (BLE) advertising packet manufacturer-specific data. We believe in an open Internet of Things.
JavaScript
14
star
8

sniffypedia

A collaborative repository of linked data and digital twins for radio-identifiable products. We believe in an open Internet of Things.
HTML
14
star
9

midiot

MIDI meets IoT: real-time, real-world sounds. We believe in an open Internet of Things.
JavaScript
11
star
10

barnowl-minew

Collect and process ambient Bluetooth Low Energy packets from Minew gateways for real-time location and sensing. We believe in an open Internet of Things.
JavaScript
11
star
11

advlib-ble-services

Open source library for decoding ambient Bluetooth Low Energy (BLE) advertising packet service data. We believe in an open Internet of Things.
JavaScript
11
star
12

generable

Generative art from ambient BLE advertisement packets. We believe in an open Internet of Things.
JavaScript
10
star
13

hlc-server

Serves real-time real-world context at a human scale by combining RFID, RTLS and M2M with structured, linked data on the web. We believe in an open Internet of Things.
JavaScript
9
star
14

json-silo

Data silo for digital twins in context-aware physical spaces. We believe in an open Internet of Things.
JavaScript
9
star
15

barnowl-aruba

Collect ambient Bluetooth Low Energy, EnOcean Alliance & WiFi packets from HPE Aruba Networking access points for real-time location and sensing. We believe in an open Internet of Things.
JavaScript
8
star
16

raddec

Protocol-agnostic RADio DECoding packet library. We believe in an open Internet of Things.
JavaScript
8
star
17

chickadee

Contextual associations store and API for context-aware physical spaces. We believe in an open Internet of Things.
JavaScript
7
star
18

ble-ios-sdk

Objective-C
7
star
19

barnowl-hci

Collect ambient advertising packets from the Bluetooth Host Controller Interface (HCI) for real-time location and sensing. We believe in an open Internet of Things.
JavaScript
7
star
20

cuttlefish

Client-side utility for human-friendly HTML rendering of machine-friendly ambient data. We believe in an open Internet of Things.
JavaScript
6
star
21

espruino-apps

Applications for Espruino devices such as Puck.js, Bangle.js and Jolt.js. We believe in an open Internet of Things.
JavaScript
5
star
22

barnacles

Efficient real-time processor of ambient IoT data, enabling hyperlocal context as standard JSON. We believe in an open Internet of Things.
JavaScript
5
star
23

jsonerator

Minimal web interface to represent a person, product or place as JSON-LD using schema.org. We believe in an open Internet of Things.
JavaScript
4
star
24

node-style-guide

Our guide to creating, maintaining and testing JavaScript for NodeJS. We believe in an open Internet of Things.
3
star
25

dashboard-template-angular

Minimal template for client-side dashboard using AngularJS. We believe in an open Internet of Things.
JavaScript
3
star
26

hexoskin-rtls-dashboard

Dashboard combining Hexoskin sensor data and reelyActive real-time location. We believe in an open Internet of Things.
JavaScript
3
star
27

pareto-anywhere-azure

Pareto Anywhere open source IoT middleware as a serverless Azure Function. We believe in an open Internet of Things.
JavaScript
3
star
28

advlib-interoperable

Interpreter of InteroperaBLE identifiers in ambient wireless packets, for the protocol-agnostic advlib library. We believe in an open Internet of Things.
JavaScript
3
star
29

pi-relay

Raspberry Pi based relay of real-time events to a remote server. We believe in an open Internet of Things.
JavaScript
3
star
30

audible-proximity

Play audio files on a portable computer, like the Raspberry Pi, based on its proximity to Bluetooth beacons. We believe in an open Internet of Things.
JavaScript
3
star
31

barnowl-impinj

Collect ambient RAIN RFID packets as standard JSON radio decodings using Impinj readers. We believe in an open Internet of Things.
JavaScript
3
star
32

rtlips-server

Real-Time Location & Indoor Positioning System server. We believe in an open Internet of Things.
JavaScript
2
star
33

barterer

Real-time location & sensor data API for the IoT. We believe in an open Internet of Things.
JavaScript
2
star
34

starling

Emulator of wireless device transmissions in the IoT. We believe in an open Internet of Things.
JavaScript
2
star
35

tessel-relay

Tessel 2 based relay of real-time events to a remote server. We believe in an open Internet of Things.
JavaScript
2
star
36

barnowl-llrp

Collect ambient EPC tag data from RFID readers as standard JSON radio decodings, using the Low-Level Reader Protocol (LLRP). We believe in an open Internet of Things.
JavaScript
2
star
37

nicla-vision-gauge-reader

Read gauges with machine vision and relay the data via Bluetooth Low Energy. We believe in an open Internet of Things.
Python
2
star
38

pareto-anywhere-apps

Collection of web apps enabled by Pareto Anywhere open source IoT middleware. We believe in an open Internet of Things.
JavaScript
2
star
39

smartspaces-server

Serves up static content of smartspaces webpages. We believe in an open Internet of Things.
JavaScript
2
star
40

puckyactive-firmware

Firmware examples for Puck.js enabling puckyActive demos. We believe in an open Internet of Things.
JavaScript
2
star
41

reelyactive.github.io

Do-it-yourself with reelyActive hardware and open source software. We believe in an open Internet of Things.
HTML
2
star
42

advlib-epc

Open source library for decoding ambient Electronic Product Codes from RAIN tags. We believe in an open Internet of Things.
JavaScript
2
star
43

barnowl-rfcontrols

Collect ambient RAIN RFID packets from RF Controls readers. We believe in an open Internet of Things.
JavaScript
2
star
44

beaver

Client-side utility to maintain an up-to-date hyperlocal context graph by consuming the real-time data stream from Pareto Anywhere APIs. We believe in an open Internet of Things.
JavaScript
2
star
45

smartspaces-client

The HTML, JS and CSS run by the client to experience Smart Spaces. We believe in an open Internet of Things.
JavaScript
1
star
46

sensorscape

Visualisation of real-time sensor data from low-power wireless devices. We believe in an open Internet of Things.
JavaScript
1
star
47

infosec-best-practices

Best practices for information security using reelyActive open source software. We believe in an open Internet of Things.
1
star
48

tessel-hub

Reel data forwarder for the Tessel 2 platform. We believe in an open Internet of Things.
CSS
1
star
49

pareto-home

Pareto webpage. We believe in an open Internet of Things.
HTML
1
star
50

reely-hotspot

Java
1
star
51

angular-style-guide

Our guide to creating, maintaining and testing JavaScript for AngularJS, including HTML and CSS.
1
star
52

quividi-reelyactive-demo

Demonstration of Quividi real-time video demographics alongside reelyActive real-time BLE detection. We believe in an open Internet of Things.
JavaScript
1
star
53

barnowl-test

A simple way to evaluate barnowl regardless of whether or not you have access to reelyActive technology
JavaScript
1
star
54

neopixel-serial-api

REST API to control NeoPixel strips via a serial link to a microcontroller. We believe in an open Internet of Things.
JavaScript
1
star
55

business-ecosystem

Linked Data map of the business ecosystem. We believe in an open Internet of Things.
HTML
1
star
56

accelerometer-web-demo

Real-time accelerometer orientation web demo from a websocket data feed. We believe in an open Internet of Things.
JavaScript
1
star
57

esmapdb

ESMapDB is an embedded database for Node.js with an ECMAScript Map interface. We believe in an open Internet of Things.
JavaScript
1
star
58

node-red-pareto-anywhere

Prototype event-driven applications with Pareto Anywhere open source IoT middleware in Node-RED. We believe in an open Internet of Things.
HTML
1
star
59

advlib-epc-tds

Open source library for decoding ambient EPC Tag Data Standard data from Gen 2 RFID tags. We believe in an open Internet of Things.
JavaScript
1
star
60

barnowl-tcpdump

Collect ambient WiFi packets as standard JSON radio decodings, using tcpdump. We believe in an open Internet of Things.
JavaScript
1
star
61

advlib-ble

Open source library for decoding ambient Bluetooth Low Energy (BLE) advertising packets. We believe in an open Internet of Things.
JavaScript
1
star
62

barnowl-chafon

Collect ambient RAIN RFID packets from Chafon readers. We believe in an open Internet of Things.
JavaScript
1
star
63

web-style-guide

Style guide for reelyActive webpages and web apps, based on Bootstrap 5 and Font Awesome 5 (Free). We believe in an open Internet of Things.
HTML
1
star