MQTT-In Not Connecting

You need a broker that the remote Node-RED can connect to.

I’m guessing that the remote Node-RED can not connect to your local broker.

So you need to find one that it can attach to.
There are several internet MQTT brokers you can use that you should be able to find with an internet search.

is 176.31.21. the external ip address of the local network your raspberry are on?

@cymplecy no the 176.31... is the broker of node red that i have to use to connect node red with raspberry

@knolleary i don't have two device in same local network i have just my raspberry in my local network but the node red is in an other place so i should using the mqtt

You have Node-RED running on a server that has an ip address starting 176.31

You want to send information from your local raspberry via MQTT to Node-RED on this server.

Yes?

@cymplecy yes it's right i want to send data from my local raspbery via MQTT to remote node rd on this server 176.31...

You send the data to a MQTT broker

Your Node-RED server then gets the data from a MQTT broker

You need a broker that both machines can see

i use the mqtt.eclipse.org and i use also the test.mosquitto.org it's work but when i want to use the 176.31... my broker, the result is disconnect

Then either your broker isn’t installed properly or configured properly or your machine sending the data can’t see it properly.

Try looking to see if you can see the data using another MQTT tool. Look to see if there are any errors being sent back to the machine sending the data.

Have you installed mosquitto on 176.31.. ?

If you have not then try to do so

If you cannot install it - try installing node-red-contrib-mqtt-broker flows.nodered.org/node/node-red-contrib-mqtt-broker

Does this have appropriate security for a device that is exposed to the internet????

Same level of security as using mosquitto

Really? https://github.com/zuhito/node-red-contrib-mqtt-broker/issues/23

That seems to reference an issue that was subsequently fixed (unless I'm missing something)

But, the OP is really struggling to even get going - I think differences between security of one broker over another one comes later in the conversation

The published version is 1year 8months old

That issue dates from 3 months ago. Whilst there is a possible fix in a pull request it is not yet merged and published.

Security afterwards is not a sensible solution, it needs to be thought of before you do something not afterwards

in this case, it is.

The OP can't speak English well and can''t connect at all at the moment.

If we manage to get them connected, then we can recommend how to secure it :slight_smile:

Hi @mirou_IoT - I'm trying hard to understand exactly what you have got, but I'm still slightly confused.

  • you have a raspberry pi on your local network
  • "node-red is in another place" - what do you mean? What is it running on? A different device on a different network? Can your local raspberrypi access the network your other device is running on?

If the machine running node-red is not on the public internet then your raspberry pi is not going to be able to connect to it.

As other people have said, you need an MQTT broker somewhere that both your local device and the machine running node-red can access. This is why it works with mqtt.eclipse.org - because that is on the public internet.

I think we've got this far with determining their setup

Check with MQTT Explorer that you can access the broker, then you will know whether it is a problem with access to the broker or with node-red.

Yes, but that doesn't answer my questions about the basic layout of devices and what can see what.