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
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.
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
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.
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
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.