Closed hobbyquaker closed 5 years ago
This seems like the same client ID is being used for each connection.
This seems like the same client ID is being used for each connection.
Yes, as you say in the node-red-contrib the MQTT clientId is defined as:
clientId: node.username,
Configuring multiple config nodes (either on the same, or different Node-RED instances) will cause continuous reconnects across the config nodes.
@hobbyquaker what's your use case for enabling multiple Node-RED instances to connect?
On each Hardware Interface I'm using I run a single Node-RED instance. E.g. there is a Pi that has a CC2531 USB Stick and connects all Zigbee Devices. Another Pi has an RPI-RF-MOD Header that communicates with Homematic-IP Devices. A third Pi has an Infrared Transceiver and controls some TV/Hifi stuff. All of them have their own Node-RED instance. They can communicate over MQTT - but to minimize SPOFs and let them be able to work standalone without Alexa outages it would be convenient for me to be able to connect to your service from all of them.
I've published Node-RED contrib 0.4.50 which generates a unique MQTT clientId. You can update your instance(s) and confirm functionality.
Please re-open if testing new nodes show issue.
When using multiple instances of Node-RED with node-red-alexa-home-skill-v3-web the connection to the MQTT broker is only possible from one instance at a time. As soon as the second connects the first one is disconnected, then the first one reconnects and the second is disconnected and so on. Is it possible to change that behavior? I don't now if it just depends on the MQTT username or the client-id or if it depends on the broker config?