Unreliable SDM120 or Unreliable USB RS485

I’ve just started my journey into RS485/SDM120 /Modbus. I’ve got a 6 year old eMonPi/3x emonTx/2x emonTH and a bunch of other integrations. All work great.

I’ve installed 2x SDM120 and I can get data out of them via a USB RS485 for a period of time. However, two days in and I’ve had to reboot the emonPi 5 times as the feed just stops working.

The error in emonHub is

2023-07-19 13:27:30,093 ERROR    SDM120     Not connected to modbus device
2023-07-19 13:27:30,094 INFO     SDM120     Connecting to Modbus device=/dev/ttyUSB0 baud=9600 parity=none datatype=float
2023-07-19 13:27:30,094 ERROR    SDM120     Could not connect to Modbus device

Resetting USB don’t help. Restarting eMonHub doesn’t help. Only a reboot gets the feed running again.
Once rebooted, data comes in again for an unknown amount of time until it stops again.

I don’t think it is the wiring, however they are wired in series like this


The USB RS485 has a ground pin, there wasn’t any documentation on what do with that so I’ve left it.

I am wondering if the baud rate is the issue, the docs show a 2400 baud rate, however the SDM120 defaulted to 9600, so I changed the emonhub config to match.

Has anyone else experienced this? Or have any suggestions on improving reliability? (Without changing back to CTs :slight_smile: )

I suspect you’ve bought the cheapest RS485/USB adapter because “they’re all the same”.
Been there, done that.

Maybe buy a better quality (read more expensive) adapter.
I bought this one - https://www.amazon.co.uk/gp/product/B083XSG1RG
which was recommended by the Sofar inverter comms project as being very reliable.
For me it’s been very solid 24/7 for nearly two years now, but did cost £20.

You should connect the GND pin to the RS485 GND on the SDM120. What RS485 reader are you using? I’ve found some cheaper readers to be unreliable, this reader is very reliable:

1 Like

This is my setting in EmonHub, works like a dream, I am running 5 x SMD120s, I don’t use any ground

    Type = EmonHubMinimalModbusInterfacer
        device = /dev/ttyUSB0
        baud = 2400
        pubchannels = ToEmonCMS,
        read_interval = 10
        nodename = sdm120
        # prefix = sdm_
                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
                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
                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
                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
                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

Nice setup! Using a GND connection is not always needed, especially if the wiring runs are short, but it’s good practice to always connect the GND connection to minimise noise and interference on the databus.

1 Like

Paying attention to the docs and changing the baud rate down to 2400 helped a little.

The RS485 was gifted to me by a friend, it’s visually identical to the one in your store - no guarantees it is the same inside though.

I’ll sort the ground out, it’s easy enough to do.

I’ll order a different RS485 adaptor too.

How long is your flex? What are you running the communication wires next to? Are you using termination resistors?

Modbus flex is meant to be shielded.

I am using a MOXA modbus gateway and Kamstrup which is connected by 4m of unshielded flex running next to the ASHP power cables. I get regular data problems, maybe 25% of communications fail?

The same gateway has no issues when communicating to devices next to it, using short (<= 12 inch) runs of the same cable where there are no parallel power cables.

If the Kamstrup gives me an issue I will replace the modbus flex withthe correct 9841 shielded flex.

I had an unrelated SD card failure and EmonPi wouldn’t boot. Reinstalled and restored data from backups and I’ve not had a single modbus issue since.

I don’t have a valid explanation as to why that worked.

My modbus wiring is over 9m shielded Cat 5,one twisted pair for data and one twisted pair for ground. No resistors that I know of (maybe in the USB adaptor?)