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

node-red-contrib-ble-sense

v0.0.13

Published

Node-RED module for Bluetooth Low Energy (BLE) devices.

Downloads

149

Readme

node-red-contrib-ble-sense

Node-RED central module for Bluetooth Low Energy (BLE) devices. Speficially designed to connect microcontrollers such as Arduino Nano 33 BLE Sense but should be working well with other central devices.

Example peripheral codes are provided in examples folder.

You MUST USE SAME UUIDs that are given in example scripts to convert received data.

hci0 is accepted as default adapter. Multiple adapter support will be added later.

Permissions

To run without sudo run the following:

sudo setcap cap_net_raw+eip $(eval readlink -f `which node`)

This grants the node binary cap_net_raw privileges, so it can start/stop BLE advertising.

Installation

npm install node-red-contrib-ble-sense

Prerequisite

Requires @abandonware/noble: 1.9.2-20..

Quick Start

The package contains two nodes: BLE Scanner, BLE Connect.

BLE Scanner node allows you to scan BLE devices. A message with start as a topic starts scanning. The node can output the following:

  • Whole peripheral as an object.
  • The MAC address of the peripheral.
  • The advertisement data as a buffer array.

Hence BLE Scanner node can be used as an observer. This node also allows you to configure and search for a specific peripheral via given name. To stop scanning a message with stop topic should be given.

BLE Connect node provides direct connection to the peripheral. This node must not be used alone. The scanning should be in progress to establish a connection. It takes JSON Object as an input. The service and characteristics UUIDs should be provided. If not, it will try to subscribe all advertised characteristics.

The example input is shown below:

{
    "services": [
        "181a"
    ],
    "characteristics": [
        "2a6e",
        "2a6f",
        "2a6d"
    ]
}

More details are provided in Node-RED node information panel.

Examples

An example flow that provides subscription to the all characteristics is given below.

License

Licensed under the MIT License.

Cite

Please cite the following work if you use this package academically.

@article{KAYAN2021100437, title = {AnoML-IoT: An end to end re-configurable multi-protocol anomaly detection pipeline for Internet of Things}, journal = {Internet of Things}, pages = {100437}, year = {2021}, issn = {2542-6605}, doi = {https://doi.org/10.1016/j.iot.2021.100437}, url = {https://www.sciencedirect.com/science/article/pii/S2542660521000810}, author = {Hakan Kayan and Yasar Majib and Wael Alsafery and Mahmoud Barhamgi and Charith Perera} }

Latest Update Notes

  • Fixed the random connection drops.
  • Fixed the wrong node status for the scanner node.
  • Dependencies are updated.
  • Code is less spaghetti.

Known Bugs

  • Bluetooth adapter state event is not properly emitted during initialization.