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

@wolkabout/wolkconnect-node-red

v1.0.0

Published

WolkConnect package for connecting to WolkAbout IoT tool through Node-RED

Downloads

3

Readme

██╗    ██╗ ██████╗ ██╗     ██╗  ██╗ ██████╗ ██████╗ ███╗   ██╗███╗   ██╗███████╗ ██████╗████████╗
██║    ██║██╔═══██╗██║     ██║ ██╔╝██╔════╝██╔═══██╗████╗  ██║████╗  ██║██╔════╝██╔════╝╚══██╔══╝
██║ █╗ ██║██║   ██║██║     █████╔╝ ██║     ██║   ██║██╔██╗ ██║██╔██╗ ██║█████╗  ██║        ██║   
██║███╗██║██║   ██║██║     ██╔═██╗ ██║     ██║   ██║██║╚██╗██║██║╚██╗██║██╔══╝  ██║        ██║   
╚███╔███╔╝╚██████╔╝███████╗██║  ██╗╚██████╗╚██████╔╝██║ ╚████║██║ ╚████║███████╗╚██████╗   ██║   
 ╚══╝╚══╝  ╚═════╝ ╚══════╝╚═╝  ╚═╝ ╚═════╝ ╚═════╝ ╚═╝  ╚═══╝╚═╝  ╚═══╝╚══════╝ ╚═════╝   ╚═╝   
                                  ███╗   ██╗ ██████╗ ██████╗ ███████╗    ██████╗ ███████╗██████╗ 
                                  ████╗  ██║██╔═══██╗██╔══██╗██╔════╝    ██╔══██╗██╔════╝██╔══██╗
                            █████╗██╔██╗ ██║██║   ██║██║  ██║█████╗█████╗██████╔╝█████╗  ██║  ██║
                            ╚════╝██║╚██╗██║██║   ██║██║  ██║██╔══╝╚════╝██╔══██╗██╔══╝  ██║  ██║
                                  ██║ ╚████║╚██████╔╝██████╔╝███████╗    ██║  ██║███████╗██████╔╝
                                  ╚═╝  ╚═══╝ ╚═════╝ ╚═════╝ ╚══════╝    ╚═╝  ╚═╝╚══════╝╚═════╝ 

WolkAbout Node-RED nodes module for connecting devices to WolkAbout IoT Platform.

Supported device communication protocol(s):

  • WolkAbout Protocol

Prerequisites

  • NodeJS >= 12.18.0
  • npm >= 6.14.4
  • Node-RED 1.0.6

NodeJS and npm can be installed either by installing binaries or you can install using a system's package manager. You can see the instructions for installing Node-RED here. Make sure to install the exact Node-RED version 1.0.6 by running sudo npm install -g --unsafe-perm [email protected].

Installation

Open the system terminal, and run Node-RED using the command node-red so that Node-RED can set up its directory structure. Once the process completes its initialisation, it is safe to terminate it.

Navigate to your Node-RED directory: $ cd ~/.node-red.

Install Wolkconnect Node-RED using:

npm install @wolkabout/wolkconnect-node-red

Example Usage

Establishing connection with WolkAbout IoT platform

Create a device on WolkAbout IoT platform with Device type 'Simple example'

Run Node-RED:

node-red

In browser, navigate to http://localhost:1880.

Import simple-example-flow.json into Node-RED by copying its contents and using Node-RED's import from clipboard functionality, or drag the file onto the flow panel.

Double-click the mqtt node to enter edit mode. Edit the server input field by clicking the pen icon next to it (WolkAbout Demo server is already pre-selected):

  • Under Connection tab, use your device key for Client ID.
  • If you want to connect securely, change port to 8883, check the Enable secure (SSL/TLS) connection checkbox, add new tls-config, and upload ca.pem certificate (located in examples folder) as CA Certificate.
  • Under Security tab, use your device key for Username, and device password for Password fields.
  • Under Messages tab paste your device key after lastwill/ in the Topic field for both close, and disconnect messages.

Edit the connect node by double-clicking it, and pass it device key and password.

Deploy the flow.

Connect to the platform by running the inject (timestamp) node connected to connect node.

The mqtt node connects to the broker automatically on each deploy, the connect and disconnect nodes are used to simulate devices connecting and disconnecting.

Adding sensor readings

Add sensor reading by using addSensorReading node and passing it value and reference. getRandomValue node can be used to pass random values to addSensorReading. It has to be provided with minimum and maximum reading values.

Data publish strategy

Stored sensor readings are pushed to WolkAbout IoT platform on demand by using the publish node.

Using the flow

The flow used for simple-example-template.json looks like this:

  • After configuring nodes, deploy them
  • Run connect
  • Send a reading to the platform by running the inject node connected to getRandomNumber

Disconnecting from the platform

Use the disconnect node to stop the device's connection to the platform.