node-red-contrib-wolkconnect v0.1.0
WolkAbout Node-RED nodes module for connecting devices to WolkAbout IoT Platform.
Supported device communication protocol(s):
- JsonSingleReferenceProtocol
Prerequisite
- NodeJS ^10.15.13
- npm ^6.4.1
- Node-RED ^0.19.5
Installation
Navigate to your Node-RED directory: ~/.node-red.
Install using:
npm install node-red-contrib-wolkconnectExample Usage
Establishing connection with WolkAbout IoT platform
Create a device on WolkAbout IoT platform by importing simple-example-template.json located in /examples/simple .
This template fits /examples/simple/wolkExample.js and demonstrates the sending of a temperature sensor reading.
Run Node-RED:
node-redIn browser, navigate to http://localhost:1880 .
Import simple-example-flow.json from /examples/simple/ into Node-RED by copying its contents and using Node-RED's import from clipboard functionality.
Provide your device key and password to MQTT out and wolkconnect connect nodes.
Use your device key for client ID, username.
Use device password for password on MQTT out.
Lastwill messages topic uses the following pattern lastwill/{device_key}.
Deploy the flow.
Connect to the platform by running the inject (timestamp) node connected to connect node.
Adding sensor readings
Add sensor reading by using addSensorReading node and passing it value and reference.
getRandomNumber 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.
Disconnecting from the platform
Use the disconnect node to stop the device's connection to the platform.