npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

barnowl

v1.3.3

Published

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

Downloads

167

Readme

barnowl

barnowl converts ambient RF decodings into standard developer-friendly JSON that is vendor/technology/application-agnostic.

Overview of barnowl

barnowl 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 where it consolidates the real-time data from several barnowl-x modules, each of which interfaces with specific radio infrastructure, such as gateways, APs and readers.

Getting Started

Follow our step-by-step tutorials to get started with barnowl-x or Pareto Anywhere using specific infrastucture:

Learn "owl" about the raddec JSON data output:

Quick Start

Clone this repository, install package dependencies with npm install, and then from the root folder run at any time:

npm start

barnowl will listen for UDP raddec packets on 0.0.0.0:50001 and output (flattened) raddec JSON to the console.

Hello barnowl!

Developing an application directly from barnowl? Start by pasting the code below into a file called server.js:

const Barnowl = require('barnowl');

let barnowl = new Barnowl({ enableMixing: true });

barnowl.addListener(Barnowl, {}, Barnowl.TestListener, {});

barnowl.on('raddec', (raddec) => {
  console.log(raddec);
  // Trigger your application logic here
});

From the same folder as the server.js file, install package dependencies with the command npm install barnowl. Then run the code with the command node server.js and observe the simulated data stream of radio decodings (raddec objects) output to the console:

{
  transmitterId: "001122334455",
  transmitterIdType: 2,
  rssiSignature: [
    {
      receiverId: "001bc50940810000",
      receiverIdType: 1,
      rssi: -61,
      numberOfDecodings: 2
    },
    {
      receiverId: "001bc50940810001",
      receiverIdType: 1,
      rssi: -63,
      numberOfDecodings: 2
    }
  ],
  packets: [ '061b55443322110002010611074449555520657669746341796c656572' ],
  timestamp: 1645568542222
}

See Where to listen? below to adapt the code to listen for your gateways, APs and/or readers.

Where to listen?

barnowl includes a TestListener (see the Hello barnowl! example above) and a UdpListener (see the first example below) while all other listeners exist as separate software packages to keep the code as lightweight and modular as possible. The following table lists all these listener packages which integrate seamlessly with barnowl in just two lines of code.

| Listener package | Use with | |:------------------------------------------------------------------|:---------| | barnowl-minew | Minew gateways (ex: G1, G2, MG3, MG4) | | barnowl-aruba | HPE Aruba Networking access points | | barnowl-huawei | Huawei access points | | barnowl-reel | reelyActive hardware (BLE, sub-GHz active RFID) | | barnowl-hci | BLE radios on Linux computers (ex: Raspberry Pi, PC, ...) | | barnowl-laird | Laird Connectivity gateways (ex: IG60-BL654) | | barnowl-impinj | Impinj RFID readers | | barnowl-rfcontrols | RF Controls RFC OS | | barnowl-csl | CSL RFID readers | | barnowl-chafon | Chafon RFID readers | | barnowl-llrp | Low-Level Reader Protocol (LLRP) | | barnowl-enocean | EnOcean (ex: USB dongle) | | barnowl-tcpdump | WiFi radios on computers that can run tcpdump | | barnowl-axis | AXIS Communications IP cameras |

Example: UDP raddecs

const Barnowl = require('barnowl');

let barnowl = new Barnowl({ enableMixing: true });

barnowl.on("raddec", (raddec) => { /* Handle the raddec */ });

// Add the included UDP listener with relevant options
barnowl.addListener(Barnowl, {}, Barnowl.UdpListener, { path: "0.0.0.0:50001" });

Example: reelyActive hardware connected via serial port

const Barnowl = require('barnowl');
const BarnowlReel = require('barnowl-reel'); // 1: Include the interface package

let barnowl = new Barnowl({ enableMixing: true });

barnowl.on("raddec", (raddec) => { /* Handle the raddec */ });

// 2: Add the specific listener with relevant options
barnowl.addListener(BarnowlReel, {}, BarnowlReel.SerialListener, { path: "auto" });

Example: built-in BLE radio of a Raspberry Pi

const Barnowl = require('barnowl');
const BarnowlHci = require('barnowl-hci'); // 1: Include the interface package

let barnowl = new Barnowl({ enableMixing: true });

barnowl.on("raddec", (raddec) => { /* Handle the raddec */ });

// 2: Add the specific listener with relevant options
barnowl.addListener(BarnowlHci, {}, BarnowlHci.SocketListener, {});

Example: WiFi radio on computer with tcpdump installed

const Barnowl = require('barnowl');
const BarnowlTcpdump = require('barnowl-tcpdump'); // 1: Include the package

let barnowl = new Barnowl({ enableMixing: true });

barnowl.on("raddec", (raddec) => { /* Handle the raddec */ });

// 2: Add the specific listener with relevant options
barnowl.addListener(BarnowlTcpdump, {}, BarnowlTcpdump.SpawnListener, {});

Example: reelyActive hardware & tcpdump

barnowl supports multiple simultaneous listeners and will mix decodings of the same transmission from different sources provided that the enableMixing feature is enabled. For instance, the reelyActive Owl-in-One combines a BLE and WiFi source.

const Barnowl = require('barnowl');
const BarnowlReel = require('barnowl-reel');       // 1: Include each of the
const BarnowlTcpdump = require('barnowl-tcpdump'); //    interface packages

let barnowl = new Barnowl({ enableMixing: true });

barnowl.on("raddec", (raddec) => { /* Handle the raddec */ });

let uart = /* */; // In this case the uart is an emitter of 'data' events

// 2: Add the specifics listener with relevant options
barnowl.addListener(BarnowlReel, {}, BarnowlReel.EventListener, { path: uart });
barnowl.addListener(BarnowlTcpdump, {}, BarnowlTcpdump.SpawnListener, {});

Is that owl you can do?

While barnowl may suffice standalone for simple real-time applications, its functionality can be greatly extended with the following software packages:

  • advlib to decode the individual packets from hexadecimal strings into JSON
  • barnacles to distribute the real-time data stream via APIs and more
  • chimps to process the spatial-temporal dynamics data stream

These packages and more are bundled together as the Pareto Anywhere open source middleware suite, which includes a variety of barnowl-x listeners, APIs and interactive web apps.

Options

barnowl supports the following options:

| Property | Default | Description | |:---------------------------|:--------|:------------------------------------| | enableMixing | false | Mix together decodings from the same transmitter | | mixingDelayMilliseconds | 1000 | Maximum time for any decoding to spend in the mixing queue | | minMixingDelayMilliseconds | 5 | Minimum time to delay between subsequent queue managements | | encodeRaddecs | false | Output raddecs as hex strings rather than as JSON | | acceptFutureRaddecs | true | raddecs with future timestamps are adjusted to current time and accepted, else rejected |

In most use cases, enableMixing should be set to true except under extreme memory constraints and/or when absolutely no processing delay can be tolerated. Mixing decodings into a single raddec provides lossless compression and promotes efficient data distribution and processing.

let barnowl = new Barnowl({ enableMixing: true }); // Recommended

barnowl logo

What's in a name?

The Barn Owl has the best hearing of any animal tested. Since this middleware is effectively listening (via hardware 'ears') for all the wireless devices in a Smart Space, barnowl would seem a more than fitting name. Moreover, Wikipedia introduces the Barn Owl as "the most widely distributed species of owl, and one of the most widespread of all birds". An ambitiously inspiring fact considering our vision for a global crowdsourced infrastructure of Wireless Sensor Networks in the Internet of Things (IoT).

Don't think we can top that? Well check out this quote: "the barn owl is the most economically beneficial species to humans". Yes, apparently the U.S. Fish and Wildlife Service is prepared to argue so. Too ambitious? Well, consider this quote from Jeremy Rifkin: "What makes the IoT a disruptive technology in the way we organize economic life is that it helps humanity reintegrate itself into the complex choreography of the biosphere, and by doing so, dramatically increases productivity without compromising the ecological relationships that govern the planet."

Can a few hundred lines of server-side Javascript known as barnowl really live up to that? Owl we know is it can tyto do its nest!

Project History

barnowl is reelyActive's original open source package, which, when initially released in 2014, decoded wireless packets specifically from reelceivers. As third-party hardware became available, and technologies such as Bluetooth Low Energy emerged as global standards, barnowl evolved into the vendor-and-technology-agnostic middleware it is today.

barnowl v1.0.0 was released in January 2019, superseding all earlier versions, the latest of which remains available in the release-0.4 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) 2014-2024 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.