Did a 'full upgrade' and the heatpump SDM120 values are gone

Just did a full upgrade of my emonbase and the SDM120 modbus appears to have broken as a result.

Any ideas? I’ve rebooted the pi but still the same. Had a look at the config and it doesn’t appear to have changed but I expect the underlying code probably has.

2022-10-29 00:55:00,039 ERROR SDM120 Could not read all registers
2022-10-29 00:55:00,039 INFO SDM120 Connecting to Modbus device=/dev/serial/by-id/usb-1a86_USB2.0-Ser_-if00-port0 baud=9600 parity=none datatype=float

[EDIT] I’ve also switched off the power feed to the SDM120 in the consumer unit and restarted it but no joy.
[EDIT2] The config is as below and I don’t think it changed during the upgrade. Bottom line is the feed ground to a halt after the upgrade.

[[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_
        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

[Edited for legibility - Moderator (RW)]

For future reference, when posting code or output, please put 3 ‘backticks’ (normally found at the top left of the keyboard) on a line of their own before the code, and 3 more backticks also on a line of their own after the code:

```
code
```

If it is something like php you can add a language identifier after the first 3 backticks: ```php or even ```text if you don’t want any language markup applied.

@TrystanLea

There has been some work done on the interfacers, so it is possible this has broken something, but I cannot see any changes to the minimalmodbus interfacer.

Is emonhub set to log DEBUG?

Hello @greentangerine

We have upgraded this interfacer to support multiple meters on a single modbus connection and this has required a change in the config format. The following should work, I’ve changed the values to use the port and baud rate you pasted above:


[SDM120]]
    Type = EmonHubMinimalModbusInterfacer
    [[[init_settings]]]
        device = /dev/serial/by-id/usb-1a86_USB2.0-Ser_-if00-port0
        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

That is a pretty major breaking change. Could the interfacer not check for the [[[[meters]]]] line and if not there assume there is a single meter so it is backward compatible?

1 Like

This latest version is working well for me with 3 meters.

However having switched to the new Waveshare USB-RS485 unit, I’m getting Modbus connection issue. I’ve tried with two Pi’s now. Reverting back to the original OEM adaptor works fine. Are these plug-and-play or additional drivers needed?

2022-10-31 12:45:40,064 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-31 12:45:40,065 ERROR SDM120 Could not connect to Modbus device

1 Like

True we should have done that! Perhaps it would be still worthwhile to add that support in?

@glyn.hudson any ideas?

1 Like

Definitely before a whole load of systems break!