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. Forums
  3. DLMS Python - How To Pass Selected Object?

DLMS Python - How to pass selected object?

Forum Rules

Before commenting read Forum rules

Don't comment the topic if you have a new question.

You can create a new topic selecting correct category from Gurux Forum and then create a new topic selecting "New Topic" from the top left.

By nhzq , 24 December, 2020
Forums
Gurux.DLMS

Hi, I have a question. I want to get data from this OBIS - 1.0.15.6.0.255 class 4.

Command:
python main.py -h 153.121.114.08 -p 5 -a Low -P 31323435 -t Verbose -r ln -c 20 -s 255 -g 1.0.15.6.0.255:4

It seems the command printed all the data. Is that the right command to use?

Thank you in advance.

Profile picture for user Kurumi

Kurumi

5 years 5 months ago

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

nhzq

5 years 5 months ago

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?

Image
Profile picture for user Kurumi

Kurumi

5 years 5 months ago

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

nhzq

5 years 5 months ago

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

Profile picture for user Kurumi

Kurumi

5 years 5 months ago

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

nhzq

5 years 5 months ago

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

Profile picture for user Kurumi

Kurumi

5 years 5 months ago

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

nhzq

5 years 5 months ago

Hi,

Hi,

Please refer the log here:
https://github.com/nhzq/dlms-invalid-structure-format/blob/main/logfile…

Thank you very much

Profile picture for user Kurumi

Kurumi

5 years 5 months ago

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

nhzq

5 years 5 months ago

Hi,

Hi,

Is there any way to skip the association view, and read the object only?

Thank you

Profile picture for user Kurumi

Kurumi

5 years 5 months ago

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

Toni

5 years 4 months ago

10:31:34 10:31:34.561 Info

I'm trying to understand this... What file will I edit.

Profile picture for user Kurumi

Kurumi

5 years 4 months ago

In reply to 10:31:34 10:31:34.561 Info by Toni

Hi Toni,

Hi Toni,

Please, create a new topic if you have a new question.

BR,
Mikko

  • 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

Who's new

  • Tuanhgg
  • Adel
  • charnon
  • Paddles
  • Miguel Ángel
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin