Before beginning to build the flow diagram in Node-RED, some operations have to be done in Databoom:
- Create a device with the MQTT type and note down its token, clientID and publication topic;
- Create some singals for the device and note down their tokens;
- Assure to validate the signals so the data sent by Node-RED won't get lost;
- Create an OAuth token in Settings -> Credentials that enable data forwarding to Databoom.
Creating a flow in Node-RED
For the example flow diagram the the following blocks are used: inject, mqtt and function.
To forward data to Databoom it is possible to follow the diagram attached to the article
Timestamp blocks are intervals at the end of which random values are generate to populate the signals to forward to Databoom. Interval values should be greater than 60 seconds, no value is loggend under this threshold.
The values noted down previously go in the prepare-data-to-push block:
- signal tokens (rows 8 and 15 of the function);
- device token (row 23 of the function);
In the mqtt-to-databoom block fields for the MQTT transmission must be specified
- publication topic (Topic field in the node properties);
- the client id (in the server edit window, accessible by clicking the button with the pencil icon next to the server field in the node properties);
- authentication (in the server edit window, in the security tab), username is your username in Databoom, while the password is the OAuth token.