Hello,
I am just starting with Node-red and got to the point of not able to connect to MQTT broker
NODE_RED_VERSION :vv2.0.5
NODE_VERSION :14.17.3
HW:PI4b
Issue: MQTT node not connecting
Issue: 5 Aug 09:40:35 - [info] [mqtt-broker:mqtt broker] Connection failed to broker: mqtt://localhost:1883"
My storyline; I have started with simple IOT stack in Docker (default portainer-ce, node-red, mosquitto, influxDB, Grafana) .
I did testing on the Mosquitto;
- enter Mosquitto container via Terminal
$sudo docker exec -it mosquitto sh - set topic "test" for the broker
$ mosquitto_sub -d -t test
In second Terminal
- enter Mosquitto container via Terminal
$ sudo docker exec -it mosquitto sh - publish test message on topic "test" for the broker
$ mosquitto_pub -d -t test -m "How are you"
All worked and still working fine!
Second test was in Node-red - deploying simple flow is Mosquitto-in node -> Debug node. Initially I was able to connect to the Mosquitto broker (I have defined only one broker) . Then I have introduced user and pass. I was still able to connect, but this time with credentials.... all good.
Third test was with InfluxDB. At the point I introduce the InfluxDB node in the flow, my MQTT broker was not able to connect any more.
I have removed the InfluxDB node from the flow , but still not able to connect. I have re-installed the mosquitto container, and also the node-red container ... but no success with making connection with the broker.
Last try I did was to remove node-red container with the help of portainer-ce and get fresh (latest node-red image) from Node-red GIthub...
Node-red is starting properly ... Portainer is reporting healthy status .... but some how can't make connection with the mosquitto broker - when flow is deployed, the mosquitto node show disconnected.
Can you give me a hint how to get more verbose logs on what is happening when Node-red is trying to connect with the Mosquitto broker?
I am able to make the Mosquitto SUB & PUB test via terminal. Probably the issue is me not grasping good enough the Node-red concept.