WolkAbout Node-RED nodes module for connecting devices to WolkAbout IoT Platform.
Supported device communication protocol(s):
- NodeJS ^10.15.13
- npm ^6.4.1
- Node-RED ^0.19.5
Navigate to your Node-RED directory:
$ cd ~/.node-red.
npm install @wolkabout/wolkconnect-node-red
Establishing connection with WolkAbout IoT platform
Create a device on WolkAbout IoT platform by importing
simple-example-template.json located in
This template fits
/examples/simple/wolkExample.js and demonstrates the sending of a temperature sensor reading.
In browser, navigate to
/examples/simple/ into Node-RED by copying its contents and using Node-RED's import from clipboard functionality, or drag the file onto the flow panel.
Edit WolkAbout Demo server in
mqtt node properties:
- 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.pemcertificate (located in
examplesfolder) 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.
Pass device key and password to the
Deploy the flow.
Connect to the platform by running the inject (timestamp) node connected to
mqtt node connects to the broker automatically on each deploy, the
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
Using the flow
The flow used for
simple-example-template.json looks like this:
- After configuring nodes, deploy them
- Send a reading to the platform by running the inject node connected to
Disconnecting from the platform
disconnect node to stop the device's connection to the platform.