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 🙏

© 2025 – Pkg Stats / Ryan Hefner

node-flower-bridge

v1.8.6

Published

Flower Bridge

Downloads

97

Readme

Bridge node-flower-bridge Work

Version node Issues Forum

Get your access API

  • username password
  • client_id client_secret
    • Sign up to API here, and got by email your Access ID (client_id) and your Access secret (client_secret).

How to install

This program works with any BLE-equipped/BLE-dongle-equipped computers as well. To install it on your raspberry is really easy. You require Node (with npm) and BLE libraries.

First, you need a raspberry with a USB BLE dongle. This raspberry must be up and running. Then you need to install some required tools on your raspberry.

Step 1: NodeJs

First, nodejs needs to be installed, proceed as following:

$ wget http://node-arm.herokuapp.com/node_latest_armhf.deb
$ sudo dpkg -i node_latest_armhf.deb

Then do a node --version to check if it worked.

Step 2: BLE libraries

Then we need to install the BLE libraries:

$ sudo apt-get install libdbus-1-dev libdbus-glib-1-dev libglib2.0-dev libical-dev libreadline-dev libudev-dev libusb-dev glib2.0 bluetooth bluez libbluetooth-dev

The command hciconfig will be show your dongle (hci0):

$ sudo hciconfig hci0 up

You should be able to discover peripheral around you. To check it, do sudo hcitool lescan and if it shows you a list of surrounding BLE devices – or at least your Flower Power -- it works fine. If not, do sudo apt-get install bluez and try again.

Step 3: Build the brigde

Now Nodejs and BLE libraries are installed.

Ready to use it

If you have cloned this project, install:

$ ./install.sh

Edit credentials.json:

{
	"client_id":		"...",
	"client_secret":	"...",
	"username":		 	"...",
	"password":			"..."
}

And walk on the brigde:

$ ./bridge display			 : To have a output:
$ ./bridge background		 : To run the program in background
$ ./bridge restart			 : To restart the program
$ ./bridge status			 : To show the status
$ ./bridge stop			     : To stop the program
$ ./bridge					 : To have help
How it works
  • Login Cloud
  • Loop (every 15 minutes by default)
    • Get Inforamtions from Cloud
      • Your garden
      • Your user-config
    • For each of your FlowerPowers (1 by 1)
      • Scan to discover the Flower Power
      • Retrieve his history samples
      • Send his history samples to the Cloud
  • End Loop

The program relive a new Loop only if all Flower Powers have been checked.

Quick started for developers

If you have this module in dependencies:

$ npm install node-flower-bridge
var bridge = require('node-flower-bridge');
var credentials = {
	"client_id": "...",
	"client_secret": "...",
	"username": "...",
	"password": "..."
};

bridge.loginToApi(credentials, function(err, res) {
	if (err) return console.error(err);
	bridge.all('synchronize');
	bridge.live('...', 5);
	bridge.synchronize('...');
});

bridge.on('newProcess', function(flowerPower) {
	console.log(flowerPower.uuid, flowerPower.lastProcess);
});
bridge.on('info', function(info) {
	console.log(info.message);
});
bridge.on('error', function(error) {
	console.log(error.message);
});

The bridge is a continual queud. Method like .all .synchronize or .live push back to this queud.

Events
'login' = {access_token, expires_in, refresh_token}
'info' = {message, date}
'error' = {message, date}
'newState' = state
'newProcess' = {uuid, lastProcess, process, lastDate}

Api

Kind: global class

new FlowerBridge()

FlowerBridge - Module to build a bridge form BLE/sensors and CLOUD/Parrot

flowerBridge.loginToApi(credentials)

To connect your bridge to the Parrot cloud

Kind: instance method of FlowerBridge

| Param | Type | Description | | --- | --- | --- | | credentials | object | client_id client_secret username password |

flowerBridge.getUser(callback)

Get your current profil from the cloud Get all sensor Get user version

Kind: instance method of FlowerBridge

| Param | Type | Description | | --- | --- | --- | | callback | function | The callback after getting information form cloud |

flowerBridge.automatic(options)

Synchronize periodicly all of your flower powers

Kind: instance method of FlowerBridge Default: options[delay] = 15; // minutes

| Param | Type | Description | | --- | --- | --- | | options | object | delay priority |

flowerBridge.update(uuid, options)

[Update mode]

  • Synchronize historic samples
  • Update the frimware

Kind: instance method of FlowerBridge

| Param | Type | Description | | --- | --- | --- | | uuid | string | The Uuid of the flower power | | options | object | options[file] -> Binary file to update the flower power |

flowerBridge.synchronize(uuid)

[Synchronize mode]

  • Synchronize historic samples

Kind: instance method of FlowerBridge

| Param | Type | Description | | --- | --- | --- | | uuid | string | The Uuid of the flower power |

flowerBridge.live(uuid, options)

[Live mode]

  • Show every second each data of a sensor

Kind: instance method of FlowerBridge Default: options[delay] = 5

| Param | Type | Description | | --- | --- | --- | | uuid | string | The Uuid of the flower power | | options | json | options[delay] -> Delay of the live mode |

flowerBridge.all(action, options)

Apply then action for all flower powers of your garden.

  • options[delay] -> Do an action every delay minutes.
  • options[priority] -> array of uuid: Do this action for these flower power befor the normal process.

Kind: instance method of FlowerBridge

| Param | Type | Description | | --- | --- | --- | | action | string | The name of the function to apply. | | options | object | Options to deal with all sensors. |

forthebadge