I'm not understanding what I'm doing wrong. I have one Raspberry Pi as my broker. My other Raspberry Pi isn't receiving anything on its side.
What I did first was test the connection on the localhost on one Pi and that is working well.
But what I did was change both the MQTT In and MQTT out nodes to the IP address of my second Raspberry Pi that is connected away from my first one. I'm getting nothing. I also matched the Topic name on each, the broker is running on the second pi, and NodeRed is running on both, but I'm using the node only on the first Pi and not the second. What am I doing wrong?
I used "hostname -I" to find the IP address of my Pi-A (142.#.#.#)
I used the same thing on Pi-B and got a different IP address (142.#.##.#)
I attached some pictures of what I used for MQTT-Out on Pi-A.
I attached another picture of what I used for MQTT-In on Pi-B. I am running my MQTT broker on that Pi, and I'm thinking that may be wrong. But ultimately, on Pi-B, for topic I used "message" for the MQTT node and then I did the same for Pi-A on a different monitor with another node. I then used the IP address from Pi-B and assigned it to both MQTT nodes on the different monitors. I'm pressing send, and nothing is sending.
I'm away from my lab, but I think because one Pi is a Pi3B+, I had to download a previous version of Node Red to make it work. I believe that I am running a newer version of Node Red on my Pi 4.
I made sure to change the config file to allow anonymous true, listener 1883 and I think another listener for the second Pi's IP address as well. I thought that might've been the cause of my problems, but the config file looked right to me.
Okay just to make sure. So after updating or retrying with the possible version problem, on Pi-A, I run the MQTT broker only on that. Then for each node on the different Raspberry Pi, I use the IP address of Pi-A that is running the broker on each MQTT node on both Pi.
to jump in here. Yes, the Pi that has the broker setup is the IP for the other Pi. On the Pi that has the broker you did set up the MQTT node by assigning an id to it. I usually use 127.0.0.1 but you can also use the device IP as well. The other Pi the MQTT node setup uses the brokers IP of 142.x.x.x
[edit] it's possible there might be some type of port blocking as well, I think everything is on the table at this point
So to just to go through each step so I can understand, if I'm trying to send a variable from Pi-A to Pi-B with Pi-B running MQTT broker that is receiving information, I complete this node below on Pi-B with the IP Address on the node assigning to the IP address of Pi-B.
I then implement the node below on Pi-A, which wants to send information to Pi-B, and I assign that node's IP address to the IP address of Pi-B
And this is with matching the topics together, ensuring that everything is updated, and if I can ping an IP address.
@gerry@zenofmud Also thank you for your help, I'll try all of this within the hour. I was trying extremely hard and I think I was confusing myself with something simple.
just as a note: if you put an # (pound sign) in the receive topic it will show all the messages regardless of topic, this will let you check to see if there is a topic issue.
@zenofmud@dceejay@gerry hello again, I'm still trying to get my MQTT to work, but on my second screen, I still can't get a response or connection on my second Pi. I have my first Pi sending a message to itself, but my second pi is still connecting.
My server for the first Pi with Node Red and MQTT broker running on it is 172.25.#.#(port number) which is what I put into my other Pi. I checked the Ping via the command line and it looks to be working.