Some nodes like the MQTT-in and MQTT-out nodes share configuration data.
The MQTT-in and MQTT-out nodes share the broker configuration. Settings like broker address, port, clean sessions,authentication are part of the configuration node.
The broker configuration doesn’t have its own configuration node visible on the flow, but is configured as part of the MQTT-IN and MQTT-OUT node.
This is illustrated in the schematic below:
You can view and edit the configuration nodes in the configuration sidebar.
You should notice that the number displayed to the right of the node is the total number of instances of that node in the workspace.
This is very useful for seeing if you have unused configuration nodes in the workspace.
In the screen shot above you can see that I have 2 configuration nodes called localhost that aren’t being used and so can be deleted.
There is also a useful filter in the top right which will display only unused nodes.
To delete or edit a configuration node then double click it and you will see something similar to the screen shot below (for the MQTT node)
Configuration Nodes and Flow Imports
Sometimes you may import a flow file and not have the necessary nodes installed.
So you delete the nodes from the flow as you don’t need them and so don’t want to install them.
However the flow fails to start and complains of missing nodes.
This is because there is a configuration node that is still present and so you will also need to delete that by going to the configuration sidebar.
Configuration Nodes Video
Related Tutorials and resources:
- Using the Node Red Status Node
- Node-Red HTTP Request Node for Beginners
- Using the Node-Red Function Node- Beginners Guide
- Using the Control UI Node With Flow Example
- Using the Node-Red Chart Node
- Node-Red Web Server -HTTP-IN and HTTP Response Nodes
- Using the Exec Node to Run External Commands
- Using the Node-Red Template Node
Is there any way to setup MQTT Broker connection via API? I can put the MQTT out node in flow but i have to access the MQTT out node’s configuration, where is Security tab etc.
If this is possible, I can create a script which installs modules & inserts a json flow with nodes. I hope you could help with this.
Not as I know. You could try creating it locally and copying the flow over but the security is stored in another file.
Can you describe in more detail what you need to do and I will give it some thought.
Hi Steve would you happen to know if one can already set default values of the MQTT brokers one wishes to connect to before Node-Red starts? Would it be possible to set broker addresses and ports into the MQTT config node so that when one drags either the MQTT In / Out node to the editor the values are available in the drop-down menu even if the user hasn’t configured them in any flow prior?
I don’t believe you can as the config for the nodes is part of the flow.