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 ALL THE OBJECTS IN DLMS PYTHON

READ ALL THE OBJECTS IN DLMS 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 Diego2911 , 25 March, 2021
Forums
Gurux.DLMS

Hi

I'm student of IoT projects. I'm working on a project with smart electricity meters. I'm already connected to the meter via optical head with this code.

client = GXDLMSClient(True)
serverAddress = GXDLMSClient.getServerAddress(5532692)
media = GXSerial('COM6')
read = GXDLMSReader(client, media, 0, 0, 0)
reply = GXReplyData()
data = client.snrmRequest()
media.open()

if data:
read.readDLMSPacket(data, reply)
client.parseUAResponse(reply.data)
size = client.limits.maxInfoTX + 40
read.replyBuff = bytearray(size)
reply.clear()
read.readDataBlock(client.aarqRequest(), reply)
client.parseAareResponse(reply.data)
reply.clear()
if client.authentication.value > 1: #se reemplazo el atuthentication por 1 para autenticacion baja LOW
for it in client.getApplicationAssociationRequest():
read.readDLMSPacket(it, reply)
client.parseApplicationAssociationResponse(reply.data)

#At this point, I've made the conecction with the meter
#I dont know what code or class use to read and see all the objects (OBIS CODE and VALUES) that the #meter can offer to me

# I've tried this but i can't see any information
reply = GXReplyData()
read.readDataBlock(client.getObjectsRequest(), reply)
objects = client.parseObjects(reply.data, True)
converter = GXDLMSConverter()
converter.updateOBISCodeInformation(objects)

#Disconnected request
read.readDLMSPacket(client.disconnectRequest(), reply)

I'm glad if someone can help.
Best Regards

Profile picture for user Kurumi

Kurumi

5 years 2 months ago

Hi,

Hi,

Application association describes all the objects that the client can access. ReadAll reads all objects, except profile generic (historical data).

readDataBlock splits PDU (data) into frames and sends and receives them to the meter.

BR,
Mikko

Diego2911

5 years 2 months ago

Thansk for the reply. Also, I

Thansk for the reply. Also, I would like to only see all the objects the meter can offer. I have this main code

import os
import sys
import traceback
from gurux_serial import GXSerial
from gurux_net import GXNet
from gurux_dlms.enums import ObjectType
from gurux_dlms.objects.GXDLMSObjectCollection import GXDLMSObjectCollection
from GXSettings import GXSettings
from GXDLMSReader import GXDLMSReader
from gurux_dlms.GXDLMSClient import GXDLMSClient
from gurux_common.GXCommon import GXCommon
from gurux_dlms.enums.DataType import DataType
import locale
from gurux_dlms.GXDateTime import GXDateTime
from gurux_dlms.internal._GXCommon import _GXCommon
from gurux_dlms import GXDLMSException, GXDLMSExceptionResponse, GXDLMSConfirmedServiceError
from gurux_dlms import *
from gurux_common import ReceiveParameters

#Definimos parámetros de medidor##########################################
client = GXDLMSClient(True)
##########################################################################

#Obtenemos dirección de servidor
serverAddress = GXDLMSClient.getServerAddress(5532692)
print ('Dirección del servidor: '+ str(serverAddress))
##########################################################################

#Obtenemos el puerto serial disponible para transmisión
port = GXSerial.getPortNames()
print('Puerto disponible: ' + str(port))
##########################################################################7

#Inicializamos objeto de lectura
reader = None
settings = GXSettings()
reply = GXReplyData()
ret = settings.getParameters(['main_2.py', '-S', 'COM6'])
reader = GXDLMSReader(settings.client, settings.media, settings.trace, settings.invocationCounter, settings.iec)

#After this i dont know how to continue

Profile picture for user Kurumi

Kurumi

5 years 2 months ago

Hi,

Hi,

If you give serial port as a parameter for the main app it will read all the values from the meter.
You should check the readAll method.

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