SDM120 rebooting continuously over modbus

I wondered if anyone else was experiencing the following phenomenon with SDM120 or other eastron meters over modbus:

Half of my meters on the same network appear to be cycling continuously whenever the USB adaptor is connected. I have tried with two emonPI’s so seems local to the meter. All meters appear to be running the same firmware version. Unplugging the OEM adaptor and the meters resume normal behaviour.

Besides that, emonCMS is accepting data nicely from all meters using the MinimalModbus interfacer and OEM’s modbus adaptor. So not a problem per se but doesn’t seem right with meters continuously rebooting (assuming they are).

Nothing from Eastron support yet, and wondered if others had experienced the same or had thoughts on the root cause - or a batch issue…

Video below

Hi Ben, I’ve not seen this before. I notice that you have the Modbus GND connected on only one of the meters, it may be a good idea to try connecting Modbus GND on all the meters. Ideally this should also be connected to the Pi GND (negative) but this is not easy to do using the old OEM modbus reader that I think you have.

We no longer stock this modbus reader since we found it to be a bit hit-and-miss reading from several modbus meters over a long cable run. The industrial grade modbus reader we currently stock seems to be more reliable:

2 Likes

Thank Glyn, I’ll give both a go.

I assume the new adaptor would tie ground back to the Pi?

Yeah, I had this. Swap/flip the two wires over at only one end. (SDM or UBS)
It seems the wires can only go one way from USB adaptor to the SDM120.

If you get them the wrong way the SD120 just constantly reboots.

2 Likes

Yes, correct.

However, maybe try @Zarch suggestion first. But it’s strange that you say that you’re able to read data from the SDMs? I would have presumed if the modbus wires were the wrong way round you would not be able to read any data?

Thanks both, i believe they’re wired correctly. I reversed the wiring and found the meters began behaving even more erratically and stopped reporting entirely.

Thanks @glyn.hudson I actually have same Waveshare adaptor but after trying, emonhub is reporting a connection failure to the modbus device. The original OEM unit I have was plug and play. Is another driver required do you know or something else to reference in the interface?

I am using the following

[[SDM120]]
    Type = EmonHubMinimalModbusInterfacer
    [[[init_settings]]]
        device = /dev/serial/by-id/usb-1a86_USB2.0-Ser_-if00-port0
        baud = 9600
    [[[runtimesettings]]]
        pubchannels = ToEmonCMS,
        read_interval = 10
        nodename = sdm120
        # prefix = sdm_
        [[[[meters]]]]
            [[[[[sdm120]]]]]
                address = 1
                registers = 0,6,12,18,30,70,72,74,76
                names = V,I,P,VA,PF,FR,EI,EE,RI
                precision = 2,3,1,1,3,3,3,3,3

Following log from two Pi’s I’ve tried this with:

2022-10-28 21:35:30,094 INFO SDM120 Connecting to Modbus device=/dev/serial/by-id/usb-1a86_USB2.0-Ser_-if00-port0 baud=9600 parity=none datatype=float

2022-10-28 21:35:30,095 ERROR SDM120 Could not connect to Modbus device

A bit out of ideas, so here’s my config if it helps.

I’m both the SDM120 and USB device supplied by the store plugged into a Pi3 also running a heatpump HAT.


[[SDM120]]
    Type = EmonHubMinimalModbusInterfacer
    [[[init_settings]]]
        device = /dev/ttyUSB0
        baud = 2400
    [[[runtimesettings]]]
        pubchannels = ToEmonCMS,
        read_interval = 10
        nodename = ashp_sdm120
        # prefix = sdm_
        addresses = 1
        registers = 0,6,12,18,30,70,72,74,76
        names = V,I,P,VA,PF,FR,EI,EE,RI
        precision = 2,3,1,1,3,3,3,3,3
1 Like

Note, if you update emoncms, this config will no longer work.

2 Likes

Are you sure this is the correct ID for your device? /dev/serial/by-id/usb-1a86_USB2.0-Ser_-if00-port0. If you’re only using a single USB device it’s easier to use /dev/ttyUSB0:

[SDM120]]
    Type = EmonHubMinimalModbusInterfacer
    [[[init_settings]]]
        device = /dev/ttyUSB0
        baud = 9600
        parity = none
        datatype = float
    [[[runtimesettings]]]
        pubchannels = ToEmonCMS,
        read_interval = 10
        nodename = modbus
        [[[[meters]]]]
            [[[[[sdm120]]]]]
                address = 1
                registers = 0,6,12,18,30,70,72,74,76
                names = V,I,P,VA,PF,FR,EI,EE,RI
                precision = 2,3,1,1,3,3,3,3,3

Thanks, Glyn, I will give this a whirl, although I am also using OEM’s Mbus adaptor for the heat meter.

Is this recommended ID for the new Modbus adaptor in your store?

Try doing a directory listing of

/dev/serial/by-id/

By default the modbus ID of the SDM120 is ‘1’ . However, the USB ID is unique and will be different for every adaptor. If you’ve only got a single USB device connected then it’s fine (and much easier) just to use ‘/dev/ttyUSB0’ .

I have 5 meters running, each with their own ID numbers, 1,2,3,4,5 and all is working well without fault all off one USB to RS485 adapter.

My EmonHub config

[[SDM120]]
    Type = EmonHubMinimalModbusInterfacer
    [[[init_settings]]]
        device = /dev/ttyUSB0
        baud = 2400
    [[[runtimesettings]]]
        pubchannels = ToEmonCMS,
        read_interval = 10
        nodename = sdm120
        # prefix = sdm_
        [[[[meters]]]]
            [[[[[sdm120a]]]]]
                address = 1
                registers = 0,6,12,18,30,70,72,74,76,78,342,344
                names = V,I,P,VA,PF,FR,EI,EE,RI,ER,TA,TR
                precision = 2,3,1,1,3,3,3,3,3,3,3,3
            [[[[[sdm120b]]]]]
                address = 2
                registers = 0,6,12,18,30,70,72,74,76
                names = V,I,P,VA,PF,FR,EI,EE,RI
                precision = 2,3,1,1,3,3,3,3,3
             [[[[[West]]]]]
                address = 3
                registers = 0,6,12,18,30,70,72,74,76
                names = V,I,P,VA,PF,FR,EI,EE,RI
                precision = 2,3,1,1,3,3,3,3,3
              [[[[[East]]]]]
                address =4
                registers = 0,6,12,18,30,70,72,74,76
                names = V,I,P,VA,PF,FR,EI,EE,RI
                precision = 2,3,1,1,3,3,3,3,3
              [[[[[NorthWest]]]]]
                address = 5
                registers = 0,6,12,18,30,70,72,74,76
                names = V,I,P,VA,PF,FR,EI,EE,RI
                precision = 2,3,1,1,3,3,3,3,3
1 Like

My USB to serial is one of these, only 2 wires’, and I don’t use any termination resistors

I have the same adapter. I found WEIRD issues - like the data was always corrupted.
Added a 150 ohm termination resistor and it reads fine now.
my resistor is at the usb device end as it was easier!

1 Like