Page 1 of 1

Modbus RTU Master from RevPi Connect using Node-red

Posted: 08 Nov 2021, 06:45
by stgj
Hi,
First post here.

As the title goes, I am trying to connect the RevPi Connect to an eTactica powerBar.
https://etactica.com/wp-content/uploads ... Manual.pdf

I have connected the wiring almost like this:
https://revolutionpi.com/tutorials/uebe ... n-connect/
Almost meaning: the GND of the powerbar is connected to the 0V of the power supply. This is the only way for the powerbar to power up.
I have tried other wiring to, see further down.

Then I have downloaded the Modbus contrib packages on Node-red:
https://www.npmjs.com/package/node-red-contrib-modbus
I use the modbus read and modbus flex-getter for testing.
In the Node-red modbus read node, when configuring the modbus server, I can choose between /dev/ttyS0, /dev/ttyAMA0, /dev/ttyUSB0 and /dev/ttyUSB1.
I can't choose /dev/ttyRS485. Of course I can write it out, so I presume that OK. When logged in to the RevPi I list out the content of the /dev directory and see the ttyRS485 as a link pointing to USB0.
That means I can also use /dev/ttyUSB0? And what USB is the USB0 on the RevPi Connect? The micro?

I have successfully done this through Modbus TCP at work with a raspberry pi connected to a router with an Adam TCP/rs485 modbus converter.
I was hoping that it would be as easy as switching from TCP to serial in the Node-red Modbus read node, on the RevPi Connect.
And yes I have double, triple, quadruple checked modbus id, address, quantities, function method, baudrate, stop bits, data bits and parity. They should be in order.

I can see on the LED of the powerbar that it doesn't receive any requests.
And the Node-red modbus read node spits out - Error: Data length error, expected 9 got 1

I have also tried to enable the Modbus Master in piCtory. Still nothing.
I have also dragged the Modbus RTU Master to the config.
It is using /dev/ttyRS485
Entered extended data with appropriate parameter. I have saved as load config and reset driver.
I have enabled the Node-red with revpi server in the "Service" tab on startup screen.
And used the "single pin" node. Choosing the Input_Word_1 as in the extended config.
Stil the powerbar does not indicate any requests from a master, and noe data is coming through.
One question here. Do I need the Modbus RTU master virtual module? Is it not enough with Node-red powered with modbus?

I have also tried to wire 0V and the third pin from bottom on the rs485 connection on the RevPi Connect together. Nothing.
Also tried to connect the fourth (functional eart you call it?) and the third together. Nothing.

The only way to trigger a request on the powerbar is to switch A and B. The A on the powerbar to the N(second from bottom) on the rs485 connection on the Connect.
And B on the P(first from bottom).
Then the powerbar indicates requests from the master. Also then something happens in Node-red. There are stil errormessages and a CRC-error. So I assume this is just noise.

Any help would be preciated.

Best regards
Steffen

Re: Modbus RTU Master from RevPi Connect using Node-red

Posted: 12 Nov 2021, 10:44
by Salma Benamor
Hello Steffen,

take a look here, you can't use both Modbus implementations at the same time. This means Node-Red and PiCtory.

https://kunbus-gmbh.atlassian.net/servi ... 1008496273

Best regards.

Re: Modbus RTU Master from RevPi Connect using Node-red

Posted: 22 Nov 2021, 20:03
by stgj
I have not had any time to respond until now.

Hi Salma.

I guessed that you must use just one of them. I was not able to make the Node-red work, so I tried the virtual Modbus Master solution. That one also alone.
I'm now able to make it work. Read further down.

Comparing this
https://revolutionpi.com/tutorials/uebe ... n-connect/
with this
https://revolutionpi.com/tutorials/seri ... n-compact/
I see that the A and B is switched on the N and P. What does N and P stand for?
After using the Compact way on my Connect I was able to make it work, with some googling.
If this is not some strange glitch on my Connect, the image of the Connect is probably wrong? And the Compact way is the correct way?

Also:
In Node-red, changing Serial-type from RTU to RTU-BUFFERED made most of the errors go away.
https://github.com/BiancoRoyal/node-red ... issues/101

The last thing was the load I was measuring. I measured my 24V power supply. The the load is not easy for the measuring device to measure.
When I measured a more clean resistant load, like a heating element, I got a much more stable reading.

So the conclusion was to use the Compact way of wiring the RS485, coupled with RTU-BUFFERED in the Node-red configuration, and measuring a clean load, it works nicely.

Best Regards
Steffen

Re: Modbus RTU Master from RevPi Connect using Node-red

Posted: 06 Dec 2021, 14:58
by stgj
Any thoughts on the difference between the "connect" and "compact" regarding the RS485 wiring?
https://revolutionpi.com/tutorials/seri ... n-compact/
https://revolutionpi.com/tutorials/uebe ... n-connect/

Regards
Steffen

Re: Modbus RTU Master from RevPi Connect using Node-red

Posted: 24 Jan 2022, 12:08
by Salma Benamor
Hi Steffen,

RS-485 is available in both products so there is no difference in the handling.
Please enter to the checklist link and follow the steps:

https://kunbus-gmbh.atlassian.net/servi ... =558188836

Best regards.