barnowl listens for reelyActive radio sensor reel packets, processes the data stream and emits detected events. In other words, it is a middleware package that identifies and locates all the advertising wireless devices within a Smart Space. Why the name? The Barn Owl has the best hearing of any animal tested.

barnowl requires a source of reelyActive sensor reel packets. These originate from a reel of reelceivers. The packet stream may arrive via a local serial connection or encapsulated in UDP packets from a remote source. reelyActive hardware can be purchased via our online store.

barnowl runs happily on embedded computers such as the BeagleBone Black, as well as your local machine, as well as in the cloud. And it installs in just one line via npm:

This JSON represents a visibility event, in other words a device has sent a radio transmission rendering itself visible to all compatible listening devices in range. There are three elements to a visibility event:

Radio Decodings of the transmission. This is an array of reelyActive reelceivers which decoded the transmission, ordered by their received signal strength (RSSI). reelyActive devices use EUI-64 identifiers.

All Bluetooth Smart (also known as Bluetooth Low Energy) advertising packets are supported, and these use the 48-bit advertiser address as an identifier. Both the header and data are processed for common fields, however not exhaustively with the current version. The packet below illustrates a selection of these fields (note that it is not a valid BLE packet).

Listening for UDP packets requires binding barnowl to an IP address and port on the local machine. For example if the machine running barnowl has an Ethernet interface with IP address 192.168.1.101, and hardware packets are being sent to that interface on port 50000, then barnowl should listen on that IP address and port as follows:

barnOwlInstance.bind({ protocol:'udp', path:'192.168.1.101:50000'});

Serial

Listening on a serial interface requires the serialport package. This is NOT included as a dependency since it may not be trivial to install depending on the hardware and operating system. Ensure that serialport is installed before you bind barnowl to a serial interface! Specify the serial interface to listen on as follows:

barnOwlInstance.bind({ protocol:'serial', path:'/dev/ttyUSB0'});

Events

Listening to Node.js Events requires binding barnowl to an EventEmitter. Listening to events is a simple means to connect barnowl with alternative data sources. For instance, you might create an EventEmitter that outputs historical data from a file. Or you might create an EventEmitter to facilitate integration with hardware like the UART of a Tessel.

barnOwlInstance.bind({ protocol:'event', path: eventSource });

Test

As of version 0.4.4 there's a built-in simulated hardware packet generator that can be helpful for getting started and debugging. A reelyActive and a Bluetooth Smart packet will be produced every second, each decoded on two reelceivers with RSSI values in continuous random flux.

The following options are supported when instantiating barnowl (those shown are the defaults):

{
n: 1,
enableMixing: false,
mixingDelayMilliseconds: 25
}

Maximum Strongest Radio Decodings

It is possible to specify the maximum number of strongest radio decodings to include in visibility events. This setting could be used for triangulation. For instance, to set this to 3, instantiate barnowl as follows:

var barnOwlInstance =newbarnOwl({ n:3});

Mix Multiple Sources

It is possible to enable a temporal mixing queue which compensates for the case where multiple sources detect the same radio transmission. For example, if distinct reels are in such proximity that they detect the same devices, this setting should be enabled. By default this setting is disabled to reduce the memory and computation footprint of barnowl. To enable the temporal mixing queue, instantiate barnowl as follows:

var barnOwlInstance =newbarnOwl({ enableMixing:true});

Adjust Mixing Delay

If enableMixing is set to true, the mixing delay specifies the maximum time to wait for additional decodings of the same radio transmission to arrive. The value can be increased from the default to compensate for long network delays or reduced to minimise latency. To set the mixing delay to 100 milliseconds, instantiate barnowl as follows:

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.