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. Problem With Ciphering On GuruxDLMS.c

Problem with ciphering on GuruxDLMS.c

By mCr86 , 13 April, 2023
Forums
General discussion

Hi,

I am trying to establish a session using the "Management Client" through a custom PLC communication. Before that, I achieved the session through optical port. I had to fix some bugs, but I achieved establishing the "management client" session using GMAC with AUTHENTICATION AND ENCRYPTION and DLMS_INTERFACE_TYPE_HDLC_WITH_MODE_E interface.

Now I am doing the same but using the interface DLMS_INTERFACE_TYPE_PDU and with a hook that sends and receive the PDU from my PLC board through serial.

"Public client" works perfectly. But after updating the invocation counter I send the "management client" AARQ with the same security params used through optical port, the meter responds the AARE accepting the session but the library fails decrypting the AARE.

It is strange because debuging, I can see that it decrypts the "InitiateResponse" properly (08 00 06 5F 1F 04 00 40 1A 1D 04 00 00 07) but then it fails checking the NONSE:
if (memcmp(NONSE, input->data + input->size, 12) != 0)
{
ret = DLMS_ERROR_CODE_INVALID_TAG;
}

I am sure that I am using the same keys. In fact, the meter is responding an AARE accepting the session because I check it using DLMS Translator. And, If the keys are wrong at the client side, the meter responds AARE rejecting the session.

So, what could happen?
Could you help me?

Thanks!

mCr86

3 years 1 month ago

Solved. Was a bug reading…

Solved.
Was a bug reading the PDU from the modem PLC.
Thanks.

Profile picture for user Kurumi

Kurumi

3 years 1 month ago

Hi, Thanks for letting me…

Hi,

Thanks for letting me know this. I was wondering what might be the reason for this.

BR,
Mikko

mCr86

3 years 1 month ago

Thanks to you for your…

So far everything is working very well. I am using it in client mode and I have tested sessions with public, management and pre-established clients. And everything is going very well.

Thanks to you for your libraries, tools, and all the DLMS information you share.
It's all very useful!

Kind Regards,

Manuel

  • 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
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin