Cerbo GX not recognizing EM540 (EM540DINAV23XS1PFD70) via Modbus RTU on Venus OS 3.65

Following setup:

Cerbo GX with firmware 3.65 (large, but normal was tested as well), or beta 3,72, connected via the Victron RS485 USB adapter and 5m Cat 5e extension cable to an EM540 via Modbus RTU (EM540DINAV23XS1PFD70).

The Energy meter serial shows up on the Cerbo under Settings → energy meters, but the device won’t show up under devices. Hence, no measurement data is displayed.

Cabling is not the issue. Connecting the USB adapter to my notebook the connection works and is stable - tested with Carlo Gavazzi UCS and ModCom Poll. Thus, Modbus RTU on the EM540 is working, data is read out.

The EM540 has the following settings for Modbus RTU as recommended by Victron: Address 1, 9600 baud, 8N1. I also tried with address 2 and 100 and with 19200 baud. No success.

Both EM540 and Cerbo GX were factory reset without any success.

Needless to say, if have been banging my head around this issue for days now.

ChatGPT5 is of the opinion that the EM540 driver is not included in the Venus OS releases mentioned above, and I am inclined to believe that. SSH into the Cerbo and the RS485 adapter shows up under /dev/ttyUSB0, but the modbus driver for the energy meter is NOT loaded.

Any help would be IMMENSELY appreciated.

root@einstein:~# cat /var/log/dbus-modbus-client.ttyUSB0/current | tai64nlocal | tail -n50
2025-09-11 11:06:40.852874500 INFO Scanning ttyUSB0 @ 38400 bps (quick)
2025-09-11 11:06:47.637282500 INFO Scan completed in 20 seconds
2025-09-11 11:07:13.914051500 /opt/victronenergy/serial-starter/run-service.sh: line 5: shift: 2: shift count out of range
2025-09-11 11:07:15.577964500 INFO dbus-modbus-client.py v1.71
2025-09-11 11:07:15.588624500 INFO Waiting for localsettings
2025-09-11 11:07:15.623934500 INFO Starting background scan
2025-09-11 11:07:15.626192500 INFO Scanning ttyUSB0 @ 115200 bps (quick)
2025-09-11 11:07:22.414923500 INFO Scanning ttyUSB0 @ 19200 bps (quick)
2025-09-11 11:07:29.199875500 INFO Scanning ttyUSB0 @ 38400 bps (quick)
2025-09-11 11:07:35.988336500 INFO Scan completed in 20 seconds
2025-09-11 11:08:02.250499500 /opt/victronenergy/serial-starter/run-service.sh: line 5: shift: 2: shift count out of range
2025-09-11 11:08:03.897552500 INFO dbus-modbus-client.py v1.71
2025-09-11 11:08:03.908063500 INFO Waiting for localsettings
2025-09-11 11:08:03.944812500 INFO Starting background scan
2025-09-11 11:08:03.947123500 INFO Scanning ttyUSB0 @ 115200 bps (quick)
2025-09-11 11:08:10.736974500 INFO Scanning ttyUSB0 @ 19200 bps (quick)
2025-09-11 11:08:17.520868500 INFO Scanning ttyUSB0 @ 38400 bps (quick)
2025-09-11 11:08:24.312283500 INFO Scan completed in 20 seconds
2025-09-11 11:08:50.577828500 /opt/victronenergy/serial-starter/run-service.sh: line 5: shift: 2: shift count out of range
2025-09-11 11:08:52.226130500 INFO dbus-modbus-client.py v1.71
2025-09-11 11:08:52.236995500 INFO Waiting for localsettings
2025-09-11 11:08:52.273999500 INFO Starting background scan
2025-09-11 11:08:52.276295500 INFO Scanning ttyUSB0 @ 115200 bps (quick)
2025-09-11 11:08:59.063915500 INFO Scanning ttyUSB0 @ 19200 bps (quick)
2025-09-11 11:09:05.849917500 INFO Scanning ttyUSB0 @ 38400 bps (quick)
2025-09-11 11:09:12.637281500 INFO Scan completed in 20 seconds
2025-09-11 11:09:38.911364500 /opt/victronenergy/serial-starter/run-service.sh: line 5: shift: 2: shift count out of range
2025-09-11 11:09:40.584116500 INFO dbus-modbus-client.py v1.71
2025-09-11 11:09:40.594341500 INFO Waiting for localsettings
2025-09-11 11:09:40.629887500 INFO Starting background scan
2025-09-11 11:09:40.631935500 INFO Scanning ttyUSB0 @ 115200 bps (quick)
2025-09-11 11:09:47.426055500 INFO Scanning ttyUSB0 @ 19200 bps (quick)
2025-09-11 11:09:54.220850500 INFO Scanning ttyUSB0 @ 38400 bps (quick)
2025-09-11 11:10:01.010293500 INFO Scan completed in 20 seconds
2025-09-11 11:10:27.252329500 /opt/victronenergy/serial-starter/run-service.sh: line 5: shift: 2: shift count out of range
2025-09-11 11:10:28.947540500 INFO dbus-modbus-client.py v1.71
2025-09-11 11:10:28.958869500 INFO Waiting for localsettings
2025-09-11 11:10:28.996788500 INFO Starting background scan
2025-09-11 11:10:28.998962500 INFO Scanning ttyUSB0 @ 115200 bps (quick)
2025-09-11 11:10:35.787942500 INFO Scanning ttyUSB0 @ 19200 bps (quick)
2025-09-11 11:10:42.571891500 INFO Scanning ttyUSB0 @ 38400 bps (quick)
2025-09-11 11:10:49.358596500 INFO Scan completed in 20 seconds
2025-09-11 11:11:15.650171500 /opt/victronenergy/serial-starter/run-service.sh: line 5: shift: 2: shift count out of range
2025-09-11 11:11:17.306302500 INFO dbus-modbus-client.py v1.71
2025-09-11 11:11:17.316042500 INFO Waiting for localsettings
2025-09-11 11:11:17.354277500 INFO Starting background scan
2025-09-11 11:11:17.356555500 INFO Scanning ttyUSB0 @ 115200 bps (quick)
2025-09-11 11:11:24.170571500 INFO Scanning ttyUSB0 @ 19200 bps (quick)
2025-09-11 11:11:30.994677500 INFO Scanning ttyUSB0 @ 38400 bps (quick)
2025-09-11 11:11:37.807317500 INFO Scan completed in 20 seconds
root@einstein:~#

