I have the latest npm node-red version, embedded into an express application. When I run node-red locally, or in a heroku instance , neither node-red instance mqtt-in connects. The node just is a constant disconnect. I have verified my mqtt settings with MQTT Explorer , and that connects with no issue. There are no errors on the console, or in the debug window console.
Look in the the log for the mqtt server to see if there is anything there.
Are you running mqtt explorer in the same machine as node red?
Where is your mqtt server?
Mqtt Explorer is on the same machine as code red. I do not have access to the backend of the remote mqtt broker, but shouldn't the mqtt-in red bubble, at least turn yellow for connecting? It just seems it's not working.
Mike
Show us the settings you use in mqtt explorer and in the mqtt node.
Also which version of node.js are you using? Run node -v in a terminal to find out.
i use server 176.31..., raspberry , dht sensor and led i want to use MQTT to show the value of temperature and humidity in dashborad of node red and the server is 176.31.... not localhost
What I understand is:
You have a local raspberry pi and you want to use MQTT to send data to a remote Node-RED.
MQTT work by your pi publishing to a broker and Node-RED subscribing.
So you need to find a broker that your pi and Node-RED can see.
You have been given two options.
Either use someone else’s broker or install your own. Both you have said no to, but without saying why. Both would work in the situation as I understand it.
If my understanding is wrong you need to explain why.
If the understanding is correct you need to explain why the two solutions are not acceptable to you
thank you for help , your indrestanding is correct , i use the local raspberry and i want to use the MQTT to send data to a remote NODE -RED i use the test.mosquitto.org and the mqtt.eclipse.org port 1883 it works but if want to use the 176.31.21...broker the mqtt node disconnected , i can't use the cloudMQTT because in this project i should use the NODE RED
CloudMQTT and Node-RED are completely different things. CloudMQTT is a cloud-hosted MQTT broker service that you could use as a broker that both of your raspberryPis (running Node-RED) can see and connect to.
Can you clarify what you mean by the 176...broker? Do you mean you have installed an MQTT broker (such as mosquitto) on one of your devices?