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

2jcie-ble-decode

v0.1.0

Published

A simple package to decode the data frames sent by the 2JCIE-BU sensor from Omron

Downloads

24

Readme

2jcie-ble-decode

A simple package to decode the data frames sent by the 2JCIE-BU01 sensor from Omron

Description

This package will allow for easy BLE interfacing with the 2JCIE-BU01 sensor from Omron. There are similar sensors that may also work, but are not tested.

There's no support (in this package) for reading data via USB.

Setup

This package is capable of decoding both "Sensor Data" and "Calculation Data" message types. The sensor only transmits "Sensor Data" by default, but you can use Omron's mobile app to configure it to send both.

| Platform | App Link | | -- | -- | | App Store | ENV Monitor | | Google Play | ENV Monitor |

Usage

  1. Install the package with npm i --save 2jcie-ble-decode
  2. Require the dependency
  3. Instantiate the dependency with optional configuration
  4. Register event handlers
const Sensor = require('2jcie-ble-decode');
const sensor = new Sensor();

(() => {
    // Listener for all events
    sensor.on('event', (data) => console.log(data));

    // Listeners for specific event types (options are 'calculation' and 'sensor')
    sensor.on('calculation', handleCalculationData);
    sensor.on('sensor', handleSensorData);

    // Listener for error events
    sensor.on('error', handleErrors);

}) ();

Configuration

The constructor accepts an options object which can be omitted to accept defaults:

const sensor = new Sensor();

You can provide an options object parameter to the Sensor() constructor as follows:

const sensor = new Sensor({
	// Activate test mode, which doesn't require Bluetooth hardware or a sensor. 
	// You will receive alternating sample "sensor" and "calculation" events ever 1s
	// Sample events defined in ./mock/example.js
    testMode: false, // defaults to false
    
	// Activate the whitelist.  Ignore any events not originating from one of these addresses
    whitelist: [ 'yourSensorMAC' ], 

	// If omitted, a Barnowl instance will be created and register the BarnowlHci listener
	// Use this if you already have a Barnowl instance in your project and you just want to
	// add the ability to process Omron data frames.
    barnowl: existingBarnowlInstance,
    
    // Minimum number of seconds to wait before emitting another reading.
    interval: 5

});

Output

Output will be in the following format:

'sensor' Event Type:

{
    "dataType": 3,
    "sequenceNumber": 54,
    "temperature": 23.97,
    "relativeHumidity": 49.25,
    "ambientLight": 361,
    "barometricPressure": 1018.602,
    "soundLevel": 51.58,
    "eTVOC": 25,
    "eCO2": 565,
    "messageType": "sensor",
    "temperatureF": 75.146,
    "deviceId": "d13e50866f01"
}

'calculation' Event Type:

{
    "dataType": 3,
    "sequenceNumber": 54,
    "discomfortIndex": 70.36,
    "heatStrokeRisk": 20.26,
    "vibration": 0,
    "siValue": 0,
    "peakGroundAcceleration": 0,
    "seismicIntensity": 0,
    "accXAxis": 894.3,
    "accYAxis": 6305.9,
    "accZAxis": 6249.9,
    "messageType": "calculation",
    "deviceId": "d13e50866f01"
}

Resources

OMRON 2JCIE-BU01 Manual: https://omronfs.omron.com/en_US/ecb/products/pdf/A279-E1-01.pdf