SDM630/SDM120 modbus TCP installation procedure

Hi,

This is my first how-to on this forum. In this guide, I will explain how to get the SDM630 and Modbus TCP working with your system. I also use this same setup to interface the SDM630 with home assistant. Because it’s a TCP device it can do both at the same time.

Required Hardware:

  • SDM630 : Ensure you have the MID version. There are both MID and non-MID versions, but the MID version guarantees accuracy within a certain margin. The price difference is minimal, so the MID version is highly recommended. The SDM630 is manufactured by Eastron. They recently introduced the SDM630-TCP, which I recommend if you want to skip the need for a separate Modbus TCP device. However, I do not have direct experience with this model. The non-TCP version communicates using Modbus.
  • Modbus TCP Interface : This device converts RS485/Modbus communication into a network connection. I prefer Ethernet for stability. If I mention Modbus TCP, I mean an Ethernet connection to RS485/Modbus. There are also WiFi versions, but they are less reliable due to possible disruptions and delays. I used the HE11-H in my setup.

Required Software:

Installation Steps:

1. Install the SDM630

Go to your fuse box and install the SDM630. I won’t cover the exact wiring, but ensure that the device is installed correctly for its intended role. The SDM630 is a grid meter and should be placed directly after your main grid meter. If you use it as a PV meter, than place it at the PV system connection.

For the non-TCP version, connect the Modbus terminals A-, B+, and GND from the Modbus TCP device to the SDM630. (This step is not needed for the SDM630-TCP.). Make sure that if you use multiple SDM630 devices on the same Modbus, that all devices have a different slave address.

2. Network Configuration

Make sure your Cerbo GX is connected to your network. I highly recommend using an Ethernet connection instead of WiFi. Then, log in to your router and assign static IP addresses to both the Cerbo GX and the Modbus TCP/SDM630-TCP device.

3. Enable SSH Access on the Cerbo GX

  • Open the Remote Console of your MultiPlus system.
  • Navigate to Settings > General > Set root password and create a root password. (This is required to log in to the Cerbo GX.)

4. Download the Required Files

  • Go to: Victron Meter Library

  • Click “Code” and select “Download ZIP”. Or download this:
    EastronCerboGX.zip (11,7 KB)

  • Extract the .py files to a local folder, e.g., C:\Eastron.

  • Create a Backup folder inside this directory (C:\Eastron\Backup).

(Do not use older versions found on the forum, as they may not work with the latest Cerbo GX firmware.)

5. Transfer Files to the Cerbo GX

  • Open WinSCP and log in to the Cerbo GX using the static IP address you set earlier.
  • Use the root username and the password you created in the Remote Console.
  • Navigate to /opt/victronenergy/dbus-modbus-client/ on the right side (Cerbo GX filesystem).
  • On the left side (your PC), go to C:\Eastron\Backup.
  • Select all files in /opt/victronenergy/dbus-modbus-client/ (on the right) and copy them to your Backup folder (on the left).
  • Now, go back to C:\Eastron (on the left) and copy all .py files to /opt/victronenergy/dbus-modbus-client/ (on the right).

6. Modify the Python Script

  • In WinSCP, open (double click) /opt/victronenergy/dbus-modbus-client/dbus-modbus-client.py.
  • Locate the line: import carlo_gavazzi.
  • Insert this line directly below it : import Eastron_SDM630v2
  • Save and close the file.

7. Compile and Reboot

  • Open PuTTY.
  • Connect to the Cerbo GX using SSH (IP, root, and password).
  • Run the following commands one by one:
  • cd /opt/victronenergy/dbus-modbus-client/
  • python
  • import py_compile
  • py_compile.compile('dbus-modbus-client.py')
  • exit()
  • reboot

