MQTT-In Not Connecting

Hi All,

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.

What could be wrong?

Mike

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?

Hi Colin,

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

The same thing is happening with test.mosquitto.org as the mqtt server. ....

actually mosquitto.org works, so probably some settings in mqtt

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 got it working, it was wrong settings on the topic and user name , sorry for wasting your time and thank you very much for your help!

find a cloud mqtt service such as https://www.cloudmqtt.com/

or install your own mosquitto broker on your server

or you can run your own broker within Node-RED itself https://flows.nodered.org/node/node-red-contrib-mqtt-broker

thanks for help but I use node red with remote server 176.31 .... not cloudMQTT

thank you for help but i installed the mqtt broker but i want to use the server 176.31.... not localhost

Can you install mosquitto on 176.31....

how ??? if you want i sent you the flow in node red
i use raspberry also

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

To try understand what you are trying to do.

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?

@knolleary
the 176.31...is the broker that i have installed (such as mosquitto) on my device

Are the two devices on the same local network?

@knolleary the two devices are the raspberry connected in my local network and the other device is the remote NODE-RED