What do you mean by ‘via Modbus RTU’?
I recently connected a new EM540 + USB RS485 to a new Cerbo GX and all worked out of the box without ever seeing or dealing with anything ‘modbus’.

Thank you Jan. Could you elaborate on the version/model ID of the EM540 you connected? How long was your cable, did you extend and/or terminate it anyhow?

Modbus RTU is the protocol family of RS485.

Please note the only EM540 part number supported shown in the table. The S1PFD70 is not supported, I believe it is revenue grade and locked down (a MID model) sorry.

Hi Rick, thanks for that. However please note that the “X” at the end is a placeholder for different Carlo Gavazzi models (see datasheet attached), and according to that info my submodel (MID certified with RS485 output) should be supported. It is definitely not locked, and the RS485 module is the same as in any other RS485 EM540.

However, that said, I am actually a bit suspicious that the Modbus registers transmitted over Serial differ a little bit from one submodel to another, and Venus fails to parse them correctly.

Or, another suspicion: Maybe the model is not recognized due to the different ending “PFD”…

Anyways, could you point me to the file where modbus RTU drivers for the EM540 have been implemented? Actually I only found references to EM24 on Venus modbus client, but never for EM540.

Thanks in advance!

Note that the EM540 supports X and PFC only in the notes on the page.

There is a product ID field that is probably being checked IIRC.

Here are some Carlo Gavazzi pdfs, the modbus comms are in the second one.

That X isn’t a placeholder IMO, because here is the EM530 I ordered from Mouser (non-MID, external CTs):

https://www.mouser.com/ProductDetail/Carlo-Gavazzi/EM530DINAV53XS1X?qs=Li%252BoUPsLEnvsCiUffIq%2FXA%3D%3D

And here is the EM540:

https://www.mouser.com/ProductDetail/Carlo-Gavazzi/EM540DINAV23XS1X?qs=Li%252BoUPsLEnsZx%252BLyg4b82w%3D%3D

By locked, I meant that certain settings are writeable only one-time, presumably by a power company or integrator.

I know for the EM530 that the CT ratio is only writable once on the MID models. But my memory isn’t great, be sure to read the manuals :-).

Great rick, I see you are right, X is not a submodel as I supposed from the other datasheets. However thanks a lot for the modbus comms, I will try to adapt the driver or read out the registers directly from modbus RTU. Thanks a lot that really helped!

1 Like

They’ve refactored that CGwacs code since the last time I looked at it a few years ago.

But see if you can find where they check for the model numbers (“Gavazzi Code”), it may be enough to just add a line.

There may be power interpretation differences with your model as well (like power factor), beware.

Thanks again! For home appliances here in central Europe we only measure - and pay - for active power, so the power factor is not really relevant. That’s different in industrial appliances, but there again we hardly measure with 50 amps direct meters…. :slight_smile:

1 Like