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.cpp, Unable To Set Up High Authentication With Crystal Meter

Gurux.DLMS.cpp, unable to set up High authentication with Crystal meter

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 Anton.S , 16 September, 2018
Forums
Gurux.DLMS

I am trying to connect using CPP sample to Indian meter from Crystal manufacturer,

I am able to successfully connect and read data with Low authentication,
also I am able to successfully connect with High auth from Director application,
but High authentication fails with CPP sample tool:

./gurux.dlms.client.bin -h 192.168.0.14 -p3333 -w -c 48 -s 1 -a High -Paaaaaaaaaaaaaaaa
InitializeConnection

and it just exits

trace.txt

<- 20:23:19 00 01 00 30 00 01 00 5F 60 5D A1 09 06 07 60 85 74 05 08 01 03 A6 0A 04 08 47 52 58 31 32 33 34 35 8A 02 07 80 8B 07 60 85 74 05 08 02 02 AC 12 80 10 67 C6 69 73 51 FF 4A EC 29 CD BA AB F2 FB E3 46 BE 23 04 21 21 1F 30 00 00 00 00 8C 28 D3 C6 52 00 22 36 FA 36 99 B3 D2 60 43 5C EF EF 9D DE 1C 51 34 73 9C D2
-> 20:23:19 00 01 00 01 00 30 00 6B 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 43 52 59 00 00 00 FA DC 88 02 07 80 89 07 60 85 74 05 08 02 02 AA 12 80 10 23 E8 DB 9B 8A 03 EA D6 D5 F7 AA F1 0A 4B 30 9A BE 23 04 21 28 1F 30 00 00 00 01 6B 14 A0 B9 64 0A C8 60 F1 3D 80 26 CD CB 25 46 97 D4 BA 52 03 03 33 04 EE 0E
<- 20:23:19 00 01 00 30 00 01 00 38 CB 36 30 00 00 00 01 17 37 AB 55 A8 5D B1 5A 44 F0 04 E1 CD 31 D9 91 5B 71 7E 15 71 D5 98 C7 5E 68 59 11 7E FE 80 4A 06 55 7C A8 75 2C 56 67 B5 66 C2 61 C3 77 E5 C1 E7
-> 20:23:19 00 01 00 01 00 30 00 00
<- 20:23:19 00 01 00 30 00 01 00 43 62 41 30 00 00 00 02 52 E3 6C 8A 18 B1 A7 E5 15 03 34 FF 6E EC 07 F2 DE EA 76 B4 06 F6 38 AE D6 1F 66 48 23 D0 F7 2D BA 68 4E AE A9 C6 B4 72 CA 0E 5C 51 DE EB F9 58 4E 5F FF AF CE 22 10 37 36 A0 A8 68
-> 20:23:19 00 01 00 01 00 30 00 02 63 00

Director log with successful connect using same parameters:

GXDLMSDirector 0.0.0.0
Log created 9:36:16 AM
9:36:58 AM Initializing Network connection.
9:36:58 AM Send AARQ request.
00 01 00 30 00 01 00 5F 60 5D A1 09 06 07 60 85 74 05 08 01 03 A6 0A 04 08 47 52 58 31 32 33 34 35 8A 02 07 80 8B 07 60 85 74 05 08 02 02 AC 12 80 10 38 54 26 4A 44 4F 50 2D 61 62 23 61 23 4F 35 60 BE 23 04 21 21 1F 30 00 00 00 00 8C 28 D3 C6 52 00 22 36 FA 36 99 B3 D2 60 43 5C EF EF 9D DE 1C 51 34 73 9C D2
9:36:59 AM
00 01 00 01 00 30 00 6B 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 43 52 59 00 00 00 FA DC 88 02 07 80 89 07 60 85 74 05 08 02 02 AA 12 80 10 7E 8B AE 56 B5 AF E2 B7 21 FB 4D 3F 4D 8F FE C6 BE 23 04 21 28 1F 30 00 00 00 01 6B 14 A0 B9 64 0A C8 60 F1 3D 80 26 CD CB 25 46 97 D4 BA 52 03 03 33 04 EE 0E
9:36:59 AM Parsing AARE reply succeeded.
9:36:59 AM Authenticating.
00 01 00 30 00 01 00 32 CB 30 30 00 00 00 01 34 B6 6A 54 A7 5D 72 73 C5 F0 F4 E0 CC 10 C9 30 B0 10 34 7C 3D 2D CE 97 34 D4 98 FE A9 16 59 FB C2 8E EC B6 FD 98 6A D6 14 6B AF
9:36:59 AM
00 01 00 01 00 30 00 2B CF 29 30 00 00 00 01 A4 15 67 E6 7A 0E C1 50 E2 B0 DD C9 E6 4B 4C 72 FE C1 F6 F8 13 B7 6D 9C D4 6F C4 2D A2 36 41 75 A1 A1 47 48

Looks like authentication requests differ in logs above

Source code in GuruxDLMSClientExample.cpp was modified in order to enable encryption,
these lines were added:

CGXDLMSSecureClient cl(useLogicalNameReferencing, clientAddress, serverAddress, authentication, password, interfaceType);
> CGXByteBuffer title;
> CGXByteBuffer key;
>
> title.Set("GRX12345", strlen("GRX12345"));
> key.Set("AAAAAAAAAAAAAAAA", strlen("AAAAAAAAAAAAAAAA"));

> cl.GetCiphering()->SetSystemTitle(title);
> cl.GetCiphering()->SetSecurity(DLMS_SECURITY_ENCRYPTION);

> if (authentication == DLMS_AUTHENTICATION_HIGH)
> cl.GetCiphering()->SetSecurity(DLMS_SECURITY_AUTHENTICATION_ENCRYPTION);

> cl.GetCiphering()->SetBlockCipherKey(key);
> cl.GetCiphering()->SetAuthenticationKey(key);

Profile picture for user Kurumi

Kurumi

7 years 6 months ago

Gurux.DLMS.cpp, unable to set up High authentication with Crysta

Hi,

It's hard to say what is the problem because messages are encrypted. Check your keys that they are correct. That is usually the reason.

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