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. Forums
  3. HDLC - HLS With GMAC

HDLC - HLS with GMAC

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 MarioJ, 8 March, 2019
Forums
Gurux.Net

Hello,
first of all thanks for making a great job. In my project I try to connect with Elster device using optical port.
Using public clinet I'm able to read some data (I'm using GXDLMSReader for this). Unfortunatelly I'm not able to use Maintainer client. I know that device is using HLS with GMAC as Authentication. I set this parameters:
settings.client.InterfaceType = InterfaceType.HDLC;
settings.client.ClientAddress = 3;
settings.client.ServerAddress = 1;
settings.client.Ciphering.AuthenticationKey = new byte[] { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 };
settings.client.Ciphering.BlockCipherKey = new byte[] { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 };
settings.client.Authentication = Authentication.HighGMAC;
settings.client.Ciphering.Security = Security.Authentication;
But I'm not able to parse the response using ParseAAREResponse.
The response is: 61 2B A1 09 06 07 60 85 74 05 08 01 01 A2 03 02 01 01 A3 05 A1 03 02 01 01 A4 0A 04 08 93 15 55 46 27 33 25 03 BE 06 04 04 0E 01 06 00
Am I missing something ? Or I have to set some other parameter ?

Profile picture for user Kurumi

Kurumi

7 years 3 months ago

HDLC - HLS with GMAC

Hi,

Then try to read your meter first with GXDLMSDirector. It's easier to visualize your settings.
You can find all settings from "Secured connections" tab.

Try to set security to DLMS_SECURITY_AUTHENTICATION_ENCRYPTION.

BR,

Mikko

MarioJ

7 years 3 months ago

Thank you for your fast reply

Thank you for your fast reply. I try to use GXDLMSDirector but I don't see GMAC Authentication. Also I was not sure what to write in System title and Invocation Counter. Choosing DLMS_SECURITY_AUTHENTICATION_ENCRYPTION did not solve my probem. Can you give me some feedback ?

Image
Profile picture for user Kurumi

Kurumi

7 years 3 months ago

HDLC - HLS with GMAC

Hi,

GMac is new in Elster. Settings file is updated. Elster settings was last modified 2012.
Start GXDLMSDirector and update manufacturer settings selecting "New Manufacturer settings available" from top menu.

Set Invocation Counter to Zero.
System title is 8 bytes long hex string. Some manufacturers expect that it's constant. For some, it can be anything. Try with Gurux123

If connection fails, try to give meter serial number. Is you meter supporting Italian Standard (UNI)?
BR,
Mikko

MarioJ

7 years 3 months ago

I did as you said. Now I can

I did as you said. Now I can see GMAC. but after settings everything I get error as shown in image.
How to check if meter supporting Italian Standard (UNI) ?

Image
Profile picture for user Kurumi

Kurumi

7 years 3 months ago

Hi,

Hi,

After you change authentication level you need to re-read association view.

Is this error coming right away when you press connect, or is this error coming when you try to read something from the meter?

BR,
Mikko

MarioJ

7 years 3 months ago

I get this error when I press

I get this error when I press connect. I try to change security to AuthenticationEncryption but I get different error: "Invalid password. Server to Client challenge do not match". Setting security to Encryption gives this error: "ServiceError Initiate error exception. initiate IncompatibleConformance". Do I need to set anything else?

Profile picture for user Kurumi

Kurumi

7 years 3 months ago

Hi,

Hi,

AuthenticationEncryption looks correct. Your block cipher key or authentication key is wrong.

BR,

Mikko

MarioJ

7 years 3 months ago

Is there any way to confirm

Is there any way to confirm that keys are incorrect ? I get them from the company which device I'm using. When I send AARE I get as a response: 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

Profile picture for user Kurumi

Kurumi

7 years 3 months ago

I get this error when I press

Hi,

No. There is no way to check keys. Try to set Frame Counter to 0.1.43.1.1.255 like in pic.
You also need to set keys.

BR,

Mikko

Image

MarioJ

7 years 3 months ago

I set as you wrote but the

I set as you wrote but the result is the same

Image
Profile picture for user Kurumi

Kurumi

7 years 3 months ago

Hi,

Hi,

You should check the keys. I don't believe that they are the correct ones.
BR,
Mikko

MarioJ

7 years 2 months ago

they might be correct because

they might be correct because I try to use DLMS.Client.Example and I can send AARQ and parse AARE.
but I am not able to ReadDataBlock after GetApplicationAssociationRequest. Device does not respond after sending frame to it.

if (Client.IsAuthenticationRequired)
{
foreach (byte[] it in Client.GetApplicationAssociationRequest())
{
reply.Clear();
ReadDataBlock(it, reply); //<- no response here
}
Client.ParseApplicationAssociationResponse(reply.Data);
}
I try to talk with device company and they suggest that i'm not increasing frame counter when asking for: "0.0.40.0.0.255" But when I try to do that there is no change

Profile picture for user Kurumi

Kurumi

7 years 2 months ago

Hi,

Hi,

It's hard to say anything for sure, but you can try to set Invocation Counter (frame counter) to 0.

BR,

Mikko

MarioJ

7 years 2 months ago

The problem is fixed. Device

The problem is fixed. Device discard packet when whole Client.GetApplicationAssociationRequest() was encrypted. Thx for your help. Can you give me some other feedback ? How to execute action which include Script table ? I see there is GXDLMSDisconnectControl. Is it a good idea to use it with GXDLMSScriptAction ? And how to call it ?

Profile picture for user Kurumi

Kurumi

7 years 2 months ago

Hi Mario,

Hi Mario,

So if you send your application association request without encryption it works?

Create script table object and call Execute method.

GXDLMSScriptTable s = new GXDLMSScriptTable ("OBIS CODE");
data = s.execute(client, Index);

BR,
Mikko

MarioJ

7 years 2 months ago

Sending StoC cannot by

Sending StoC cannot by crypted or device will ignore it. Can you tell me how to execute an action with parametr? How to send a parameter to method ?

Profile picture for user Kurumi

Kurumi

7 years 1 month ago

Hi,

Hi,

Meter sends StoC and client sends CtoS. So your meter is not using encryption. Try to change "Security" from "AuthenticationEncrypt" to "None".
You can use GXDLMSClient and Method(GXDLMSObject item, int index, Object data) to execute wanted action.

BR,

Mikko

Remith

6 years 9 months ago

In reply to I get this error when I press by Kurumi

Hi Mikko,

Hi Mikko,
I am reading new type of L&T meter in the same way by setting Frame Counter LN. Its working in GXDLMSDirector.
But how to set this frame counter in Java application. I am unable to do this as it accept only long value. But I want to set "0.1.43.1.1.255"
setFrameCounter(final long value).
Please help me to do this.

Profile picture for user Kurumi

Kurumi

6 years 9 months ago

In reply to Hi Mikko, by Remith

Hi Remith,

Hi Remith,

Please, create a new topic if you have a new question.

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