Modbus RTU Master from RevPi Connect using Node-red
Posted: 08 Nov 2021, 06:45
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
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