MQTT won't connect between two networked devices

Hi All,

I need some help with Mqtt.

I have a RPI4B connected via a switch to an IFM AL1341. I can not get the broker to communicate with each other.
I have tested mqtt operation with localhost:1883 sending hello world.
RPI :192.168.1.150
IFM: 192.168.1.157

I have configured the mqtt in with 192.168.1.157:1883 and have not had any connection. in the flow I am pinging the IFM IO link block and recieve a packet so the network is working. Mqtt is confusing me with what is needed to get the communication going? I have a SA4100 connected to the IFM module reading Temperature.


Thanks in Advance

So the RasPi is the broker - yes?
192.168.1.150

Ok, so looking at the screen shot you have 4 nodes way at the top.
An inject node; an MQTT out node' an MQTT in node and a debug node.

Select them and export them and paste the code here.

Select - drag the mouse around/over them
Export - top right corner of the node-red edit screen the burger (3 bars) and select export
Copy to clip board
Paste here - sorry, I haven't got the words to explain how to do that.
But there is a button at the top of the window where you enter the text and it looks like:
</>
Click it, paste the code.

I hope that helps.

Oh P.S.

Actually this node may be of more interest as the other two are connected.

Export it and paste the code here.

I think, you have to search for the basics of MQTT.
You have installed the Broker at the Pi?

Brokers do not (generally) communicate with each other. MQTT clients communicate with a broker. This excellent tutorial will tell you what you need to know about MQTT MQTT Essentials - All Core Concepts Explained

1 Like

But it has been shown message sending has been established by the two nodes (4) at the top of the screen shot where a message is sent and received via MQTT.

There must* be only one broker.

All clients (node-red is a client, your device is a client) talk to ONE broker

That is the definition of a broker ( A broker is an intermediary between clients )

This thread might help you get it.




* there can of course be more than one broker but for what you are trying to achieve, there should only be one broker

2 Likes

Thank you @Steve-Mcl ,

I figured it out eventually. Im an Automation Engineer so in my mind the clients needed to be connected or reference each other somehow like a PLC and a Remote IO Node would interface with send receive messages.

Thanks

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.