Connect two node-reds

Hi all!
Somebody knows how can I transmit the data that I'm receiving in one node red to the node red that I open in other computer?
I'm trying it with MQTT but I think that it's not the solution for what I need.

I would say that is ideal for what you need - why would you think not?

Check out this reply (and the thread) I wrote to someone not so long ago.

Because I'm trying it and I only achieved in the same node-red.

At the picutre below I had it in a node-red app of my gateway and at my computer node-red, I need to open a server like mosquitto or I can put directly the IP adress and port of the node-red that I want to receive the data?

Assuming that mosquitto is running in the first computer, then in the second computer for the config in mqtt node you have to specify the ip address of the first computer. So instead of localhost you put 192.168.1.123 or whatever is the ip address of the first computer.

[Edit] You don't need to run mosquitto in both of them, just one, and both node-reds connect to the same broker. It might help to understand how MQTT works if you work through this excellent guide https://www.hivemq.com/mqtt-essentials/

1 Like

Thanks Colin, I would try it when I can solve the problems to run mosquitto.

Alternatively, you can run a broker within one of the Node-RED instances by using the node-red-contrib-aedes node

For the sake of completeness, MQTT is only one of many ways to send/receive data between 2 Node-RED instances. Or indeed between Node-RED and any other service running on your device or on your network.

In rough order of descending order of ease of use (very rough):

  • MQTT
  • Websocket
  • HTTP
  • TCP
  • UDP
  • UNIX Pipes

Each has advantages and disadvantages.

Thinking about it, this has come up so often recently that a blog post is probably called for.

Thanks cymplecy I think that's an easy way to run it. I'm working on it but I'm not able to run it well.

Both MQTT in and MQTT out are configured at localhost:1883 server, and the aedes mqtt port and ws port are 1883 and 1880 respectively, but my payload doesn't arrive at my localhost nodered debug.

Thanks TotallyInformation I'll take a look on it, due to my future intentions with the data I'm focused on MQTT.

Remove the 1880 from the WS port as you don't need it at all

The MQTT node on the left 192.168.104.240 pi, needs to be configured with the 192.168.104.xxx address of the pi on the right before any messages can be sent across

Thank you very much, finally it runs ok.

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