Skip to main content
Home
for DLMS smart meters

Main navigation

  • Home
  • Products
  • About us
  • Open Source
  • Community
  • Forum
  • Downloads
User account menu
  • Log in

Breadcrumb

  1. Home
  2. Invalid HDLC Frame: 10 Expected: 30 In Push Notification

Invalid HDLC Frame: 10 Expected: 30 in push notification

By kapilGaire, 10 October, 2024
Forums
Gurux DLMS for Java

Hi Mr Kurumi,

I am trying to decrypt the push notification frame

7ea06b8103109b10e6e700db08474f450000002960820052200000000b4bb6fce2d22f68b58a3de708de0a45b690d10bf2a2ac9a034fd3886fc6a5dc7cf8b67db461be5855dcb51dc32ba815c8692b41b4bad7a58bbaa45ab8f8e80526e0f610e34f50f090a2f6db5827cb647e

using the below code

String pushEventEncryptedHex="7ea06b8103109b10e6e700db08474f450000002960820052200000000b4bb6fce2d22f68b58a3de708de0a45b690d10bf2a2ac9a034fd3886fc6a5dc7cf8b67db461be5855dcb51dc32ba815c8692b41b4bad7a58bbaa45ab8f8e80526e0f610e34f50f090a2f6db5827cb647e";

GXDLMSSecureClient sc = new
GXDLMSSecureClient(true, 64, 1, Authentication.HIGH, null, InterfaceType.HDLC);

sc.getCiphering().setSecurity(Security.AUTHENTICATION_ENCRYPTION);

sc.getCiphering().setSystemTitle(GXCommon.hexToBytes("systemtitle"));

sc.setServerSystemTitle(GXCommon.hexToBytes("systemtitle"));
sc.getCiphering().setBlockCipherKey(GXCommon.hexToBytes("key"));
sc.getCiphering().setAuthenticationKey(GXCommon.hexToBytes("key"));

sc.getCiphering().setSecuritySuite(SecuritySuite.SUITE_0);

GXByteBuffer rd = new GXByteBuffer();

GXReplyData reply = new GXReplyData();

GXReplyData notify = new GXReplyData();

rd.set(Hex.decodeHex(pushEventEncryptedHex));

try {
boolean status = sc.getData(rd, reply, notify);
System.out.println(notify.getData().toHex(false,0));
System.out.println(reply.getData().toHex(false,0));
System.out.println(reply.getError());
System.out.println(gurux.common.GXCommon.bytesToHex(reply.getData().getData()));
if (reply.getError()!=0) {
throw new GXDLMSException(reply.getError());
}
} catch (InvalidKeyException | NoSuchAlgorithmException | NoSuchPaddingException |
InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException |
SignatureException e) {
throw new RuntimeException(e);
}

Getting the below Exception
INFO: Invalid HDLC Frame: 10 Expected: 30

Profile picture for user Kurumi

Kurumi

1 year 2 months ago

Hi, Check push listener for…

Hi,

Check push listener for parsing push messages.

https://github.com/Gurux/gurux.dlms.java/tree/master/gurux.dlms.push.li…

You can also use GXDLMSTranslator to convert received push messages to XML string. You can find an example for this in the same project.

BR,
Mikko

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Thu, 12/11/2025 - 13:22
    Gurux.DLMS.Python 1.0.194
  • Thu, 12/11/2025 - 11:01
    gurux.dlms.java 4.0.86
  • Wed, 12/10/2025 - 08:45
    gurux.dlms.java 4.0.85
  • Tue, 12/02/2025 - 10:21
    gurux.dlms.c 9.0.2512.0201
  • Mon, 12/01/2025 - 13:55
    Gurux.DLMS.Python 1.0.193

New forum topics

  • Gurux.Net
  • GXTIME Conversion Issue
  • DLMS Meter Gurux DLMS Director Properties
  • Using MAX3232 + FT232RL to Energy meter with GXDLMS Director
  • Incomplete Firmware Upgrade Process
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin