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. Gurux.DLMS Python (Security Issue)

Gurux.DLMS Python (Security issue)

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 HERO , 4 August, 2020
Forums
Gurux.DLMS

Hi,

I am working on electric meter.
I tried to set authentication values but it cannot access.
I have this correct AssociationRequest of the meter:

<AssociationRequest>
<ApplicationContextName Value="LN_WITH_CIPHERING" />
<CallingAPTitle Value="0F0E0D0C0B0A0908" />
<SenderACSERequirements Value="1" />
<MechanismName Value="HighGMac" />
<CallingAuthentication Value="3030303030303031" />
<glo_InitiateRequest Value="30000006A2385A11EEA9B584DB5983B7E06A00221D7DCA78357738CC9E16C2" />
</AssociationRequest>

From this I found that System Title is 0F0E0D0C0B0A0908 ,and the value 3030303030303031 -I think it is challenge value- is for authentication. I generate the password using DLMS translator. The password is 10 00 00 00 01 A0 C8 F8 FF B0 C2 9A EB 54 1C D0 0C

I set Authentication like in the image below.

Please help me the set the appropriate values of authentication.

Thanks,

Image
Profile picture for user Kurumi

Kurumi

5 years 10 months ago

Hi,

Hi,

HighGMac doesn't use a password. Is meter answering anything? Check your keys if you are not receiving a reply. Each meter might be own keys, so check that you are using correct keys.

BR,
Mikko

HERO

5 years 10 months ago

Hi,

Hi,

I tried the updated Gurux.DLMS Python , main python file with the parameters:
-S COM15 -d DLMS -t Verbose -c 16 -s 144 -C Authentication -a HighGMac -T 0F0E0D0C0B0A0908 -D 00112233445566778899AABBCCDDEEFF

I am sure for System Title value and Authentication Level and addresses.

The output is below:
#########################################################################
gurux_dlms version: 1.0.83
gurux_net version: 1.0.17
gurux_serial version: 1.0.14
Authentication: Authentication.HIGH_GMAC
ClientAddress: 0x10
ServerAddress: 0x90
Standard: Standard.DLMS
Security: Security.AUTHENTICATION
System title: 0F 0E 0D 0C 0B 0A 09 08
Authentication key: D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
Block cipher key: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
Dedicated key: 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF
TX: 22:32:52 7E A0 08 02 21 21 93 05 D1 7E
RX: 22:32:52 7E A0 1F 21 02 21 73 56 F4 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E
TX: 22:32:52 7E A0 7D 02 21 21 10 31 54 E6 E6 00 60 6E A1 09 06 07 60 85 74 05 08 01 03 A6 0A 04 08 0F 0E 0D 0C 0B 0A 09 08 8A 02 07 80 8B 07 60 85 74 05 08 02 05 AC 12 80 10 3A 2E 11 B7 E0 FC 11 0E 32 80 6B E5 9B 27 B7 A2 BE 34 04 32 21 30 10 00 00 00 00 01 01 10 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF 00 00 06 5F 1F 04 00 00 10 10 FF FF 81 C2 13 CB 95 FE FE 44 6D 8D 40 66 9A F9 7E
RX: 22:32:52 7E A0 5B 21 02 21 30 FB 68 E6 E7 00 61 4C A1 09 06 07 60 85 74 05 08 01 03 A2 03 02 01 01 A3 05 A1 03 02 01 01 A4 0A 04 08 53 41 47 67 30 01 8B 7B 88 02 07 80 89 07 60 85 74 05 08 02 05 AA 12 80 10 3A 2E 11 B7 E0 FC 11 0E 32 80 6B E5 9B 27 B7 A2 BE 06 04 04 0E 01 00 06 31 78 7E
DisconnectRequest
TX: 22:32:52 7E A0 08 02 21 21 53 09 17 7E
RX: 22:32:52 7E A0 08 21 02 21 73 CA 70 7E
#############################################################

Any help?!

Profile picture for user Kurumi

Kurumi

5 years 10 months ago

Hi,

Hi,

Change Authentication to EncryptionAuthentication. If it still fails add -v parameter.
Like this: -v 0.0.43.1.1.255

BR,
Mikko

HERO

5 years 10 months ago

Hi,

Hi,

I change like it, but still not working.
This is command:
-S COM15 -d DLMS -t Verbose -c 16 -s 144 -C AuthenticationEncryption -a HighGMac -T 0F0E0D0C0B0A0908 -v 0.0.43.1.0.255

It displayed this response:

Authentication: Authentication.HIGH_GMAC
ClientAddress: 0x10
ServerAddress: 0x90
Standard: Standard.DLMS
Security: Security.AUTHENTICATION_ENCRYPTION
System title: 0F 0E 0D 0C 0B 0A 09 08
Authentication key: D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
Block cipher key: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
TX: 18:52:57 7E A0 08 02 21 21 93 05 D1 7E
RX: 18:52:57 7E A0 1F 21 02 21 73 56 F4 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E
TX: 18:52:57 7E A0 2C 02 21 21 10 17 2A 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 40 10 10 FF FF DA 74 7E
RX: 18:52:57 7E A0 38 21 02 21 30 84 D4 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 10 04 C8 00 07 6E 2F 7E
TX: 18:52:57 7E A0 1A 02 21 21 32 4E C7 E6 E6 00 C0 01 C1 00 01 00 00 2B 01 00 FF 02 00 7D 8F 7E
RX: 18:52:58 7E A0 16 21 02 21 52 B9 95 E6 E7 00 C4 01 C1 00 06 00 00 00 00 7D 18 7E
Invocation counter: 1
DisconnectRequest
TX: 18:52:58 7E A0 08 02 21 21 53 09 17 7E
RX: 18:52:58 7E A0 08 21 02 21 73 CA 70 7E
TX: 18:52:58 7E A0 08 02 21 21 93 05 D1 7E
RX: 18:52:58 7E A0 1F 21 02 21 73 56 F4 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E
TX: 18:52:58 7E A0 6C 02 21 21 10 35 EB E6 E6 00 60 5D A1 09 06 07 60 85 74 05 08 01 03 A6 0A 04 08 0F 0E 0D 0C 0B 0A 09 08 8A 02 07 80 8B 07 60 85 74 05 08 02 05 AC 12 80 10 0D BF 47 A1 A8 BE C1 1E 3D 96 D8 4A CC 2E 96 E0 BE 23 04 21 21 1F 30 00 00 00 01 98 8D C4 33 00 61 80 EF 4E E6 D3 83 E7 5E CF 37 26 F6 5E F3 A6 AF 39 FC 15 56 F8 7B 7E
RX: 18:52:58 7E A0 5B 21 02 21 30 FB 68 E6 E7 00 61 4C A1 09 06 07 60 85 74 05 08 01 03 A2 03 02 01 01 A3 05 A1 03 02 01 01 A4 0A 04 08 53 41 47 67 30 01 8B 7B 88 02 07 80 89 07 60 85 74 05 08 02 05 AA 12 80 10 0D BF 47 A1 A8 BE C1 1E 3D 96 D8 4A CC 2E 96 E0 BE 06 04 04 0E 01 00 06 85 F5 7E
DisconnectRequest
TX: 18:52:58 7E A0 08 02 21 21 53 09 17 7E
RX: 18:52:58 7E A0 08 21 02 21 73 CA 70 7E

################################################

I found that about AssociationRequest for above response is:

<HDLC len="107" >
<TargetAddress Value="144" />
<SourceAddress Value="2" />
<!--AARQ frame.-->
<FrameType Value="10" />
<PDU>
<AssociationRequest>
<ApplicationContextName Value="LN_WITH_CIPHERING" />
<CallingAPTitle Value="0F0E0D0C0B0A0908" />
<SenderACSERequirements Value="1" />
<MechanismName Value="HighGMac" />
<CallingAuthentication Value="6C94AAA0B1BE75ADA008419FA5FB2DF0" />
<glo_InitiateRequest Value="3000000001988DC433006180EF4EE6D383E75ECF3726F65EF3A6AF39FC1556" />
</AssociationRequest>
</PDU>
</HDLC>

But the correct AssociationRequest that I found from the company meter software (by using USB Analyzer) is:

<HDLC len="99" >
<TargetAddress Value="144" />
<SourceAddress Value="2" />
<!--AARQ frame.-->
<FrameType Value="10" />
<PDU>
<AssociationRequest>
<ApplicationContextName Value="LN_WITH_CIPHERING" />
<CallingAPTitle Value="0F0E0D0C0B0A0908" />
<SenderACSERequirements Value="1" />
<MechanismName Value="HighGMac" />
<CallingAuthentication Value="3030303030303031" />
<glo_InitiateRequest Value="3000000516AACD596D24C9A51EF6673D2801A68F4FCE603026C69C42F284C6" />
</AssociationRequest>
</PDU>
</HDLC>

###############################################

Profile picture for user Kurumi

Kurumi

5 years 10 months ago

Hi,

Hi,

There are two differences. The invocation (Frame) counter is 1302. When you read it it's 0. Check what another invocation counter there are than 0.0.43.1.0.255 and try to read the value from those.

If you make connection without authentication you can see counters and read those values.

Another difference is that client sends a password (00000001) as a challenge.
Challenge should be a random value but you can set static value like this:
cl.ctoSChallenge = "00000001".encode()

BR,
Mikko

HERO

5 years 10 months ago

Hi,

Hi,

I read the invocation counter for 0.0.43.1.0.255 and the result is 1 .
I read it for 0.0.43.1.2.255 and the result is 1769.

I set the value of the challenge , but it failed.

The result is shown as below:

################################################################

-------------------------------------------------------
Authentication: Authentication.HIGH_GMAC
ClientAddress: 0x2
ServerAddress: 0x90
open
Standard: Standard.DLMS
Security: Security.AUTHENTICATION_ENCRYPTION
System title: 0F 0E 0D 0C 0B 0A 09 08
Authentication key: D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
Block cipher key: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
TX: 19:02:09 7E A0 08 02 21 21 93 05 D1 7E
RX: 19:02:09 7E A0 1F 21 02 21 73 56 F4 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E
TX: 19:02:09 7E A0 2C 02 21 21 10 17 2A 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 40 10 10 FF FF DA 74 7E
RX: 19:02:09 7E A0 38 21 02 21 30 84 D4 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 10 04 C8 00 07 6E 2F 7E
TX: 19:02:09 7E A0 1A 02 21 21 32 4E C7 E6 E6 00 C0 01 C1 00 01 00 00 2B 01 02 FF 02 00 0B B6 7E
RX: 19:02:09 7E A0 16 21 02 21 52 B9 95 E6 E7 00 C4 01 C1 00 06 00 00 06 E8 EB 27 7E
Invocation counter: 1769
DisconnectRequest
TX: 19:02:09 7E A0 08 02 21 21 53 09 17 7E
RX: 19:02:09 7E A0 08 21 02 21 73 CA 70 7E
TX: 19:02:09 7E A0 08 02 21 05 93 56 95 7E
RX: 19:02:09 7E A0 1F 05 02 21 73 E9 09 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E
TX: 19:02:09 7E A0 6C 02 21 05 10 66 AF E6 E6 00 60 5D A1 09 06 07 60 85 74 05 08 01 03 A6 0A 04 08 0F 0E 0D 0C 0B 0A 09 08 8A 02 07 80 8B 07 60 85 74 05 08 02 05 AC 12 80 10 08 82 48 C9 39 1D 57 5E FC 68 3B 09 F9 20 8A 52 BE 23 04 21 21 1F 30 00 00 06 E9 4A 09 A6 C9 6C 98 EC 08 F8 19 05 D6 9C AA AB F0 61 87 9F 8E 87 0A 29 8E 97 B9 C2 4A 7E
RX: 19:02:10 7E A0 78 05 02 21 30 19 E8 E6 E7 00 61 69 A1 09 06 07 60 85 74 05 08 01 03 A2 03 02 01 00 A3 05 A1 03 02 01 0E A4 0A 04 08 53 41 47 67 30 01 8B 7B 88 02 07 80 89 07 60 85 74 05 08 02 05 AA 12 80 10 22 29 56 5F 5C 50 57 29 2C 5C 25 3F 36 3D 2D 57 BE 23 04 21 28 1F 30 00 00 07 08 11 92 1F CF 71 17 E8 E8 AC 80 09 45 73 EE FD 85 B9 8D 3E D8 79 F4 E3 0D 1B 46 44 02 7E
TX: 19:02:10 7E A0 49 02 21 05 32 B3 EB E6 E6 00 DB 08 0F 0E 0D 0C 0B 0A 09 08 31 30 00 00 06 EA 49 7D F2 7D B5 1F 84 99 74 18 15 D6 B3 16 82 8D F0 09 04 61 00 B2 70 E9 65 85 84 7F 16 26 9B B3 D8 F7 BB 38 7E 13 8A C4 C6 82 27 21 57 AE 7E
RX: 19:02:10 7E A0 2E 05 02 21 52 F7 E6 E6 E7 00 DB 08 53 41 47 67 30 01 8B 7B 16 30 00 00 07 09 B2 71 54 E5 C8 EE 5B EC E8 35 B1 B7 A7 C1 58 7D A9 FF 60 7E
DisconnectRequest
TX: 19:02:10 7E A0 08 02 21 05 53 5A 53 7E
RX: 19:02:10 7E A0 08 05 02 21 73 75 8D 7E

#################################################33

Thanks,

HERO

5 years 10 months ago

Hi,

Hi,

I tried with Gurux GXDLMSDirector . I set the security parameter as shown in the image below.
It is successfully access and I get the objects values.

But in Gurux.DLMS Python it failed. I change the parameters like in GXDLMSDirector . The code is:
--------------------------------------------------------------
self.invocationCounter = "0.0.43.1.2.255"
GXDLMSObject.validateLogicalName(self.invocationCounter)
self.client = GXDLMSSecureClient(True)
self.client.useLogicalNameReferencing = True
self.client.standard = Standard.DLMS
self.client.clientAddress = int("2")
self.client.serverAddress = int("144")
self.client.authentication = Authentication.HIGH_GMAC
self.client.ciphering.security = Security.AUTHENTICATION_ENCRYPTION
self.client.ctoSChallenge = "00000001".encode()
self.client.ciphering.systemTitle = GXByteBuffer.hexToBytes("0F0E0D0C0B0A0908")
----------------------------------------------------------

The output is:
##################
Standard: Standard.DLMS
Security: Security.AUTHENTICATION_ENCRYPTION
System title: 0F 0E 0D 0C 0B 0A 09 08
Authentication key: D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
Block cipher key: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
TX: 23:22:15 7E A0 08 02 21 21 93 05 D1 7E
RX: 23:22:16 7E A0 1F 21 02 21 73 56 F4 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E
TX: 23:22:16 7E A0 2C 02 21 21 10 17 2A 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 40 10 10 FF FF DA 74 7E
RX: 23:22:16 7E A0 38 21 02 21 30 84 D4 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 10 04 C8 00 07 6E 2F 7E
TX: 23:22:16 7E A0 1A 02 21 21 32 4E C7 E6 E6 00 C0 01 C1 00 01 00 00 2B 01 02 FF 02 00 0B B6 7E
RX: 23:22:16 7E A0 16 21 02 21 52 B9 95 E6 E7 00 C4 01 C1 00 06 00 00 07 21 FE 65 7E
Invocation counter: 1826
DisconnectRequest
TX: 23:22:16 7E A0 08 02 21 21 53 09 17 7E
RX: 23:22:16 7E A0 08 21 02 21 73 CA 70 7E
TX: 23:22:16 7E A0 08 02 21 05 93 56 95 7E
RX: 23:22:16 7E A0 1F 05 02 21 73 E9 09 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E
TX: 23:22:16 7E A0 6C 02 21 05 10 66 AF E6 E6 00 60 5D A1 09 06 07 60 85 74 05 08 01 03 A6 0A 04 08 0F 0E 0D 0C 0B 0A 09 08 8A 02 07 80 8B 07 60 85 74 05 08 02 05 AC 12 80 10 37 B0 72 9F 6F 32 AA 17 D5 A2 EF D4 18 34 31 B2 BE 23 04 21 21 1F 30 00 00 07 22 8F D5 16 B1 24 CC BD BA E7 E1 66 3E D3 AD B6 E5 54 9B 17 F4 AA 9D 4D 33 25 BB 9D 1C 7E
RX: 23:22:17 7E A0 78 05 02 21 30 19 E8 E6 E7 00 61 69 A1 09 06 07 60 85 74 05 08 01 03 A2 03 02 01 00 A3 05 A1 03 02 01 0E A4 0A 04 08 53 41 47 67 30 01 8B 7B 88 02 07 80 89 07 60 85 74 05 08 02 05 AA 12 80 10 40 37 54 39 42 50 32 46 4A 27 5C 57 2C 4B 4B 3E BE 23 04 21 28 1F 30 00 00 07 37 E6 73 6D 60 DB 3E C3 31 81 8E E4 22 C1 4B 2C 42 15 CD 6D D4 C5 0B B1 28 DD E2 BD 87 7E
TX: 23:22:17 7E A0 49 02 21 05 32 B3 EB E6 E6 00 DB 08 0F 0E 0D 0C 0B 0A 09 08 31 30 00 00 07 23 2D 61 00 91 82 0F E4 15 D6 2E F9 CD FC E1 A0 00 45 0C E8 C6 D3 85 CA A6 A7 3B E6 E9 A4 9F 4F 52 21 6C C0 DF D9 5E 59 CE FB 11 33 FB BE 1C 7E
RX: 23:22:17 7E A0 2E 05 02 21 52 F7 E6 E6 E7 00 DB 08 53 41 47 67 30 01 8B 7B 16 30 00 00 07 38 06 E7 28 D9 F3 8F 1D 81 8A BA 04 CE C0 C2 BC 1C F8 66 1A 7E
DisconnectRequest
TX: 23:22:17 7E A0 08 02 21 05 53 5A 53 7E
RX: 23:22:17 7E A0 08 05 02 21 73 75 8D 7E
##########################

Thanks,

Image
Profile picture for user Kurumi

Kurumi

5 years 10 months ago

Hi,

Hi,

You must increase the Invocation counter by one after you read it from the meter.
Now you don't do it. You are using the same value that you read from the meter.

BR,
Mikko

HERO

5 years 10 months ago

Hi,

Hi,

How can I increase the Invocation counter ?
I read the Invocation counter from the object and it seems that it increases automatically.

Thanks,

HERO

5 years 10 months ago

I add this part to increase

I add this part to increase the Invocation counter:

self.client.ciphering.invocationCounter += 1

I added it after readeing from the meter but it cannot read meter data objects.
Also I tried to add it before reading but still.

Thanks,

Profile picture for user Kurumi

Kurumi

5 years 10 months ago

Hi,

Hi,

Meter is using a custom challenge. Meters don't usually use it and we improved this. There is a new version 1.0.87. Update to that and let me know if you have any problems.

BR,
Mikko

HERO

5 years 10 months ago

Hi ,

Hi ,

Thank you for the update.

I used the update and set the meter parameter as below:
------------------------------
self.client.useLogicalNameReferencing = True
self.iec = False
#self.client.autoIncreaseInvokeID = True

self.invocationCounter = "0.0.43.1.2.255"
GXDLMSObject.validateLogicalName(self.invocationCounter)

self.client.authentication = Authentication.HIGH_GMAC
self.client.ciphering.security = Security.AUTHENTICATION_ENCRYPTION

self.client.ciphering.systemTitle = GXByteBuffer.hexToBytes("0F0E0D0C0B0A0908")
self.client.ctoSChallenge = "00000001".encode()

self.client.standard = Standard.DLMS

self.client.clientAddress = 2
self.client.serverAddress = 144
------------------------------------

But the problem it still.

The output:
################################
Authentication: Authentication.HIGH_GMAC
ClientAddress: 0x2
ServerAddress: 0x90
Standard: Standard.DLMS
Security: Security.AUTHENTICATION_ENCRYPTION
System title: 0F 0E 0D 0C 0B 0A 09 08
Authentication key: D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
Block cipher key: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
TX: 14:39:17 7E A0 08 02 21 21 93 05 D1 7E
RX: 14:39:17 7E A0 1F 21 02 21 73 56 F4 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E
TX: 14:39:17 7E A0 2C 02 21 21 10 17 2A 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 40 10 10 FF FF DA 74 7E
RX: 14:39:17 7E A0 38 21 02 21 30 84 D4 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 10 04 C8 00 07 6E 2F 7E
TX: 14:39:17 7E A0 1A 02 21 21 32 4E C7 E6 E6 00 C0 01 C1 00 01 00 00 2B 01 02 FF 02 00 0B B6 7E
RX: 14:39:17 7E A0 16 21 02 21 52 B9 95 E6 E7 00 C4 01 C1 00 06 00 00 08 69 7A 28 7E
Invocation counter: 2154
DisconnectRequest
TX: 14:39:17 7E A0 08 02 21 21 53 09 17 7E
RX: 14:39:18 7E A0 08 21 02 21 73 CA 70 7E
TX: 14:39:18 7E A0 08 02 21 05 93 56 95 7E
RX: 14:39:18 7E A0 1F 05 02 21 73 E9 09 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E
TX: 14:39:18 7E A0 64 02 21 05 10 46 F5 E6 E6 00 60 55 A1 09 06 07 60 85 74 05 08 01 03 A6 0A 04 08 0F 0E 0D 0C 0B 0A 09 08 8A 02 07 80 8B 07 60 85 74 05 08 02 05 AC 0A 80 08 30 30 30 30 30 30 30 31 BE 23 04 21 21 1F 30 00 00 08 6A E8 D4 F7 99 B2 B5 40 6A DC AD 31 61 33 2D 24 B9 BF 37 A6 88 1E 2C 16 58 EC 1E EF B0 7E
RX: 14:39:18 7E A0 70 05 02 21 30 39 B2 E6 E7 00 61 61 A1 09 06 07 60 85 74 05 08 01 03 A2 03 02 01 00 A3 05 A1 03 02 01 0E A4 0A 04 08 53 41 47 67 30 01 8B 7B 88 02 07 80 89 07 60 85 74 05 08 02 05 AA 0A 80 08 4C 5C 54 30 4E 37 5E 53 BE 23 04 21 28 1F 30 00 00 08 7B 47 B2 F3 10 0C 43 E0 71 6B 08 C9 CB B9 F1 76 D3 DB 59 D3 D6 EC C9 6C A6 F7 70 8E 76 7E
TX: 14:39:18 7E A0 49 02 21 05 32 B3 EB E6 E6 00 DB 08 0F 0E 0D 0C 0B 0A 09 08 31 30 00 00 08 6B 57 E0 16 2D 12 3B E2 F7 89 71 A7 C2 C7 45 EE A7 94 60 EB DF 24 BC E6 F6 64 1F DF 4D FA 3E ED DF F4 8B AC 31 78 DE 9A A2 EE FA 47 77 DC B8 7E
RX: 14:39:18 7E A0 2E 05 02 21 52 F7 E6 E6 E7 00 DB 08 53 41 47 67 30 01 8B 7B 16 30 00 00 08 7C 6B E2 B9 EB 0C 95 E9 1D 8A 76 0A F8 0B BE 9D C3 77 B7 CB 7E
DisconnectRequest
TX: 14:39:18 7E A0 08 02 21 05 53 5A 53 7E
RX: 14:39:18 7E A0 08 05 02 21 73 75 8D 7E
###################################################################

Profile picture for user Kurumi

Kurumi

5 years 10 months ago

Hi,

Hi,

Can you add GXDLMSDirector trace here?

BR,
Mikko

HERO

5 years 10 months ago

Hi,

Hi,

This is the trace from GXDLMSDirector:

-------------------------------------------------------
15:54:10 03:54:10.940 Info Opening
15:54:10 03:54:10.940 Info Serial Port Settings: Port Name: COM15 Baud Rate: 9600 Data Bits: 8 Parity: None Stop Bits: One Flow Control: None Eop: None
15:54:10 03:54:10.956 Info Open
15:54:11 Send SNRM request.
TX: 7E A0 08 02 21 21 93 05 D1 7E
15:54:11 03:54:11.971 Sent 7E A0 08 02 21 21 93 05 D1 7E
15:54:12 03:54:12.034 Received 7E A0 1F 21 02 21 73 56 F4
15:54:12 03:54:12.049 Received F4 81 80 12 05 01 80 06
15:54:12 03:54:12.065 Received 08 04 00 00 00 01 53 3B
15:54:12
RX: 7E A0 1F 21 02 21 73 56 F4 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E
15:54:12 Send AARQ request.
TX: 7E A0 2C 02 21 21 10 17 2A 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 1D FF FF C5 E4 7E
15:54:12 03:54:12.065 Sent 7E A0 2C 02 21 21 10 17 2A 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 1D FF FF C5 E4 7E
15:54:12 03:54:12.174 Received 7E A0 38 21 02 21 30 84
15:54:12 03:54:12.190 Received 84 D4 E6 E7 00 61 29 A1
15:54:12 03:54:12.206 Received 08 01 01 A2 03 02 01 00 A3 05 A1 03 02 01 00
15:54:12 03:54:12.237 Received BE 10 04 0E 08 00 06 5F 1F 04 00 00 12 19 04 C8
15:54:12 03:54:12.252 Received 00 07 5C 76
15:54:12
RX: 7E A0 38 21 02 21 30 84 D4 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 12 19 04 C8 00 07 5C 76 7E
15:54:12 03:54:12.252 Sent 7E A0 1A 02 21 21 32 4E C7 E6 E6 00 C0 01 C1 00 01 00 00 2B 01 02 FF 02 00 0B B6 7E
15:54:12 03:54:12.346 Received 7E A0 16 21 02 21 52 B9 95 E6 E7 00 C4 01
15:54:12 03:54:12.362 Received 01 C1 00 06 00 00 08 6F 4C 4D
15:54:12
RX: 7E A0 16 21 02 21 52 B9 95 E6 E7 00 C4 01 C1 00 06 00 00 08 6F 4C 4D 7E
15:54:12 Disconnect request
TX: 7E A0 08 02 21 21 53 09 17 7E
15:54:12 03:54:12.362 Sent 7E A0 08 02 21 21 53 09 17 7E
15:54:12 03:54:12.444 Received 7E A0 08 21 02 21 73 CA 70 7E
15:54:12
RX: 7E A0 08 21 02 21 73 CA 70 7E
15:54:12 Send SNRM request.
TX: 7E A0 08 02 21 05 93 56 95 7E
15:54:12 03:54:12.445 Sent 7E A0 08 02 21 05 93 56 95 7E
15:54:12 03:54:12.508 Received 7E A0
15:54:12 03:54:12.525 Received A0 1F 05 02 21 73 E9 09 81 80 12 05 01 80
15:54:12 03:54:12.540 Received 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B
15:54:12
RX: 7E A0 1F 05 02 21 73 E9 09 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E
15:54:12 Send AARQ request.
TX: 7E A0 75 02 21 05 10 42 4A E6 E6 00 60 66 A1 09 06 07 60 85 74 05 08 01 03 A6 0A 04 08 0F 0E 0D 0C 0B 0A 09 08 8A 02 07 80 8B 07 60 85 74 05 08 02 05 AC 0A 80 08 30 30 30 30 30 30 30 31 BE 34 04 32 21 30 30 00 00 08 70 BE 32 78 63 21 41 53 C5 9A 1C 79 9A 23 42 4B CB 47 33 87 1A F5 32 CC 06 2A D6 CF 06 47 79 CF AD 12 20 F2 16 8C 8B 86 47 9D 63 06 09 60 7E
15:54:12 03:54:12.543 Sent 7E A0 75 02 21 05 10 42 4A E6 E6 00 60 66 A1 09 06 07 60 85 74 05 08 01 03 A6 0A 04 08 0F 0E 0D 0C 0B 0A 09 08 8A 02 07 80 8B 07 60 85 74 05 08 02 05 AC 0A 80 08 30 30 30 30 30 30 30 31 BE 34 04 32 21 30 30 00 00 08 70 BE 32 78 63 21 41 53 C5 9A 1C 79 9A 23 42 4B CB 47 33 87 1A F5 32 CC 06 2A D6 CF 06 47 79 CF AD 12 20 F2 16 8C 8B 86 47 9D 63 06 09 60 7E
15:54:12 03:54:12.733 Received 7E A0 70 05 02 21 30 39 B2 E6 E7
15:54:12 03:54:12.749 Received E7 00 61 61 A1 09
15:54:12 03:54:12.764 Received 03 02 01 00 A3 05 A1 03 02 01 0E A4 0A 04 08
15:54:12 03:54:12.780 Received 53 41 47 67 30 01 8B 7B 88 02 07 80 89 07 60
15:54:12 03:54:12.796 Received 85 74 05 08 02 05 AA 0A 80 08 52 3D 36 35 48 5E
15:54:12 03:54:12.812 Received 5B 50 BE 23 04 21 28 1F 30 00 00 08 80 F4 A2
15:54:12 03:54:12.828 Received 3E 87 35 65 C2 0C AE 6D 3E FF 4E DF 8F 1C AE
15:54:12 03:54:12.844 Received 9A 62 F3 5E FA D9 A9 F3 8E 18 43
15:54:12
RX: 7E A0 70 05 02 21 30 39 B2 E6 E7 00 61 61 A1 09 06 07 60 85 74 05 08 01 03 A2 03 02 01 00 A3 05 A1 03 02 01 0E A4 0A 04 08 53 41 47 67 30 01 8B 7B 88 02 07 80 89 07 60 85 74 05 08 02 05 AA 0A 80 08 52 3D 36 35 48 5E 5B 50 BE 23 04 21 28 1F 30 00 00 08 80 F4 A2 3E 87 35 65 C2 0C AE 6D 3E FF 4E DF 8F 1C AE 9A 62 F3 5E FA D9 A9 F3 8E 18 43 7E
15:54:12 Authenticating.
TX: 7E A0 40 02 21 05 32 D7 BA E6 E6 00 CB 31 30 00 00 08 73 67 E1 2F 04 D8 2D AB 8F 7A 71 5B 96 E9 A6 65 89 8F 6F 5A F7 D7 33 D0 B8 F4 D9 8E 72 31 C7 3C 0A 45 FC C4 9A 72 43 0E AA FF 93 EF 0C DA 36 7E
15:54:12 03:54:12.845 Sent 7E A0 40 02 21 05 32 D7 BA E6 E6 00 CB 31 30 00 00 08 73 67 E1 2F 04 D8 2D AB 8F 7A 71 5B 96 E9 A6 65 89 8F 6F 5A F7 D7 33 D0 B8 F4 D9 8E 72 31 C7 3C 0A 45 FC C4 9A 72 43 0E AA FF 93 EF 0C DA 36 7E
15:54:12 03:54:12.971 Received 7E A0 39
15:54:12 03:54:12.987 Received 39 05 02 21 52 6B 62 E6 E7 00 CF 2A 30 00
15:54:13 03:54:13.003 Received 82 DA 91 CC BD 6D 88 E0 71 5F 9E 9C 19 AF AC
15:54:13 03:54:13.019 Received 3F B8 34 36 92 66 B3 FD 8B 46 E0 F0 BD A9 66
15:54:13 03:54:13.036 Received 3E 11 97 2C D3 B0 43 57 C4 8C
15:54:13
RX: 7E A0 39 05 02 21 52 6B 62 E6 E7 00 CF 2A 30 00 00 08 82 DA 91 CC BD 6D 88 E0 71 5F 9E 9C 19 AF AC 3F B8 34 36 92 66 B3 FD 8B 46 E0 F0 BD A9 66 3E 11 97 2C D3 B0 43 57 C4 8C 7E
---------------------------------------------------

Profile picture for user Kurumi

Kurumi

5 years 10 months ago

Hi,

Hi,

Try to add dedicated key:

self.client.ciphering.dedicatedKey = GXByteBuffer.hexToBytes("00112233445566778899AABBCCDDEEFF")

BR,
Mikko

HERO

5 years 10 months ago

Hi,

Hi,

I add these parts:
self.client.ciphering.authenticationKey = GXByteBuffer.hexToBytes("D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF")
self.client.ciphering.blockCipherKey = GXByteBuffer.hexToBytes("000102030405060708090A0B0C0D0E0F")
self.client.ciphering.dedicatedKey = GXByteBuffer.hexToBytes("00112233445566778899AABBCCDDEEFF")

But still the problem.

The output:
-------------------------------------------
System title: 0F 0E 0D 0C 0B 0A 09 08
Authentication key: D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
Block cipher key: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
Dedicated key: 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF
TX: 16:17:46 7E A0 08 02 21 21 93 05 D1 7E
RX: 16:17:46 7E A0 1F 21 02 21 73 56 F4 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E
TX: 16:17:46 7E A0 3D 02 21 21 10 13 95 E6 E6 00 60 2E A1 09 06 07 60 85 74 05 08 01 01 BE 10 04 1F 01 01 10 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF 00 00 06 5F 1F 04 00 40 10 10 FF FF 02 F3 7E
RX: 16:17:46 7E A0 2E 21 02 21 30 5C 5B E6 E7 00 61 1F A1 09 06 07 60 85 74 05 08 01 01 A2 03 02 01 01 A3 05 A1 03 02 01 01 BE 06 04 04 0E 01 06 00 CA 20 7E
DisconnectRequest
TX: 16:17:46 7E A0 08 02 21 05 53 5A 53 7E
RX: 16:17:46 7E A0 08 05 02 21 73 75 8D 7E
--------------------------------------------------

Profile picture for user Kurumi

Kurumi

5 years 10 months ago

Hi,

Hi,

You are not using authentication or ciphering as before. Add those parameters:
self.client.authentication = Authentication.HIGH_GMAC
self.client.ciphering.security = Security.AUTHENTICATION_ENCRYPTION

BR,
Mikko

HERO

5 years 10 months ago

Hi,

Hi,

I already added it in the code but still.

Thanks,

Profile picture for user Kurumi

Kurumi

5 years 10 months ago

Hi,

Hi,

Can you add trace so I can compare bytes?

BR,
Mikko

HERO

5 years 10 months ago

Hi,

Hi,

The output in reply#17 is with HIGH_GMAC Authentication and AUTHENTICATION_ENCRYPTION Ciphering (I didn't mention in the reply before but it is in the code).

The output:
-------------------------------------------
System title: 0F 0E 0D 0C 0B 0A 09 08
Authentication key: D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
Block cipher key: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
Dedicated key: 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF
TX: 16:17:46 7E A0 08 02 21 21 93 05 D1 7E
RX: 16:17:46 7E A0 1F 21 02 21 73 56 F4 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E
TX: 16:17:46 7E A0 3D 02 21 21 10 13 95 E6 E6 00 60 2E A1 09 06 07 60 85 74 05 08 01 01 BE 10 04 1F 01 01 10 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF 00 00 06 5F 1F 04 00 40 10 10 FF FF 02 F3 7E
RX: 16:17:46 7E A0 2E 21 02 21 30 5C 5B E6 E7 00 61 1F A1 09 06 07 60 85 74 05 08 01 01 A2 03 02 01 01 A3 05 A1 03 02 01 01 BE 06 04 04 0E 01 06 00 CA 20 7E
DisconnectRequest
TX: 16:17:46 7E A0 08 02 21 05 53 5A 53 7E
RX: 16:17:46 7E A0 08 05 02 21 73 75 8D 7E
--------------------------------------------------

See the output in reply#13 without determining dedicated key.

The successful output for the DXDLMSDirector in reply#14

Thanks,

HERO

5 years 10 months ago

Hi,

Hi,

Sorry, the successful output for the DXDLMSDirector in reply#15

Thanks,

Profile picture for user Kurumi

Kurumi

5 years 10 months ago

Hi,

Hi,

In #17 and #21 is dedicated key, but it is without ciphering or authentication.

Put the ciphering and GMAC authentication back.

BR,

Mikko

HERO

5 years 10 months ago

Hi,

Hi,

All were with ciphering and GMAC authentication. I didn't remove them for any test.

Thanks,

Profile picture for user Kurumi

Kurumi

5 years 10 months ago

Hi,

Hi,

This is #21 message and it's not ciphered:
http://www.gurux.fi/GuruxDLMSTranslator?translate=7EA03D022121101395E6E…

This is from #15 and it's ciphered.
http://www.gurux.fi/GuruxDLMSTranslator?translate=7EA07502210510424AE6E…

Check your changes.

BR,
Mikko

HERO

5 years 10 months ago

Hi ,

Hi ,

Test #1: use ciphering, Authentication and FrameCounter
----------------------------------------------------------
self.client.useLogicalNameReferencing = True
self.trace = TraceLevel.VERBOSE
self.iec = False
self.invocationCounter = "0.0.43.1.2.255"
GXDLMSObject.validateLogicalName(self.invocationCounter)
self.media = GXSerial(None)
self.media.port = "COM15"
self.media.baudrate = BaudRate.BAUD_RATE_9600
self.media.bytesize = 8
self.media.parity = Parity.NONE
self.media.stopbits = StopBits.ONE

self.client.authentication = Authentication.HIGH_GMAC
self.client.ciphering.security = Security.AUTHENTICATION_ENCRYPTION

self.client.ciphering.systemTitle = GXByteBuffer.hexToBytes("0F0E0D0C0B0A0908")
self.client.ciphering.authenticationKey = GXByteBuffer.hexToBytes("D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF")
self.client.ciphering.blockCipherKey = GXByteBuffer.hexToBytes("000102030405060708090A0B0C0D0E0F")
self.client.ciphering.dedicatedKey = GXByteBuffer.hexToBytes("00112233445566778899AABBCCDDEEFF")

self.client.ctoSChallenge = "00000001".encode()
self.client.clientAddress = 2
self.client.serverAddress = 144
----------------------------------------------------------

The output #1:
####################################################
Authentication: Authentication.HIGH_GMAC
ClientAddress: 0x2
ServerAddress: 0x90
Standard: Standard.DLMS
Security: Security.AUTHENTICATION_ENCRYPTION
System title: 0F 0E 0D 0C 0B 0A 09 08
Authentication key: D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
Block cipher key: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
Dedicated key: 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF
TX: 12:00:54 7E A0 08 02 21 21 93 05 D1 7E
RX: 12:00:55 7E A0 1F 21 02 21 73 56 F4 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E
TX: 12:00:55 7E A0 3D 02 21 21 10 13 95 E6 E6 00 60 2E A1 09 06 07 60 85 74 05 08 01 01 BE 10 04 1F 01 01 10 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF 00 00 06 5F 1F 04 00 40 10 10 FF FF 02 F3 7E
RX: 12:00:55 7E A0 2E 21 02 21 30 5C 5B E6 E7 00 61 1F A1 09 06 07 60 85 74 05 08 01 01 A2 03 02 01 01 A3 05 A1 03 02 01 01 BE 06 04 04 0E 01 06 00 CA 20 7E
DisconnectRequest
TX: 12:00:55 7E A0 08 02 21 05 53 5A 53 7E
RX: 12:00:55 7E A0 08 05 02 21 73 75 8D 7E
####################################################

HERO

5 years 10 months ago

Test #2: use ciphering and

Test #2: use ciphering and Authentication . (without FrameCounter)
----------------------------------------------------------
self.client.useLogicalNameReferencing = True
self.trace = TraceLevel.VERBOSE
self.iec = False

self.media = GXSerial(None)
self.media.port = "COM15"
self.media.baudrate = BaudRate.BAUD_RATE_9600
self.media.bytesize = 8
self.media.parity = Parity.NONE
self.media.stopbits = StopBits.ONE

self.client.authentication = Authentication.HIGH_GMAC
self.client.ciphering.security = Security.AUTHENTICATION_ENCRYPTION

self.client.ciphering.systemTitle = GXByteBuffer.hexToBytes("0F0E0D0C0B0A0908")
self.client.ciphering.authenticationKey = GXByteBuffer.hexToBytes("D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF")
self.client.ciphering.blockCipherKey = GXByteBuffer.hexToBytes("000102030405060708090A0B0C0D0E0F")
self.client.ciphering.dedicatedKey = GXByteBuffer.hexToBytes("00112233445566778899AABBCCDDEEFF")

self.client.ctoSChallenge = "00000001".encode()

self.client.clientAddress = 2
self.client.serverAddress = 144
----------------------------------------------------------

The output #2:
####################################################
Authentication: Authentication.HIGH_GMAC
ClientAddress: 0x2
ServerAddress: 0x90
Standard: Standard.DLMS
Security: Security.AUTHENTICATION_ENCRYPTION
System title: 0F 0E 0D 0C 0B 0A 09 08
Authentication key: D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
Block cipher key: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
Dedicated key: 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF
TX: 12:11:37 7E A0 08 02 21 05 93 56 95 7E
RX: 12:11:37 7E A0 1F 05 02 21 73 E9 09 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E
TX: 12:11:37 7E A0 75 02 21 05 10 42 4A E6 E6 00 60 66 A1 09 06 07 60 85 74 05 08 01 03 A6 0A 04 08 0F 0E 0D 0C 0B 0A 09 08 8A 02 07 80 8B 07 60 85 74 05 08 02 05 AC 0A 80 08 30 30 30 30 30 30 30 31 BE 34 04 32 21 30 30 00 00 00 00 CB EB F2 7A 9F 6D 49 C6 CA C6 65 8C CE 5B 56 85 0F 17 AD 79 07 02 54 96 C3 85 64 E3 DB 93 91 88 AE 91 79 10 32 8E 14 E6 CD E2 F9 2B C6 7E
RX: 12:11:37 7E A0 66 05 02 21 30 E1 3D E6 E7 00 61 57 A1 09 06 07 60 85 74 05 08 01 03 A2 03 02 01 01 A3 05 A1 03 02 01 01 A4 0A 04 08 53 41 47 67 30 01 8B 7B 88 02 07 80 89 07 60 85 74 05 08 02 05 AA 0A 80 08 53 25 37 20 30 50 35 5E BE 19 04 17 2E 15 30 00 00 08 A8 17 94 2D C6 67 EE 0F 1B 73 E9 F6 20 9C 5D D1 96 5E 1C 7E
DisconnectRequest
TX: 12:11:37 7E A0 08 02 21 05 53 5A 53 7E
RX: 12:11:37 7E A0 08 05 02 21 73 75 8D 7E
####################################################

HERO

5 years 10 months ago

Test #3: use ciphering (but

Test #3: use ciphering (but without determining dedicated key) , Authentication and FrameCounter.
----------------------------------------------------
self.client.useLogicalNameReferencing = True
self.trace = TraceLevel.VERBOSE
self.iec = False
self.invocationCounter = "0.0.43.1.2.255"
GXDLMSObject.validateLogicalName(self.invocationCounter)

self.media = GXSerial(None)
self.media.port = "COM15"
self.media.baudrate = BaudRate.BAUD_RATE_9600
self.media.bytesize = 8
self.media.parity = Parity.NONE
self.media.stopbits = StopBits.ONE

self.client.authentication = Authentication.HIGH_GMAC
self.client.ciphering.security = Security.AUTHENTICATION_ENCRYPTION

self.client.ciphering.systemTitle = GXByteBuffer.hexToBytes("0F0E0D0C0B0A0908")
self.client.ciphering.authenticationKey = GXByteBuffer.hexToBytes("D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF")
self.client.ciphering.blockCipherKey = GXByteBuffer.hexToBytes("000102030405060708090A0B0C0D0E0F")

self.client.ctoSChallenge = "00000001".encode()

self.client.clientAddress = 2
self.client.serverAddress = 144
----------------------------------------------------

The output #3:
###########################################
Authentication: Authentication.HIGH_GMAC
ClientAddress: 0x2
ServerAddress: 0x90
Standard: Standard.DLMS
Security: Security.AUTHENTICATION_ENCRYPTION
System title: 0F 0E 0D 0C 0B 0A 09 08
Authentication key: D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
Block cipher key: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
TX: 12:19:43 7E A0 08 02 21 21 93 05 D1 7E
RX: 12:19:43 7E A0 1F 21 02 21 73 56 F4 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E
TX: 12:19:43 7E A0 2C 02 21 21 10 17 2A 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 40 10 10 FF FF DA 74 7E
RX: 12:19:44 7E A0 38 21 02 21 30 84 D4 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 10 04 C8 00 07 6E 2F 7E
TX: 12:19:44 7E A0 1A 02 21 21 32 4E C7 E6 E6 00 C0 01 C1 00 01 00 00 2B 01 02 FF 02 00 0B B6 7E
RX: 12:19:44 7E A0 16 21 02 21 52 B9 95 E6 E7 00 C4 01 C1 00 06 00 00 08 8F 42 AA 7E
Invocation counter: 2192
DisconnectRequest
TX: 12:19:44 7E A0 08 02 21 21 53 09 17 7E
RX: 12:19:44 7E A0 08 21 02 21 73 CA 70 7E
TX: 12:19:44 7E A0 08 02 21 05 93 56 95 7E
RX: 12:19:44 7E A0 1F 05 02 21 73 E9 09 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E
TX: 12:19:44 7E A0 64 02 21 05 10 46 F5 E6 E6 00 60 55 A1 09 06 07 60 85 74 05 08 01 03 A6 0A 04 08 0F 0E 0D 0C 0B 0A 09 08 8A 02 07 80 8B 07 60 85 74 05 08 02 05 AC 0A 80 08 30 30 30 30 30 30 30 31 BE 23 04 21 21 1F 30 00 00 08 90 61 70 0E 51 C9 4E 92 17 DB C4 3B C0 5B 8C 13 13 08 E5 78 00 13 C2 E3 7D ED 49 96 CB 7E
RX: 12:19:44 7E A0 70 05 02 21 30 39 B2 E6 E7 00 61 61 A1 09 06 07 60 85 74 05 08 01 03 A2 03 02 01 00 A3 05 A1 03 02 01 0E A4 0A 04 08 53 41 47 67 30 01 8B 7B 88 02 07 80 89 07 60 85 74 05 08 02 05 AA 0A 80 08 3A 57 4A 48 38 32 52 39 BE 23 04 21 28 1F 30 00 00 08 AB AB AA 33 9E E4 41 17 64 91 40 93 8D 15 D2 EF 8E 3D 6A 64 2F 36 B3 C8 1D 32 4A 6B C7 7E
TX: 12:19:44 7E A0 49 02 21 05 32 B3 EB E6 E6 00 DB 08 0F 0E 0D 0C 0B 0A 09 08 31 30 00 00 08 91 E5 49 05 46 1A 4F 44 11 49 B2 7C A9 3F 6D 5E 9F 9F DD 68 2F 87 D5 12 88 11 56 73 4E 5D AC 32 DA 32 F2 17 03 01 12 37 15 F3 EE E0 75 D7 2C 7E
RX: 12:19:45 7E A0 2E 05 02 21 52 F7 E6 E6 E7 00 DB 08 53 41 47 67 30 01 8B 7B 16 30 00 00 08 AC 5F 6D 73 7B 54 21 59 2B 34 BF B5 73 6C 37 9D DE 29 60 60 7E
DisconnectRequest
TX: 12:19:45 7E A0 08 02 21 05 53 5A 53 7E
RX: 12:19:45 7E A0 08 05 02 21 73 75 8D 7E
###########################################

HERO

5 years 10 months ago

Test #4: use ciphering (with

Test #4: use ciphering (with determining InvocationCounter) and Authentication. (without FrameCounter)
----------------------------------------------------
self.client.useLogicalNameReferencing = True
self.trace = TraceLevel.VERBOSE
self.iec = False

self.media = GXSerial(None)
self.media.port = "COM15"
self.media.baudrate = BaudRate.BAUD_RATE_9600
self.media.bytesize = 8
self.media.parity = Parity.NONE
self.media.stopbits = StopBits.ONE

self.client.authentication = Authentication.HIGH_GMAC
self.client.ciphering.security = Security.AUTHENTICATION_ENCRYPTION

self.client.ciphering.systemTitle = GXByteBuffer.hexToBytes("0F0E0D0C0B0A0908")
self.client.ciphering.authenticationKey = GXByteBuffer.hexToBytes("D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF")
self.client.ciphering.blockCipherKey = GXByteBuffer.hexToBytes("000102030405060708090A0B0C0D0E0F")
self.client.ciphering.dedicatedKey = GXByteBuffer.hexToBytes("00112233445566778899AABBCCDDEEFF")
self.client.ciphering.invocationCounter = 2194

self.client.ctoSChallenge = "00000001".encode()

self.client.clientAddress = 2
self.client.serverAddress = 144
----------------------------------------------------

The output #4:
###########################################
Authentication: Authentication.HIGH_GMAC
ClientAddress: 0x2
ServerAddress: 0x90
Standard: Standard.DLMS
Security: Security.AUTHENTICATION_ENCRYPTION
System title: 0F 0E 0D 0C 0B 0A 09 08
Authentication key: D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
Block cipher key: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
Dedicated key: 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF
TX: 12:21:25 7E A0 08 02 21 05 93 56 95 7E
RX: 12:21:25 7E A0 1F 05 02 21 73 E9 09 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E
TX: 12:21:25 7E A0 75 02 21 05 10 42 4A E6 E6 00 60 66 A1 09 06 07 60 85 74 05 08 01 03 A6 0A 04 08 0F 0E 0D 0C 0B 0A 09 08 8A 02 07 80 8B 07 60 85 74 05 08 02 05 AC 0A 80 08 30 30 30 30 30 30 30 31 BE 34 04 32 21 30 30 00 00 08 92 E0 F5 EC B5 50 BF 34 83 13 C3 CD 33 A4 DA CA 36 8F 1C 6E C7 4D 04 25 88 67 1E F7 C1 26 8C 2C 94 B9 CC A2 AF F9 D5 0C FB 6E 4B B9 82 6A 7E
RX: 12:21:25 7E A0 70 05 02 21 30 39 B2 E6 E7 00 61 61 A1 09 06 07 60 85 74 05 08 01 03 A2 03 02 01 00 A3 05 A1 03 02 01 0E A4 0A 04 08 53 41 47 67 30 01 8B 7B 88 02 07 80 89 07 60 85 74 05 08 02 05 AA 0A 80 08 2C 26 35 51 5C 54 48 34 BE 23 04 21 28 1F 30 00 00 08 AD 56 ED 6F 0D BB 02 DB D4 51 F1 3E 26 42 A8 D5 FA A8 EC A9 44 90 F6 DB 4D 68 E8 BB DC 7E
TX: 12:21:25 7E A0 40 02 21 05 32 D7 BA E6 E6 00 CB 31 30 00 00 08 93 BC 8C FD 07 39 EB D3 98 E7 CA 63 AF 1D 57 77 85 D7 D3 11 63 89 4B 08 54 65 C9 64 79 7C 2A BE 44 C2 E2 0E 3C FA 56 D3 24 4D 02 C4 94 57 66 7E
RX: 12:21:26 7E A0 25 05 02 21 52 1B A1 E6 E7 00 CF 16 30 00 00 08 AE 9B EC 53 61 52 1D 42 22 EC 20 75 75 9E F2 B3 7F 91 54 B2 7E
DisconnectRequest
TX: 12:21:26 7E A0 08 02 21 05 53 5A 53 7E
RX: 12:21:26 7E A0 08 05 02 21 73 75 8D 7E
###########################################

HERO

5 years 10 months ago

Hi,

Hi,

These are 4 different tests.

Thanks,

Profile picture for user Kurumi

Kurumi

5 years 10 months ago

Hi,

Hi,

There is a one new release. Update to it and let me know if you have any problems.
http://gurux.fi/node/16502

BR,
Mikko

HERO

5 years 10 months ago

Hi,

Hi,

Thanks for the update. I will test it.

HERO

5 years 10 months ago

Hi,

Hi,

I test is but the problem is still.

in the code HighMac Authentication, AuthenticationEncryption Security, FrameCounter and Challenge are set.

The output:
------------------------------------------------
Authentication: Authentication.HIGH_GMAC
ClientAddress: 0x2
ServerAddress: 0x90
Standard: Standard.DLMS
Security: Security.AUTHENTICATION_ENCRYPTION
System title: 0F 0E 0D 0C 0B 0A 09 08
Authentication key: D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
Block cipher key: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
Dedicated key: 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF
TX: 14:42:15 7E A0 08 02 21 21 93 05 D1 7E
RX: 14:42:15 7E A0 1F 21 02 21 73 56 F4 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E
TX: 14:42:15 7E A0 2C 02 21 21 10 17 2A 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 40 10 10 FF FF DA 74 7E
RX: 14:42:15 7E A0 38 21 02 21 30 84 D4 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 10 04 C8 00 07 6E 2F 7E
TX: 14:42:15 7E A0 1A 02 21 21 32 4E C7 E6 E6 00 C0 01 C1 00 01 00 00 2B 01 02 FF 02 00 0B B6 7E
RX: 14:42:15 7E A0 16 21 02 21 52 B9 95 E6 E7 00 C4 01 C1 00 06 00 00 08 C9 70 8D 7E
Invocation counter: 2250
DisconnectRequest
TX: 14:42:15 7E A0 08 02 21 21 53 09 17 7E
RX: 14:42:15 7E A0 08 21 02 21 73 CA 70 7E
TX: 14:42:15 7E A0 08 02 21 05 93 56 95 7E
RX: 14:42:16 7E A0 1F 05 02 21 73 E9 09 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E
TX: 14:42:16 7E A0 75 02 21 05 10 42 4A E6 E6 00 60 66 A1 09 06 07 60 85 74 05 08 01 03 A6 0A 04 08 0F 0E 0D 0C 0B 0A 09 08 8A 02 07 80 8B 07 60 85 74 05 08 02 05 AC 0A 80 08 30 30 30 30 30 30 30 31 BE 34 04 32 21 30 30 00 00 08 CA E9 8E 10 17 62 C1 F2 D3 88 1B A8 9F B7 80 B4 64 7E 6E 9C AF 7C A5 4C 85 1C FB D1 08 7E 08 57 94 8E 42 BC D4 39 75 7C A0 0E B3 D4 22 65 7E
RX: 14:42:16 7E A0 70 05 02 21 30 39 B2 E6 E7 00 61 61 A1 09 06 07 60 85 74 05 08 01 03 A2 03 02 01 00 A3 05 A1 03 02 01 0E A4 0A 04 08 53 41 47 67 30 01 8B 7B 88 02 07 80 89 07 60 85 74 05 08 02 05 AA 0A 80 08 3A 3E 39 47 3C 23 26 47 BE 23 04 21 28 1F 30 00 00 08 FA 6C EC F9 0F F0 A0 61 95 C9 25 89 4D 4D 70 FA 7B E8 F0 F6 F5 70 17 23 BF 76 14 DD 84 7E
TX: 14:42:16 7E A0 49 02 21 05 32 B3 EB E6 E6 00 DC 08 0F 0E 0D 0C 0B 0A 09 08 31 30 00 00 08 CB 56 44 1D FC 20 EF A6 9C 57 C7 17 7C DC E6 80 F7 50 66 C3 EA 21 B4 D0 B3 48 7B 3E 0A 7E DF 3F 8A 54 08 CA 81 60 02 81 64 7F 35 39 18 C8 BD 7E
RX: 14:42:16 7E A0 2E 05 02 21 52 F7 E6 E6 E7 00 DC 08 53 41 47 67 30 01 8B 7B 16 30 00 00 00 01 A7 E6 2A 0B 81 F8 B4 52 28 F8 46 60 0E 62 6B 13 7F AE 46 7E
DisconnectRequest
TX: 14:42:16 7E A0 08 02 21 05 53 5A 53 7E
RX: 14:42:16 7E A0 08 05 02 21 73 75 8D 7E
------------------------------------------------

Thanks,

Profile picture for user Kurumi

Kurumi

5 years 10 months ago

Hi,

Hi,

Find updateFrameCounter method from GXDLMSReader.py and comment on this line:
#self.client.proposedConformance |= Conformance.GENERAL_PROTECTION

BR,

Mikko

HERO

5 years 10 months ago

Hi,

Hi,

I did the comment for the line from GXDLMSReader.py file:
#self.client.proposedConformance |= Conformance.GENERAL_PROTECTION

But the problem is still.

The output:
-----------------------------------------------------
Authentication: Authentication.HIGH_GMAC
ClientAddress: 0x2
ServerAddress: 0x90
Standard: Standard.DLMS
Security: Security.AUTHENTICATION_ENCRYPTION
System title: 0F 0E 0D 0C 0B 0A 09 08
Authentication key: D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
Block cipher key: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
Dedicated key: 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF
TX: 15:49:19 7E A0 08 02 21 21 93 05 D1 7E
RX: 15:49:20 7E A0 1F 21 02 21 73 56 F4 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E
TX: 15:49:20 7E A0 2C 02 21 21 10 17 2A 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 10 10 FF FF F8 B5 7E
RX: 15:49:20 7E A0 38 21 02 21 30 84 D4 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 10 04 C8 00 07 6E 2F 7E
TX: 15:49:20 7E A0 1A 02 21 21 32 4E C7 E6 E6 00 C0 01 C1 00 01 00 00 2B 01 02 FF 02 00 0B B6 7E
RX: 15:49:20 7E A0 16 21 02 21 52 B9 95 E6 E7 00 C4 01 C1 00 06 00 00 08 D9 F1 9D 7E
Invocation counter: 2266
DisconnectRequest
TX: 15:49:20 7E A0 08 02 21 21 53 09 17 7E
RX: 15:49:20 7E A0 08 21 02 21 73 CA 70 7E
TX: 15:49:20 7E A0 08 02 21 05 93 56 95 7E
RX: 15:49:20 7E A0 1F 05 02 21 73 E9 09 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E
TX: 15:49:20 7E A0 75 02 21 05 10 42 4A E6 E6 00 60 66 A1 09 06 07 60 85 74 05 08 01 03 A6 0A 04 08 0F 0E 0D 0C 0B 0A 09 08 8A 02 07 80 8B 07 60 85 74 05 08 02 05 AC 0A 80 08 30 30 30 30 30 30 30 31 BE 34 04 32 21 30 30 00 00 08 DA 90 6E 3C 0B 2E 2F D3 8C 20 2A 8C 2A B2 31 38 B3 04 B3 B3 B9 AB E0 6E 7F 93 82 57 93 A5 27 38 3C FB 2C 18 E6 7D AA 18 9F 96 B8 41 64 83 7E
RX: 15:49:21 7E A0 70 05 02 21 30 39 B2 E6 E7 00 61 61 A1 09 06 07 60 85 74 05 08 01 03 A2 03 02 01 00 A3 05 A1 03 02 01 0E A4 0A 04 08 53 41 47 67 30 01 8B 7B 88 02 07 80 89 07 60 85 74 05 08 02 05 AA 0A 80 08 28 25 49 4B 44 31 43 5E BE 23 04 21 28 1F 30 00 00 09 0C 40 3A 14 B3 61 BA 78 4D 6A DC 9F A9 3E D4 E7 89 74 29 6E 08 69 14 ED EB A0 AC 1C 01 7E
TX: 15:49:21 7E A0 40 02 21 05 32 D7 BA E6 E6 00 CB 31 30 00 00 08 DB AB 30 DB 20 EC 6C E7 1E 3A C4 D5 D9 67 D1 BA 78 2F 9D 1F EB 2F 35 B1 44 00 CA 04 3A D1 3A C4 2B 2C 97 0E E7 1E F5 12 42 E5 B1 4B C2 F5 77 7E
RX: 15:49:21 7E A0 25 05 02 21 52 1B A1 E6 E7 00 CF 16 30 00 00 09 0D EA EE 28 89 33 5A C8 49 5D 16 A1 C4 21 73 17 23 61 6B AE 7E
DisconnectRequest
TX: 15:49:21 7E A0 08 02 21 05 53 5A 53 7E
RX: 15:49:21 7E A0 08 05 02 21 73 75 8D 7E
---------------------------------------------------------

Thanks,

HERO

5 years 9 months ago

Hi,

Hi,

I set the correct proposedConformance , but still I couldn't access the meter.

The output:
##########################################################
Authentication: Authentication.HIGH_GMAC
ClientAddress: 0x2
ServerAddress: 0x90
Standard: Standard.DLMS
Security: Security.AUTHENTICATION_ENCRYPTION
System title: 0F 0E 0D 0C 0B 0A 09 08
Authentication key: D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
Block cipher key: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
Dedicated key: 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF
TX: 13:58:25 7E A0 08 02 21 21 93 05 D1 7E
RX: 13:58:25 7E A0 08 02 21 21 93 05 D1 7E 7E A0 1F 21 02 21 73 56 F4 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E
aarqRequest
TX: 13:58:25 7E A0 2C 02 21 21 10 17 2A 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 FE 1F FF FF F7 E5 7E
RX: 13:58:25 7E A0 38 21 02 21 30 84 D4 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 12 1B 04 C8 00 07 D4 60 7E
------------
TX: 13:58:25 7E A0 1A 02 21 21 32 4E C7 E6 E6 00 C0 01 C1 00 01 00 00 2B 01 02 FF 02 00 0B B6 7E
RX: 13:58:25 7E A0 16 21 02 21 52 B9 95 E6 E7 00 C4 01 C1 00 06 00 00 09 F2 F8 1B 7E
Invocation counter: 2547
DisconnectRequest
TX: 13:58:25 7E A0 08 02 21 21 53 09 17 7E
RX: 13:58:25 7E A0 08 21 02 21 73 CA 70 7E
TX: 13:58:25 7E A0 08 02 21 05 93 56 95 7E
RX: 13:58:26 7E A0 1F 05 02 21 73 E9 09 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E
TX: 13:58:26 7E A0 75 02 21 05 10 42 4A E6 E6 00 60 66 A1 09 06 07 60 85 74 05 08 01 03 A6 0A 04 08 0F 0E 0D 0C 0B 0A 09 08 8A 02 07 80 8B 07 60 85 74 05 08 02 05 AC 0A 80 08 30 30 30 30 30 30 30 31 BE 34 04 32 21 30 30 00 00 09 F3 F4 7E 93 78 20 8B 58 6D 73 BD DE C7 B9 9E EE AB 1A EE B5 1B 44 C0 F5 5A 01 7C 49 CF E2 5F 46 AB C0 1D 8A 30 F0 1B DF BB 40 02 9D 85 F7 7E
RX: 13:58:26 7E A0 70 05 02 21 30 39 B2 E6 E7 00 61 61 A1 09 06 07 60 85 74 05 08 01 03 A2 03 02 01 00 A3 05 A1 03 02 01 0E A4 0A 04 08 53 41 47 67 30 01 8B 7B 88 02 07 80 89 07 60 85 74 05 08 02 05 AA 0A 80 08 42 2A 52 27 56 4B 20 20 BE 23 04 21 28 1F 30 00 00 0A 23 55 C0 61 96 6B EB 16 C2 1C EF 60 32 14 2B 57 90 2A 72 13 60 57 14 61 FD 59 18 8A 17 7E
getApplicationAssociationRequest
TX: 13:58:26 7E A0 40 02 21 05 32 D7 BA E6 E6 00 CB 31 30 00 00 09 F4 2B EA 2F 21 CC 71 C7 6E E0 61 E3 C7 CF 5C BE 22 25 38 21 E8 4D C8 37 91 38 29 EC 1A CA BA BA EA 98 07 7D A7 56 5A BE 00 27 9E BA A9 62 04 7E
RX: 13:58:26 7E A0 25 05 02 21 52 1B A1 E6 E7 00 CF 16 30 00 00 0A 24 FE B1 2E CC CC E3 EF F8 DE 73 B4 00 2B 9D E6 33 A4 59 48 7E
DisconnectRequest
TX: 13:58:26 7E A0 08 02 21 05 53 5A 53 7E
RX: 13:58:26 7E A0 08 02 21 05 53 5A 53 7E 7E A0 08 05 02 21 73 75 8D 7E
###################################################################

I think the problem is in the ApplicationAssociationRequest.

You can check the correct output (from GXDLMSDirector) in reply #15

Thanks,

Profile picture for user Kurumi

Kurumi

5 years 9 months ago

Hi,

Hi,

What version from GXDLMSDirector you are using?

BR,
Mikko

HERO

5 years 9 months ago

Hi,

Hi,

The last version 8.2.2007.0602

Image

HERO

5 years 9 months ago

Hi,

Hi,

I tried to solve the problem by comparing the Gurux.DLMS C# libraries with Gurux.DLMS Python libraries.
I found that in GXDLMSClient file in getApplicationAssociationRequest() method there one difference which is:

C#
if (Settings.Cipher != null)
{
++Settings.Cipher.InvocationCounter;
ic = Settings.Cipher.InvocationCounter;
}
--------------
Python
if self.settings.cipher:
ic = self.settings.cipher.invocationCounter
-------------

The increment of InvocationCounter. So I add the increment in Python:
if self.settings.cipher:
self.settings.cipher.invocationCounter += 1
ic = self.settings.cipher.invocationCounter

Then after run the code, it seem that it succeeded but when it tried to get logical objects, their value are None or ValueError: Invalid Logical name.
The part of the output is shown in the image attached.

Help me the solve it.

Thanks,

Image

HERO

5 years 9 months ago

Hi,

Hi,

Thank you for the update.

It works successfully.

Profile picture for user Kurumi

Kurumi

5 years 9 months ago

Hi,

Hi,

Thank you from letting me know. Happy programming.

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