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. Read Out a Simple Obis Code With Python

Read out a simple obis code with Python

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 Frank G , 19 January, 2022
Forums
Gurux.DLMS

Hello Mikko,
I am trying to read out a simple attribute of one object (obiscode) using the python library.
It looks like the meter accept the SNRM and also AARQ. But I am not able to read the attribute
Would you please check this code:

client = GXDLMSClient(forAuthentication=Authentication.NONE)
client.useLogicalNameReferencing = True
client.clientAddress = 0x10
client.serverAddress = 0x4010
port = GXSerial(port="COM6")
port.open()
reader = GXDLMSReader(
client=client,
media=port,
trace=0x8,
invocationCounter=0
)

reply = GXReplyData()
data = client.snrmRequest
if data:
reader.readDLMSPacket(data, reply)
client.parseUAResponse(reply.data)
for it in client.aarqRequest():
reply.clear()
reader.readDLMSPacket(it, reply)
client.parseAareResponse(reply.data)

serial = GXDLMSData("0.0.96.1.0.255");
serial.read(obj, 2);

The Log in Hex:
Authentication: Authentication.NONE
ClientAddress: 0x10
ServerAddress: 0x4010
TX: 17:47:49 7E A0 0A 00 02 00 21 21 93 A0 C4 7E
RX: 17:47:49 7E A0 0A 21 00 02 00 21 73 FC D4 7E
TX: 17:47:49 7E A0 2E 00 02 00 21 21 10 C6 7E E6 E6 00 60 1D A1 09 06 07 60 85 74 05 08 01 01
BE 10 04 0E 01 00 00 00 06 5F 1F 04 00 00 1E 5D FF FF B3 E2 7E
RX: 17:47:49 7E A0 3A 21 00 02 00 21 30 29 72 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 10 14 00
7D 00 07 6D C3 7E
Traceback (most recent call last):
File "
\Desktop\Gurux.DLMS.Python\Gurux.DLMS.Client.Example.python\frank.py", line 52, in <module>
serial.read(obj, 2);
AttributeError: 'GXDLMSData' object has no attribute 'read'

Many Thanks
Frank

Profile picture for user Kurumi

Kurumi

4 years 4 months ago

Hi,

Hi,

Change this:

obj = GXDLMSData("0.0.96.1.0.255");
reader.read(obj, 2);

BR,
Mikko

Frank G

4 years 4 months ago

Many Thanks Mikko. it works

Many Thanks Mikko. it works now

Toni

4 years 3 months ago

Please how can I run the

Please how can I run the gurux as a script instead of the command line as seen above? Thanks

Profile picture for user Kurumi

Kurumi

4 years 3 months ago

In reply to Please how can I run the by Toni

Hi Toni,

Hi Toni,

Please, create a new topic if you have a new question. I'll answer your question then.

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