Examples for Node-RED
114/258
10.2 Example 2: MQTT input node
The MQTT input node allows receiving data from an MQTT broker via the
MQTT protocol and uses the MQTT function
subscribe
for this purpose.
Figure 88: MQTT input node
This example uses the MQTT input node together with a Debug node to
receive data via MQTT and to display the data thereafter in the tab
Debug
of the Node-RED sidebar.
Prerequisite
1. A connection to the Edge Gateway is established (see section
web browser to establish a connection with the Edge
Gateway
2. The Node-RED workspace is open.
Step-by-step instructions
1. Inserting an MQTT input node:
Ø
Drag an
MQTT
input node from the node library and drop it in the
worksheet.
Ê
The red triangle the MQTT input node is displayed with indicates that
the node still needs some more parameters which you have to configure
in the following steps.
2. Showing the sidebar:
Ø
Show the sidebar using the keyboard shortcut
Ctrl+spacebar
or via
the Node-RED menu
View
>
Show Sidebar
.
Ø
Click the tab
Info
.
Ø
Click the
MQTT
input node to display its properties and a functional
description in the tab
Info
.
3. Editing the MQTT input node:
Ø
To open the edit dialog, double-click on the MQTT input node.
Ê
The edit dialog for entering the parameters will be displayed.
Edge Gateway | NIOT-E-TPI51-EN-RE (Connect)
DOC170502UM04EN | Revision 4 | English | 2018-08 | Released | Public
© Hilscher 2017 – 2018