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 3 months 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 3 months 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 3 months 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

  • Mon, 07/27/2026 - 12:37
    gurux.dlms.cpp 9.0.2607.2701
  • Thu, 07/23/2026 - 16:19
    gurux.dlms.java 4.0.96
  • Thu, 07/09/2026 - 14:34
    Gurux.DLMS.Python 1.0.201
  • Fri, 06/26/2026 - 16:32
    Gurux.Service 3.0.2606.2601
  • Wed, 06/24/2026 - 08:36
    Gurux.DLMS.Python 1.0.200

New forum topics

  • Service not known error on gprs communication
  • Help Needed: Interfacing Saral 100 Energy Meter with Microcontroller via RS232
  • Connecting Meter to Agent via serial
  • Reading block profile with Compact array
  • DLMS server - serving multiple similar datasets gathered from multiple meters across distinct logical addresses
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin