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