Good day.
We have several Iskraemeco MT372 meters connected to Moxa NPort 5130 via RS-485 interface. Serial interface of the Moxa configured as "real com mode" and mapped on windows workstation via tcp as COM2. Meterview successfully read out data of all the meters in such setup. Our goal is to automate read out task but Meterview does not allow automate such tasks.
We tried to use Gurux.DLMS.Client.Example.python but unfortunately without success.
--- beginning of output ---
(venv) c:\Users\Roman\Desktop\Gurux.DLMS.Python-master\Gurux.DLMS.Client.Example.python>python main.py -S COM2:9600:8None1 -a Low -P 12345678 -c 100 -s 78 -t Verbose
gurux_dlms version: 1.0.85
gurux_net version: 1.0.17
gurux_serial version: 1.0.14
Authentication: Authentication.LOW
ClientAddress: 0x64
ServerAddress: 0x4e
Standard: Standard.DLMS
TX: 10:39:33 7E A0 07 9D C9 93 34 BF 7E
Data send failed. Try to resend 1/3
Data send failed. Try to resend 2/3
RX: 10:39:48
DisconnectRequest
--- end of output ---
Can somebody tell us which parameters we should use to successfully read out our meters ?
Maybe client and server address are wrong ? In Meterview there isn't separatŠµ input fields for server and client address, only one field "Client address" where we write 100.1.* (instead of asterisk we use two digital number depending on which meter we wont to read out).
Change server address to 145. It works with our meter.
I can check the correct parameters for you if it still fails.
Add trace from the Meterview connection here. Only first line where is 0x7E at the being is important.
Tried to change server address to 145, result is bit different but also unsatisfactory.
(venv) c:\Users\Roman\Desktop\Gurux.DLMS.Python-master\Gurux.DLMS.Client.Example.python>python main.py -S COM2 -a Low -P 12345678 -c 100 -s 145 -t Verbose
gurux_dlms version: 1.0.85
gurux_net version: 1.0.17
gurux_serial version: 1.0.14
Authentication: Authentication.LOW
ClientAddress: 0x64
ServerAddress: 0x91
Standard: Standard.DLMS
TX: 16:42:33 7E A0 08 02 23 C9 93 E4 43 7E
Data send failed. Try to resend 1/3
Data send failed. Try to resend 2/3
RX: 16:42:48
DisconnectRequest
Traceback (most recent call last):
File "main.py", line 104, in main
reader.readAll(settings.outputFile)
File "c:\Users\Roman Jermakov\Desktop\Gurux.DLMS.Python-master\Gurux.DLMS.Client.Example.python\GXDLMSReader.py", line 504, in readAll
self.initializeConnection()
File "c:\Users\Roman Jermakov\Desktop\Gurux.DLMS.Python-master\Gurux.DLMS.Client.Example.python\GXDLMSReader.py", line 308, in initializeConnection
self.readDLMSPacket(data, reply)
File "c:\Users\Roman Jermakov\Desktop\Gurux.DLMS.Python-master\Gurux.DLMS.Client.Example.python\GXDLMSReader.py", line 119, in readDLMSPacket
self.readDLMSPacket2(data, reply)
File "c:\Users\Roman Jermakov\Desktop\Gurux.DLMS.Python-master\Gurux.DLMS.Client.Example.python\GXDLMSReader.py", line 170, in readDLMSPacket2
raise e
File "c:\Users\Roman Jermakov\Desktop\Gurux.DLMS.Python-master\Gurux.DLMS.Client.Example.python\GXDLMSReader.py", line 162, in readDLMSPacket2
raise TimeoutException("Failed to receive reply from the device in given time.")
gurux_common.TimeoutException.TimeoutException: Failed to receive reply from the device in given time.
Ended. Press any key to continue.
(venv) c:\Users\Roman\Desktop\Gurux.DLMS.Python-master\Gurux.DLMS.Client.Example.python>
Sorry I don't know how to get connection trace. I have found something in Meterview menu Meter -> View log but I am not sure
8/6/2020 3:28:03 PM, Log Started
25438 ms elapsed -> DLMS opening local connection
18672 ms elapsed -> HDLC sending:
7e a0 08 02 9d c9 93 bd d9 7e
1406 ms elapsed -> HDLC received:
7e a0 1f c9 02 9d 73 ca 36 81 80 12 05 01 5a 06
01 5a 07 04 00 00 00 01 08 04 00 00 00 01 28 b5
7e
It works with 206 value but I don't understand where can I find such "magic" numbers for other meters on the same rs-485 line ?
And one more question. In our setup we should "mount" remote moxa serial port on workstation to be able to read out meters. In case of large quantity of moxa nport converters such setup looks like very bulky and unreliable. Can we change moxa serial port operation mode to "tcp server mode" and in Gurux.DLMS.Client.Example.python use TCP connection instead of serial port ?
The server address is count from that asterisk as you described above (100.1.*).
Iskra is using different server address for TCP/IP and framing is changed from HDLC to WRAPPER,
but it should work. Our clients are reading Iskraemeco meters using TCP/IP all the time.
Please, create a new topic if you have a new question. It's easier to answer for the right question.
You can use Python example to read Iskraemeco meters directly using TC/IP connection. There are several different RS-485 to Ethernet converters and usually, it will take some time to handle it, but it's possible to do.
Hi,
Hi,
Change server address to 145. It works with our meter.
I can check the correct parameters for you if it still fails.
Add trace from the Meterview connection here. Only first line where is 0x7E at the being is important.
BR,
Mikko
Tried to change server
Tried to change server address to 145, result is bit different but also unsatisfactory.
(venv) c:\Users\Roman\Desktop\Gurux.DLMS.Python-master\Gurux.DLMS.Client.Example.python>python main.py -S COM2 -a Low -P 12345678 -c 100 -s 145 -t Verbose
gurux_dlms version: 1.0.85
gurux_net version: 1.0.17
gurux_serial version: 1.0.14
Authentication: Authentication.LOW
ClientAddress: 0x64
ServerAddress: 0x91
Standard: Standard.DLMS
TX: 16:42:33 7E A0 08 02 23 C9 93 E4 43 7E
Data send failed. Try to resend 1/3
Data send failed. Try to resend 2/3
RX: 16:42:48
DisconnectRequest
Traceback (most recent call last):
File "main.py", line 104, in main
reader.readAll(settings.outputFile)
File "c:\Users\Roman Jermakov\Desktop\Gurux.DLMS.Python-master\Gurux.DLMS.Client.Example.python\GXDLMSReader.py", line 504, in readAll
self.initializeConnection()
File "c:\Users\Roman Jermakov\Desktop\Gurux.DLMS.Python-master\Gurux.DLMS.Client.Example.python\GXDLMSReader.py", line 308, in initializeConnection
self.readDLMSPacket(data, reply)
File "c:\Users\Roman Jermakov\Desktop\Gurux.DLMS.Python-master\Gurux.DLMS.Client.Example.python\GXDLMSReader.py", line 119, in readDLMSPacket
self.readDLMSPacket2(data, reply)
File "c:\Users\Roman Jermakov\Desktop\Gurux.DLMS.Python-master\Gurux.DLMS.Client.Example.python\GXDLMSReader.py", line 170, in readDLMSPacket2
raise e
File "c:\Users\Roman Jermakov\Desktop\Gurux.DLMS.Python-master\Gurux.DLMS.Client.Example.python\GXDLMSReader.py", line 162, in readDLMSPacket2
raise TimeoutException("Failed to receive reply from the device in given time.")
gurux_common.TimeoutException.TimeoutException: Failed to receive reply from the device in given time.
Ended. Press any key to continue.
(venv) c:\Users\Roman\Desktop\Gurux.DLMS.Python-master\Gurux.DLMS.Client.Example.python>
Sorry I don't know how to get connection trace. I have found something in Meterview menu Meter -> View log but I am not sure
8/6/2020 3:28:03 PM, Log Started
25438 ms elapsed -> DLMS opening local connection
18672 ms elapsed -> HDLC sending:
7e a0 08 02 9d c9 93 bd d9 7e
1406 ms elapsed -> HDLC received:
7e a0 1f c9 02 9d 73 ca 36 81 80 12 05 01 5a 06
01 5a 07 04 00 00 00 01 08 04 00 00 00 01 28 b5
7e
0 ms elapsed -> HDLC sending:
7e a0 45 02 9d c9 10 78 d2 e6 e6 00 60 36 a1 09
06 07 60 85 74 05 08 01 01 8a 02 07 80 8b 07 60
85 74 05 08 02 01 ac 0a 80 08 31 32 33 34 35 36
37 38 be 10 04 0e 01 00 00 00 06 5f 1f 04 00 00
7e 1f ff ff 83 d7 7e
Hi,
Hi,
Your meter is using value 206. Try with this:
-s 206
BR,
Mikko
Thanks for the answer.
Thanks for the answer.
It works with 206 value but I don't understand where can I find such "magic" numbers for other meters on the same rs-485 line ?
And one more question. In our setup we should "mount" remote moxa serial port on workstation to be able to read out meters. In case of large quantity of moxa nport converters such setup looks like very bulky and unreliable. Can we change moxa serial port operation mode to "tcp server mode" and in Gurux.DLMS.Client.Example.python use TCP connection instead of serial port ?
Hi,
Hi,
The server address is count from that asterisk as you described above (100.1.*).
Iskra is using different server address for TCP/IP and framing is changed from HDLC to WRAPPER,
but it should work. Our clients are reading Iskraemeco meters using TCP/IP all the time.
BR,
Mikko
Hi Mikko,
Hi Mikko,
one more time thank you for helping out.
Sorry but I don't understand how I can get server address from this numbers 100.1.78. Can you explain this algorithm in more detail ?
Hi,
Hi,
Counting server address depends on the meter manufacturer. In your case try to add 128 for meter number. In your example 78+128=206
BR,
Mikko
Good day Mikko,
Good day Mikko,
can you have examples of data reading implementation when meters connected to the TCP/IP network via RS485 to Ethernet converters ?
May be "Gurux.DLMS.Client.Example.python" example can be used for such type of reading ?
Hi romjer,
Hi romjer,
Please, create a new topic if you have a new question. It's easier to answer for the right question.
You can use Python example to read Iskraemeco meters directly using TC/IP connection. There are several different RS-485 to Ethernet converters and usually, it will take some time to handle it, but it's possible to do.
BR,
Mikko