Best practice with several devices

Hey there,
I am a complete newbie so please allow some questions that may appear stupid to the pros.

I have a Homematic CCU3 based on a Pi 3B+(let´s name that PI "CCU").
Then I have a Victron Venus OS that runs on a separate PI 3B+ (let´s name this PI ("Venus").
On CCU and Venus a Node Red Instance is installed.
Finally there is a Siemens Logo SPS that is also in my network that can act as modbus server or modbus client.

What I want to do:
a) The Venus shall read and set some variables in the Logo SPS via modbus.
b) The CCU shall read and set some variables in the Logo SPS via modbus.
c) Some data of the Venus shall be used in the CCU

So now...what is the best practice to do so?

a) and b) should be quite simple as the NR instances on the 2 PIs can act as modbus client and access the data independently right ?

c) is now the big deal:
On the Venus the instance of the NR has a node that allows access to the Venus OS data, so no big deal. But is it possible to install that node also on the CCU so that 2 nodes on 2 different NR instances on separate hardware access the same device?
(sorry that seems to be one of the first stupid questions :wink: ).

Any help is highly appreciated.

Thanks
Sven

Welcome to the forum @SvenT

The easiest way of communicating between two devices such a Pis is generally considered to be to use MQTT. It is very easy to install Mosquitto on a Pi and then the Venus can publish the data to Mosquitto and the second Pi can connect to that broker and pick up the data. To learn more about MQTT then see this tutorial MQTT Essentials - All Core Concepts explained

Hey Colin,
thanks for the information with the MQTT.

May I ask if there is another solution?
Maybe I left some details:

On the "Venus" there is the Node Red instance.
This instance is installed on the Venus OS that makes the GUI and communication with Victron energy devices such as solar charges, supercisors or inverters,
There is a Node that allows the access on the data of the Victron energy devices (such as voltage, current, load and so on).

So my question is:
Can I install a node on different instances of Node Red and access the same device from both instances?

Sorry but as mentioned I am a complete newbie and honestly spoken I do not know wheter it is allowed to access the same target from different node red instances.

S

You can. But as long as 1 of the devices can be used to install Mosquitto (MQTT broker), you not only don't need to but would be better off not doing Pi-to-Pi direct comms since that is relatively fragile. MQTT is designed for that kind of thing and Mosquitto is a very lightweight broker that takes little resources but can handle high volumes of messages if needed.

You only need a single broker since all 3 devices will be able to talk to it. Probably not point in trying to create a resilient broker service since you potentially already have 3 single points of failure.

Hey thanks a lot for the help.

So I take the following 2 points nto consideration:

  • for comm PI2PI I use Mosquitto to act as a MQTT broker
  • 2 instances of NR can have the same node installed and access it if necessary

The last point might be helpful if 2 instances want to write/read data in 2 separate variables of the CCU.

That depends on what the node is doing. If it is talking to a device connected directly into P1 via USB or GPIO pins for example then P2 will not be able to talk to the device as it is not connected to it.