8. Configure the Cerbo GX

  • Open the Remote Console.
  • Go to Settings > Modbus TCP/UDP devices and enable Automatic Scanning.
  • The scan should detect the SDM630. If not:
    • Go to Saved Devices and manually add a device:
      • Type: TCP
      • IP Address : Modbus TCP device IP
      • Port: 502 (default)
      • Unit: 1 (default slave address)
    • If adding a second SDM630 (e.g., for a generator or PV inverter), assign a different slave address.

(For the SDM630-TCP, this step is not needed.)

9. Optimize Communication Speed

By default, Modbus runs at 9600 baud, which is too slow. Increase it to 38400 baud for better performance.

  • Change Baud Rate in the Modbus TCP device :

    • Open its web interface (usually http://modbusIP).
    • Set baud rate to 38400, 8,1, None.
    • Flow control: Half Duplex.
    • Protocol: Modbus.
  • Change Baud Rate in the SDM630 :

    • On the SDM630, press P and hold to enter the menu.
    • Enter the access code: 1000.
    • Set baud rate to 38400.
    • If using multiple SDM630 devices, ensure each has a unique address.

Confirming the Connection

  • Open the Remote Console.
  • If successful, the top text screen should display: “Eastron SDM630-Modbus v2”.

Troubleshooting

If a major firmware update (e.g., in January) causes issues, redo the steps from Enable SSH Access on the Cerbo GX, uploading the files, inserting the import line, and running the PuTTY procedure.

Final Notes

  • The Cerbo GX constantly polls the SDM630, meaning communication should be as fast and stable as possible.
  • If your connection is slow or unstable, double-check the Ethernet connection and baud rate settings.

I hope this guide helps! It would have saved me a lot of time.

Best regards,
Mark

Sources:

This Modbus method can also be used in a different way. The Wallbox Copper SB EV charger uses a Carlo Gavazzi/Wallbox EM340-MID energy meter, which is normally connected directly to the Wallbox via RS485. However, in my setup, I will use the HE11 device as a Modbus server, as described earlier.

Victron can communicate via Modbus TCP, and instead of the direct RS485 connection between the Wallbox and the Carlo Gavazzi meter, I will introduce a second Modbus client. This device will connect to the Wallbox via RS485 and communicate with the Modbus server over Ethernet or WiFi.

Since the EM340-MID is listed as a supported RS485 meter by Victron, this setup also allows Victron to integrate seamlessly with the meter. This makes it possible to share Modbus meters using Modbus TCP.

Had SDM120-modbus working a couple of years ago, but hasn’t worked lately. Now I thought I’d try to get this up and running again.
Running Venus 3.0 and have now tested the files from Victron Meter Liberary, but can’t get it to work.

Can read all the values ​​with modbus poll, so it looks like something is wrong with the python program, or I’m running an incompatible version of venus.

Getting these error messages:

*** starting dbus-modbus-client ***
Traceback (most recent call last):
File "/opt/victronenergy/dbus-modbus-client/dbus-modbus-client.py", line 24, in <module>
import Eastron_SDM120
File "/opt/victronenergy/dbus-modbus-client/Eastron_SDM120.py", line 6, in <module>
import Eastron_device as device
File "/opt/victronenergy/dbus-modbus-client/Eastron_device.py", line 54, in <module>
class CustomName(device.CustomName):
AttributeError: module 'device' has no attribute 'CustomName'

EDIT
Does not work on version 3.0. I have integrated so much extra into venusos that I hesitated to upgrade.
But after a lot of work I am now on V 3.54 and SDM120 works satisfactorily.

I use the latest firmware version and unfortunely I don’t have a SDM120 at the moment. Maybe I will order 1 this weekend on Aliexpress.
But for the SDM120 you have to add “import Eastron_SDM120” instead of “import Eastron_SDM630v2” to the file dbus-modbus-client.py

Hi Mark,

thanks for the great work you’ve put in. Do you have a link to this HE-11 TCP modbus device that you mention? I searched the entire internet for HE-11 TCP modbus, but I couldn’t find anything.