DisconnectRequest
TX: 18:42:07 7E A0 08 02 FF 29 53 DD 46 7E
RX: 18:42:10 7E A0 08 29 02 FF 73 39 50 7E
Traceback (most recent call last):
File "C:\Users\mnoor\Desktop\Python\Gurux.DLMS.Python\Gurux.DLMS.Client.Example.python\main.py", line 105, in main reader.readAll(settings.outputFile)
File "C:\Users\mnoor\Desktop\Python\Gurux.DLMS.Python\Gurux.DLMS.Client.Example.python\GXDLMSReader.py", line 518, in readAll self.getAssociationView()
File "C:\Users\mnoor\Desktop\Python\Gurux.DLMS.Python\Gurux.DLMS.Client.Example.python\GXDLMSReader.py", line 498, in getAssociationView self.client.parseObjects(reply.data, True, False)
File "C:\Users\mnoor\AppData\Local\Programs\Python\Python39\lib\site-packages\gurux_dlms\GXDLMSClient.py", line 728, in parseObjects objects = self.parseLNObjects(data, onlyKnownObjects, ignoreInactiveObjects)
File "C:\Users\mnoor\AppData\Local\Programs\Python\Python39\lib\site-packages\gurux_dlms\GXDLMSClient.py", line 754, in parseLNObjects raise Exception("Invalid structure format.")
Exception: Invalid structure format.
What does it mean by invalid structure format? Thank you
Your meter is returning invalid data when the association view is read. If you add -t Verbose parameter and add trace here, I can check what is the problem.
There is data missing from the meter reply. There is an Array tag, but the action data is missing.
You need to ask the meter manufacturer to fix this. These are the last bytes from the last PDU from the meter.
0204
12 0046 //Object type
1100 //Version
0906000060030AFF //LN
0202//Structure
0104//Attribute access rights for four attribute.
02030F01160100
02030F02160100
02030F03160100
02030F04160300
01 //Method access right list tag. Data is missing.
All other objects' action data is coming as expected. It's only missing from the last object.
Hi,
Hi,
Application reads first the association view. Saving association to the file makes reading faster. You can do it adding o- parameter. Like this:
-o meter.xml
BR,
Mikko
Hi,
Hi,
Thank you for your response. I tried the -o parameter like this :
python main.py -h 153.121.114.08 -p 5 -a Low -P 31323435 -t Verbose -r ln -c 20 -s 255 -v "1.0.1.9.0.255" -o meter.xml
But it printed all the data. Can you help how can I get specific result based on OBIS?
Hi,
Hi,
You need to use -g parameter to read one value, not -v.
-g 1.0.1.9.0.255:2
Something like this:
BR,
Mikko
Hi,
Hi,
I ran the command and got this error.
DisconnectRequest
TX: 18:42:07 7E A0 08 02 FF 29 53 DD 46 7E
RX: 18:42:10 7E A0 08 29 02 FF 73 39 50 7E
Traceback (most recent call last):
File "C:\Users\mnoor\Desktop\Python\Gurux.DLMS.Python\Gurux.DLMS.Client.Example.python\main.py", line 105, in main reader.readAll(settings.outputFile)
File "C:\Users\mnoor\Desktop\Python\Gurux.DLMS.Python\Gurux.DLMS.Client.Example.python\GXDLMSReader.py", line 518, in readAll self.getAssociationView()
File "C:\Users\mnoor\Desktop\Python\Gurux.DLMS.Python\Gurux.DLMS.Client.Example.python\GXDLMSReader.py", line 498, in getAssociationView self.client.parseObjects(reply.data, True, False)
File "C:\Users\mnoor\AppData\Local\Programs\Python\Python39\lib\site-packages\gurux_dlms\GXDLMSClient.py", line 728, in parseObjects objects = self.parseLNObjects(data, onlyKnownObjects, ignoreInactiveObjects)
File "C:\Users\mnoor\AppData\Local\Programs\Python\Python39\lib\site-packages\gurux_dlms\GXDLMSClient.py", line 754, in parseLNObjects raise Exception("Invalid structure format.")
Exception: Invalid structure format.
What does it mean by invalid structure format? Thank you
Hi,
Hi,
Your meter is returning invalid data when the association view is read. If you add -t Verbose parameter and add trace here, I can check what is the problem.
BR,
Mikko
Hi,
Hi,
I ran this command:
python main.py -h 183.171.144.38 -p 5 -a Low -P 31323435 -t Verbose -r ln -c 20 -s 255 -o meter.xml
Trace:
7E A0 21 29 02 FF 73 CC 61 81 80 14 05 02 01 20 06 02 01 20 07 04 00 00 00 01 08 04 00 00 00 01 0B C9 7E
Thank you
Hi,
Hi,
This is a meter SNRM reply, but I need all the messages that the client and meter send to solve this.
BR,
Mikko
Hi,
Hi,
Please refer the log here:
https://github.com/nhzq/dlms-invalid-structure-format/blob/main/logfile…
Thank you very much
Hi,
Hi,
There is data missing from the meter reply. There is an Array tag, but the action data is missing.
You need to ask the meter manufacturer to fix this. These are the last bytes from the last PDU from the meter.
0204
12 0046 //Object type
1100 //Version
0906000060030AFF //LN
0202//Structure
0104//Attribute access rights for four attribute.
02030F01160100
02030F02160100
02030F03160100
02030F04160300
01 //Method access right list tag. Data is missing.
All other objects' action data is coming as expected. It's only missing from the last object.
BR,
Mikko
Hi,
Hi,
Is there any way to skip the association view, and read the object only?
Thank you
Hi,
Hi,
You need to know what you want to read. Comment association view read and you can add objects that you want to read like this:
GXDLMSClock clock = new GXDLMSClock("0.0.1.0.0.255");
//Read the date and time of the clock object.
Read(clock, 2);
Object type and OBIS code must be correct or meter reply an error.
BR,
Mikko
10:31:34 10:31:34.561 Info
I'm trying to understand this... What file will I edit.
Hi Toni,
Hi Toni,
Please, create a new topic if you have a new question.
BR,
Mikko