Skip to main content
Home
for DLMS smart meters
Open source solutions for DLMS smart metering

Main navigation

  • Home
  • Products
  • About us
  • Open Source
  • Community
  • Forum
  • Downloads
User account menu
  • Log in

Breadcrumb

  1. Home
  2. Gurux.DLMS.Python Vs MetCom MCS301 Broken Association View?

Gurux.DLMS.Python vs MetCom MCS301 broken association view?

Profile picture for user TheCerasus
By TheCerasus , 12 June, 2023
Forums
Gurux.DLMS

Hello everybody,

I've problem with readings meter from MetCom MCS301 over serial port locally with my PC. DLMS Director works like a charm with this settings:

-S COM11:9600:8NoneOne -c 4 -s 24294 -a Low -P 12345678 -w 1 -f 128

Now I'm trying to use it with python script, with Gurux.DLMS.Client.Example.python/main.py, adding args in VSCode launch.json :

"args": ["-S", "COM11:9600:8None1", "-a", "Low", "-P", "12345678", "-c", "4", "-s", "24294", "-r", "ln", "-g", "0.0.1.0.0.255:2", "-g", "1.0.1.8.0.255:2", "-g", "1.0.2.8.0.255:2", "-o", "device.xml"]

first read is doing great, file device.xml is generated, values are readed:
gurux_dlms version: 1.0.144
gurux_net version: 1.0.19
gurux_serial version: 1.0.20
Authentication: 1
ClientAddress: 0x4
ServerAddress: 0x5ee6
Standard: 0
Index: 2 Value: 06/12/23 20:45:57
Index: 2 Value: 0
Index: 2 Value: 0
DisconnectRequest
Ended. Press any key to continue.

Sadly, when i run it again it enters a infinite loop with text:
Failed to load object None 'NoneType' object has no attribute 'load'
Failed to load object None 'NoneType' object has no attribute 'load'
Failed to load object None 'NoneType' object has no attribute 'load'
Failed to load object None 'NoneType' object has no attribute 'load'
Failed to load object None 'NoneType' object has no attribute 'load'
Failed to load object None 'NoneType' object has no attribute 'load'
Failed to load object None 'NoneType' object has no attribute 'load'

What could I do to use xml file as association view cache? What I'm missing here?

Thanks in advance,
Marcin

Profile picture for user TheCerasus

TheCerasus

2 years 12 months ago

Hi, I've find out, with…

Hi,

I've find out, with Verbose mode, that the date is not recognized with gurux:

gurux_dlms version: 1.0.144
gurux_net version: 1.0.19
gurux_serial version: 1.0.20
Authentication: 1
ClientAddress: 0x4
ServerAddress: 0x5ee6
Standard: 2
TX: 10:22:26 7E A0 0A 00 02 7A CD 09 93 BA 03 7E
RX: 10:22:27 7E A0 21 09 00 02 7A CD 73 5E D6 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E
TX: 10:22:27 7E A0 47 00 02 7A CD 09 10 60 5C 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 1E 5D FF FF A9 FD 7E
RX: 10:22:27 7E A0 3A 09 00 02 7A CD 30 8A 65 E6 E7 00 61 29 A1 09 06 07 60 85 74 05 08 01 01 A2 03 02 01 00 A3 05 A1 03 02 01 00 BE 10 04 0E 08 00 06 5F 1F 04 00 00 1E 1D 01 80 00 07 5B C4 7E
Failed to load object 0.0.1.0.0.255 Ch. 0 Clock object #1 time data '06/12/23 15:51:01' does not match format '%m/%d/%Y %H:%M:%S'

I've tried to use -d Italy/India/SaudiArabia but without luck.

If I would manually change date to 06/12/2023 15:51:01 (as strftime() is expecting) everything works well.

I'm not sure what else we could do here?
Meter just simply returns %y, not %Y.

Profile picture for user Kurumi

Kurumi

2 years 12 months ago

Hi Marcin, The hotfix for…

Hi Marcin,

The hotfix for this is that you remove arguments "-o", "device.xml" or file device.xml.

The association view is now read every time which makes reading slower, but you can read the value from the meter.

I'm wondering why your year is saved with two digits. Can you run 'python --version' and let me know the output?

BR,
Mikko

Profile picture for user TheCerasus

TheCerasus

2 years 12 months ago

Hi Mikko, thanks you for the…

Hi Mikko,

thank you for the comment!

The problem is that I'm using this association view xml to process data for further systems and I basically need it.

My VSCode interpreter is set to python 3.11.0:

python --version
Python 3.11.0

Is there any chance, that meter is sending the data in this format?
Where I can find the code responsible for parsing the data/clock, maybe I could hotfix it for my case with my mediocre python skills.

Profile picture for user Kurumi

Kurumi

2 years 11 months ago

Hi Marcin, This is now fixed…

Hi Marcin,

This is now fixed for version 1.0.145 and the year is saved with four digits. Get the latest version from GitHub.

BR,
Mikko

Profile picture for user TheCerasus

TheCerasus

2 years 10 months ago

Hi Mikko, I can confirm it…

Hi Mikko,

I can confirm it works like a charm now.

Many thanks to you, you are our hero we don't deserve.

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Tue, 06/09/2026 - 11:16
    gurux.dlms.java 4.0.95
  • Tue, 06/09/2026 - 10:03
    Gurux.DLMS.Python 1.0.199
  • Mon, 06/08/2026 - 13:39
    gurux.dlms.cpp 9.0.2606.0801
  • Mon, 06/01/2026 - 10:15
    gurux.dlms.cpp 9.0.2606.0101
  • Thu, 05/28/2026 - 16:06
    gurux.dlms.java 4.0.94

New forum topics

  • Error reading L&G Meter
  • Pass a TCP Client to GXNet
  • Australian EDMI Mk10D (Essential Energy area)
  • Strange mix of data notificiation vs get response
  • DLMS Connection
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin