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.
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.
Hie Mikko.
Thank you for your Python DLMS library it has really helped me understand the DLMS protocol.
I have been connecting to my Landis & Gyr E460S meter using default settings (Client Address 16 with no password connection) and I have been getting the following Read-Write errors:
-------- Reading 70 0.0.96.3.10.255 Ch. 0 Disconnect control
Index: 1 Value: 0.0.96.3.10.255
Index: 2 Value: True
Index: 3 Value: 1
Error! Index: 4 Access Error : Device reports Read-Write denied.
Access Error : Device reports Read-Write denied.
Now I want to be able to open and close latch on the meter so I have tried to authenticate to the meter using the same settings as I have been using in Landis&Gyr .MAP110 but when I attempt to connect using this Python script
client = GXDLMSClient(True)
client.useLogicalNameReferencing = True
client.interfaceType = InterfaceType.HDLC
client.clientAddress = 17
client.serverAddress = 1
client.authentication = Authentication.LOW
client.password = '12345678'
media = GXSerial(None)
media.baudRate = BaudRate.BAUD_RATE_9600
media.bytesize = 8
media.parity = Parity.NONE
media.stopbits = StopBits.ONE
media.port = '/dev/ttyUSB0'
trace = TraceLevel.INFO
iec = False
invocationCounter = None
outputFile = None
reader = GXDLMSReader(client, media, trace, invocationCounter, iec)
media.open()
reader.initializeConnection()
reader.getAssociationView()
reader.getReadItem(ObjectType.DISCONNECT_CONTROL)
I'm facing this error
Authentication: Authentication.LOW
ClientAddress: 0x11
ServerAddress: 0x1
RX: 16:51:36 7E A0 09 23 03 13 FD 38 47 0F 7E
Traceback (most recent call last):
File "/home/izak/PycharmProjects/nvWhispr/meter/dlms_client.py", line 44, in <module>
reader.initializeConnection()
File "/home/izak/PycharmProjects/nvWhispr/meter/GXDLMSReader.py", line 306, in initializeConnection
self.readDataBlock(self.client.aarqRequest(), reply)
File "/home/izak/PycharmProjects/nvWhispr/meter/GXDLMSReader.py", line 180, in readDataBlock
self.readDataBlock(it, reply)
File "/home/izak/PycharmProjects/nvWhispr/meter/GXDLMSReader.py", line 182, in readDataBlock
self.readDLMSPacket(data, reply)
File "/home/izak/PycharmProjects/nvWhispr/meter/GXDLMSReader.py", line 119, in readDLMSPacket
self.readDLMSPacket2(data, reply)
File "/home/izak/PycharmProjects/nvWhispr/meter/GXDLMSReader.py", line 170, in readDLMSPacket2
raise e
File "/home/izak/PycharmProjects/nvWhispr/meter/GXDLMSReader.py", line 149, in readDLMSPacket2
while not self.client.getData(rd, reply, notify):
File "/home/izak/.venv/nvWhispr/lib/python3.8/site-packages/gurux_dlms/GXDLMSClient.py", line 1103, in getData
raise ex
File "/home/izak/.venv/nvWhispr/lib/python3.8/site-packages/gurux_dlms/GXDLMSClient.py", line 1100, in getData
ret = GXDLMS.getData(self.settings, reply, data, notify)
File "/home/izak/.venv/nvWhispr/lib/python3.8/site-packages/gurux_dlms/GXDLMS.py", line 1857, in getData
cls.getPdu(settings, target)
File "/home/izak/.venv/nvWhispr/lib/python3.8/site-packages/gurux_dlms/GXDLMS.py", line 1594, in getPdu
raise ValueError("Invalid PDU.")
ValueError: Invalid PDU.
I'm also facing the same error in GXDLMS DIRECTOR (see the attached)
Hi,
Hi,
I can't say anything from this. I need a trace from the bytes.
BR,
Mikko
Hi Mikko, this is the GXDLMS
Hi Mikko, this is the GXDLMS Director trace leading me to the error "Invalid PDU":
11:17:51
<HDLC len="9" >
<TargetAddress Value="1" />
<SourceAddress Value="11" />
<FrameType Value="93" />
<Snrm>
</Snrm>
</HDLC>
11:17:51
<HDLC len="1F" >
<TargetAddress Value="11" />
<SourceAddress Value="1" />
<FrameType Value="73" />
<NextFrame Value="8180140502008006020080070400000001080400000001" />
</HDLC>
11:17:51
<HDLC len="3F" >
<TargetAddress Value="1" />
<SourceAddress Value="11" />
<FrameType Value="10" />
<PDU>
<AssociationRequest>
<ApplicationContextName Value="SN" />
<SenderACSERequirements Value="1" />
<MechanismName Value="Low" />
<CallingAuthentication Value="12345678" />
<InitiateRequest>
<ProposedDlmsVersionNumber Value="06" />
<ProposedConformance>
<ConformanceBit Name="ParameterizedAccess" />
<ConformanceBit Name="InformationReport" />
<ConformanceBit Name="MultipleReferences" />
<ConformanceBit Name="UnconfirmedWrite" />
<ConformanceBit Name="Write" />
<ConformanceBit Name="Read" />
</ProposedConformance>
<ProposedMaxPduSize Value="FFFF" />
</InitiateRequest>
</AssociationRequest>
</PDU>
</HDLC>
11:17:51
<HDLC len="8" >
<TargetAddress Value="11" />
<SourceAddress Value="1" />
<FrameType Value="13" />
<Command Value="NextFrame" />
</HDLC>
Hi Isaac ,
Hi Isaac ,
I need raw bytes to solve this.
BR,
Mikko
GXDLMSDirector 8.2.2005.1401
This is what i have collected from the log file.
GXDLMSDirector 8.2.2005.1401
Log created 3:45:50 PM
15:46:05 Initializing serial connection.
15:46:05 03:46:05.397 Info Opening
15:46:05 03:46:05.397 Info Serial Port Settings: Port Name: COM3 Baud Rate: 9600 Data Bits: 8 Parity: None Stop Bits: One Flow Control: None Eop: None
15:46:05 03:46:05.494 Info Open
3:46:06 PM Send SNRM request.
7E A0 07 03 23 93 BF 32 7E
<HDLC len="A" >
<TargetAddress Value="1" />
<SourceAddress Value="11" />
<FrameType Value="93" />
<Snrm>
</Snrm>
</HDLC>
15:46:06 03:46:06.496 Sent 7E A0 07 03 23 93 BF 32 7E
15:46:06 03:46:06.562 Received 7E A0 20
15:46:06 03:46:06.565 Received 20 23
15:46:06 03:46:06.566 Received 03
15:46:06 03:46:06.568 Received 73 CB
15:46:06 03:46:06.571 Received 2D 81 80
15:46:06 03:46:06.572 Received 14
15:46:06 03:46:06.574 Received 05 02
15:46:06 03:46:06.575 Received 00
15:46:06 03:46:06.578 Received 80 06
15:46:06 03:46:06.580 Received 02 00
15:46:06 03:46:06.582 Received 80
15:46:06 03:46:06.587 Received 07 04
15:46:06 03:46:06.590 Received 00 00 00 01
15:46:06 03:46:06.594 Received 08 04 00 00 00
15:46:06 03:46:06.597 Received 01 CE
15:46:06 03:46:06.597 Received 6A
3:46:06 PM
7E A0 20 23 03 73 CB 2D 81 80 14 05 02 00 80 06 02 00 80 07 04 00 00 00 01 08 04 00 00 00 01 CE 6A 7E
<HDLC len="1F" >
<TargetAddress Value="11" />
<SourceAddress Value="1" />
<FrameType Value="73" />
<NextFrame Value="8180140502008006020080070400000001080400000001" />
</HDLC>
15:46:06 Parsing UA reply succeeded.
3:46:06 PM Send AARQ request.
7E A0 40 03 23 10 BA C5 E6 E6 00 60 32 A1 09 06 07 60 85 74 05 08 01 02 8A 02 07 80 8B 07 60 85 74 05 08 02 01 AC 06 80 04 12 34 56 78 BE 10 04 0E 01 00 00 00 06 5F 1F 04 00 1C 03 20 FF FF DD 57 7E
<HDLC len="3F" >
<TargetAddress Value="1" />
<SourceAddress Value="11" />
<FrameType Value="10" />
<PDU>
<AssociationRequest>
<ApplicationContextName Value="SN" />
<SenderACSERequirements Value="1" />
<MechanismName Value="Low" />
<CallingAuthentication Value="12345678" />
<InitiateRequest>
<ProposedDlmsVersionNumber Value="06" />
<ProposedConformance>
<ConformanceBit Name="ParameterizedAccess" />
<ConformanceBit Name="InformationReport" />
<ConformanceBit Name="MultipleReferences" />
<ConformanceBit Name="UnconfirmedWrite" />
<ConformanceBit Name="Write" />
<ConformanceBit Name="Read" />
</ProposedConformance>
<ProposedMaxPduSize Value="FFFF" />
</InitiateRequest>
</AssociationRequest>
</PDU>
</HDLC>
15:46:06 03:46:06.600 Sent 7E A0 40 03 23 10 BA C5 E6 E6 00 60 32 A1 09 06 07 60 85 74 05 08 01 02 8A 02 07 80 8B 07 60 85 74 05 08 02 01 AC 06 80 04 12 34 56 78 BE 10 04 0E 01 00 00 00 06 5F 1F 04 00 1C 03 20 FF FF DD 57 7E
15:46:06 03:46:06.721 Received 7E A0 09
15:46:06 03:46:06.721 Received 09 23
15:46:06 03:46:06.721 Received 03 13 FD
15:46:06 03:46:06.721 Received 38 47 0F
3:46:06 PM
7E A0 09 23 03 13 FD 38 47 0F 7E
<HDLC len="8" >
<TargetAddress Value="11" />
<SourceAddress Value="1" />
<FrameType Value="13" />
<Command Value="NextFrame" />
</HDLC>
15:46:06 03:46:06.736 Info Closing
15:46:06 03:46:06.736 Info Closed
System.InvalidOperationException: Invalid PDU.
at GXDLMSDirector.GXDLMSDevice.InitializeConnection()
at GXDLMSDirector.MainForm.Connect(Object sender, GXAsyncWork work, Object[] parameters)
Hi,
Hi,
Your meter is returning invalid PDU. One of your settings is different that meter expects and it's causing this. Can you read your meter with Map110 and send trace from the three first messages that client sends. I can check the correct parameters for you.
BR,
Mikko
Thanks Mikko.
Thanks Mikko.
I have finally received a response from Landis & Gyr, I was using the wrong client address. So to gain management access (Limited) on E460S I had to use the config below:
Client address: 1
Server address: 1
So far I successfully connected using GXDLMS Director, I will let you know if I run into any problems with the Python client.
Regards.