Setting up Modbus devices

474 views
Skip to first unread message

Alex Manning

unread,
May 13, 2021, 11:53:57 AM5/13/21
to Loxone English
H,

I've recently fitting some Eastron SDM-120 electricity meters into my cabinet and need some help setting these up with the Loxone Modbus extension.

The first problem seems to be that each extension by default is configured to address '001' and this can only be changed via some kind of Modbus communication. Can i use the Loxone extension to do this? Or do I need to invest in a USB to Modbus dongle?

Only I've got the address changed what are the main parameters I need to setup to be able to read data from the device?

Kind Regards,
Alex


Steve Joyner

unread,
May 13, 2021, 12:04:51 PM5/13/21
to Alex Manning, Loxone English
Hi Alex,

I struggled with this recently also, as you say the SDM120s can only be configured by wrtiting modbus data to address 1.  Rather than trying to use loxone to do this from Loxone (I think in theory it should be possible to use Loxone to write the necessary data, but it would mean disconnecting any existing Modbus module connected to the Loxone extension  that uses address 1), I choose to use a cheap USB<->RS485 module and a command line utility called modpoll that I downloaded  ( https://www.modbusdriver.com/modpoll.html ).  In my case this was running on Linux and attached to  /dev/ttyUSB1

I used these commands to setup the SDM120 to address=2

sudo ./modpoll -b 2400 -p none -r21   -f -t4:float /dev/ttyUSB1 2 - set addr to 02
sudo ./modpoll -a2 -b 2400 -p none -r29   -f -t4:float /dev/ttyUSB1 2 - set baud to 9600
sudo ./modpoll -a2 -b 9600 -p none -r19   -f -t4:float /dev/ttyUSB1 1 - set parity to even

after that I connected the meter to the Loxone Modbus extension and configured loxone to read the power/usage etc.

Hope that helps

Steve

--
You received this message because you are subscribed to the Google Groups "Loxone English" group.
To unsubscribe from this group and stop receiving emails from it, send an email to loxone-englis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/loxone-english/e3d72421-d659-4f99-82b5-9b9a3da4250dn%40googlegroups.com.

Alex Manning

unread,
May 13, 2021, 3:09:01 PM5/13/21
to Loxone English
Thanks Steve, great advice. Could I ask, what USB to RS485 module did you use?

Steve Joyner

unread,
May 14, 2021, 3:19:51 AM5/14/21
to Alex Manning, Loxone English
Hi Alex,

I have one of these:


Although I think anything based on the FTDI chip will probably work in the same way - you might find a cheper version on eBay or on AliExp.

Steve

Rob_in

unread,
Sep 7, 2022, 10:48:06 AM9/7/22
to Loxone English
Hi all,

I received one of these meters today to test (Eastron SDM120CTM). It came set with baudrate at 9600, ID 1, but trying this (to change the ID) using something like the below...

On Thursday, 13 May 2021 at 18:04:51 UTC+2 SteveJ wrote:
I used these commands to setup the SDM120 to address=2

sudo ./modpoll -b 2400 -p none -r21   -f -t4:float /dev/ttyUSB1 2 - set addr to 02

... doesn't work. I get, "Illegal Function exception response!" from modpoll.

I can read everything just fine (eg. voltage):

$ modpoll -b9600 -pnone -f -t3:float -r 1 /dev/ttyUSB0
modpoll 3.10 - FieldTalk(tm) Modbus(R) Master Simulator
Copyright (c) 2002-2021 proconX Pty Ltd
Visit https://www.modbusdriver.com for Modbus libraries and tools.

Protocol configuration: Modbus RTU, FC4
Slave configuration...: address = 1, start reference = 1, count = 1
Communication.........: /dev/ttyUSB0, 9600, 8, 1, none, t/o 1.00 s, poll rate 1000 ms
Data type.............: 32-bit float, input register table
Word swapping.........: Slave configured as big-endian float machine

-- Polling slave... (Ctrl-C to stop)
[1]: 240.000000
-- Polling slave... (Ctrl-C to stop)
[1]: 240.199997
^C


... and can read the Modbus ID...

$ modpoll -b9600 -pnone -f -t4:float -r 21 -c 1 /dev/ttyUSB0
modpoll 3.10 - FieldTalk(tm) Modbus(R) Master Simulator
Copyright (c) 2002-2021 proconX Pty Ltd
Visit https://www.modbusdriver.com for Modbus libraries and tools.

Protocol configuration: Modbus RTU, FC3
Slave configuration...: address = 1, start reference = 21, count = 1
Communication.........: /dev/ttyUSB0, 9600, 8, 1, none, t/o 1.00 s, poll rate 1000 ms
Data type.............: 32-bit float, output (holding) register table
Word swapping.........: Slave configured as big-endian float machine

-- Polling slave... (Ctrl-C to stop)
[21]: 1.000000
-- Polling slave... (Ctrl-C to stop)
[21]: 1.000000
-- Polling slave... (Ctrl-C to stop)
^C


...but trying to update the address isn't working.

$ modpoll -b9600 -pnone -f -t4:float -r 21 -c 1 /dev/ttyUSB0 30
modpoll 3.10 - FieldTalk(tm) Modbus(R) Master Simulator
Copyright (c) 2002-2021 proconX Pty Ltd
Visit https://www.modbusdriver.com for Modbus libraries and tools.

Protocol configuration: Modbus RTU, FC16
Slave configuration...: address = 1, start reference = 21, count = 1
Communication.........: /dev/ttyUSB0, 9600, 8, 1, none, t/o 1.00 s, poll rate 1000 ms
Data type.............: 32-bit float, output (holding) register table
Word swapping.........: Slave configured as big-endian float machine

Illegal Function exception response!

The unit reports software version (from the display on the actual device) as "6203.01".

You are supposed to be able to change the Modbus ID from the actual device using a 'setup menu' but I can't find it.

There is a single button on the device which I can long press. Display changes to " - SET -". Short press here does nothing. Long press again goes to "CT" screen to set primary current. Short press cycles through the options. Long press seems to save this but goes directly back to the regular display (ie. show KWh, V, A, W, etc). Ie. there seems to be no way to get to the place in the 'setup menu' to change Modbus ID. I tried holding the button while powering on and on different screens but can't find anything. In fact, the only thing one seems to be able to do with the 'setup menu' is change the primary CT. Not much of a menu!

Does anyone else have one of these devices that functions like this? Have you been able to change the Modbus ID from the device itself or sending Modbus commands?

Can anyone see anything silly I've done above?

Thanks in advance,

Robin

Steve Joyner

unread,
Sep 7, 2022, 10:57:35 AM9/7/22
to Rob_in, Loxone English
Hi Robin

I did successfully change the ID of my meter to 02 as per my original post - but as is common these days I can’t remember the details of how I did it other than what I wrote down at the time :(

In my notes  I’ve written 'Hold the button on the front for 3s until Set is displayed -  then fire these mod poll commands’

sudo ./modpoll -b 2400 -p none -r21   -f -t4:float /dev/ttyUSB1 2

Did you do the bit about putting it into ’Set’ mode before writing the new address ?

Steve

--
You received this message because you are subscribed to the Google Groups "Loxone English" group.
To unsubscribe from this group and stop receiving emails from it, send an email to loxone-englis...@googlegroups.com.

Rob_in

unread,
Sep 7, 2022, 11:16:04 AM9/7/22
to Loxone English
On Wednesday, 7 September 2022 at 16:57:35 UTC+2 SteveJ wrote:
In my notes  I’ve written 'Hold the button on the front for 3s until Set is displayed -  then fire these mod poll commands’

Bingo, that works! So the unit has to be in 'Set' mode or seems it won't let you write to the configuration registers. Ridiculous omission from the manual!

Thank you so much for the info :)

Cheers,

Robin
Reply all
Reply to author
Forward
0 new messages