I am running a cerbo (v3.72 and v3.80~9 tested) with serial-battery and Node-Red instance.
My idea was to fetsh data from an energy meter (EM540) over Modbus TCP (using an waveshare gateway). I whant to use the ethernet infrastructure and in this setup several clients can request data from the energy meter, such as my home automation system.
So far so good.
The Modbus TCP communication is working fine my home automation is logging the energy data and by using the Modbus library in Node-Red i can request data from the energy meter.
But as soon as i send a Modbus TCP request to my energy meter (via the waveshare gateway) my grid meter stops fetching data. The grid meter is connected directly via USB to Modbus RTU adapter to my cerbo.
Wtf is going on here?
I thought maybe the Modbus library is buggy, so i send a bare TCP buffer string, also in Node-Red. The same!
Yes, both energy meters are the same, EM540. But why does the ethernet connection effects the serial communication?
Does any one observe a similar issue?
What I still wanna try as a work around:
- Change the standard TCP port
- Set to a different Modbus-ID
There is still something strange, if I send the same request to a different Modbus device in the network the reply does not effect the Modbus-RTU communication. For sure the reply is different, but for me it does not make sense.
Presumably, you mean the EM540 Carlo Gavazzi Energy Meter.
(1) Is the Waveshare configured to translate Modbus-TCP to Modbus-RTU?
(2) It sounds like you have two masters on the Modbus-RTU side, the Cerbo, and the Waveshare, is that correct?
(3) If so, they will conflict with each other without some sort of arbitration scheme. Because RS-485 is half duplex, you can’t have two devices initiating communication.
(4) If not, please explain the wiring in more detail.
Disclosure: I have two EM530 energy meters using Waveshare without RTU translation and some custom software on my Cerbo to talk to them as if they were local RTU devices.
(1) Yes the Waveshare is set up as one-by-one Modbus-TCP to Modbus-RTU gateway an is working fine.
(2) No, i have two EM540, one as grid meter connected via USB-Modbus-RTU-adapter and a second as AC-Meter connected via Waveshare to ethernet.
(3) This is clear for me.
(4) Maybe this chart makes the setup more clear.
flowchart LR
A([Cerbo]) <-->|USB| B([USB to ModbusRTU])
B <-->|RS485| C([GridMeter])
A <-->|Ethernet| D([WS-Gateway])
D <-->|RS485| E([AC-Meter])
OK, now I understand, thanks.
Yes, the two shouldn’t have any effect on each other, that doesn’t make any sense to me either.
I’ll have to look at NodeRED to see if they are making an assumption about energy meters.
I assume you’ve defined a Virtual Grid Meter device in NodeRED and connected it to the Waveshare. See what happens if you change the virtual device to an “AC Load” instead.
I suspect somewhere there is an assumption that there can only be one grid meter in a system.
Yes, the idea is to feed Modbus-TCP data to an virtual device. In my case to a virtual EV-charger. But I completely deactivated the virtual device for testing with no effect.
I used a single TCP-request and the serial communication stopped.
Oh, no!
Rick you are right! I massed up my connections. I was requesting always the same energy meter, over two different paths.
I sorted out my connections and all is working as expected.
it looked more like this:
flowchart LR
A([Cerbo]) <-->|USB| B([USB to ModbusRTU])
B <-->|RS485| C([GridMeter])
A <-->|Ethernet| D([WS-Gateway])
D <--->|RS485| E([AC-Meter])
D x--x|RS485| C
Thanks!
1 Like