Hello,
End goal is to be able to setup "MQTT Out" credentials via ENV_Variables
First, I'm trying to inject credentials via nodes.
Tried to follow @Steve-Mcl guide:
Notes I have from broker side:
-
Broker setup from IT side allows nodered only to publish messages. If I try to subscribe with the same credentials, I get disconnected immediately. I delete "MQTT In" node and "MQTT Out" node recovers to "Connected" state.
-
MQTT out works when the same credentials are inserted into the node statically.
As far as I understand option "Dynamic subscription" is only for "MQTT In" node and it doesn't transfer to MQTT out node.
Flow:
[{"id":"6a114e1f2c1941c4","type":"inject","z":"17544288b1b6c2c1","name":"inject","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":610,"y":2240,"wires":[["285ee8faf1b91503"]]},{"id":"285ee8faf1b91503","type":"change","z":"17544288b1b6c2c1","name":"dynamic setup","rules":[{"t":"set","p":"action","pt":"msg","to":"connect","tot":"str"},{"t":"set","p":"broker","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"broker.password","pt":"msg","to":"psw","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"data/e2e_pipeline/nodered","tot":"str"},{"t":"set","p":"broker.username","pt":"msg","to":"user","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":760,"y":2240,"wires":[["79526e7c26285d53"]]},{"id":"79526e7c26285d53","type":"mqtt out","z":"17544288b1b6c2c1","name":"","topic":"","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"9cdd6c4e996aa6eb","x":910,"y":2240,"wires":[]},{"id":"9cdd6c4e996aa6eb","type":"mqtt-broker","name":"test","broker":"192.168.246.2","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"6","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closeRetain":"false","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willRetain":"false","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""}]