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. How To Encode Authentication Mechanism Name As Octet String In AssociationLogicalName

How to encode authentication mechanism name as octet string in AssociationLogicalName

By lah, 22 April, 2025
Forums
Gurux.DLMS

Hi,

I am trying to enable/disable HLS security on E360 meter from Landis. I am having troubles with how to generate correct frame for GXDLMSAssociationLogicalName object. I am trying to write "AuthenticationMechanismName" (attribute 6) to the meter but I would need to encode it not as a struct but as an octet string, could you help me with that?

This is an output frame that I am currently getting:
C104C102000F0000280002FF0600004000002B0000FF0200020207110211101202F411051108110211011600

And this is how I achieved the above frame (in c# .net)
var associationLn = new GXDLMSAssociationLogicalName(logicalNameAssociation);
associationLn.AuthenticationMechanismName = new GXAuthenticationMechanismName
{
MechanismId = Authentication.Low,
};
var securitySetup = new GXDLMSSecuritySetup(logicalNameSecurity, shortNameSecurity)
{
};
securitySetup.SecurityPolicy |= SecurityPolicy.None;

var toWriteList = new List<KeyValuePa ir<GXDLMSObject, int>>
{
new (associationLn, 6),
new (securitySetup, 2)
};

var toWrite = _context.Client.WriteList(toWriteList);

This is a frame example that I would need to send to the meter for which I don't know how can I generate it with gurux library:
C104C002000F0000280002FF0600004000002B0000FF0200020907608574050802011600

I currently use version 9.0.2312.1401 of Gurux.DLMS nuget package.

Profile picture for user Kurumi

Kurumi

4 weeks 1 day ago

Hi, It looks like you want…

Hi,

It looks like you want to change the authentication level to High.
The content is correct, but it might be that your meter can't handle the structure.

Most meters use the structure defined in authentication_mechanism_name, but according to the DLMS standard, it can also be an octet-string.

Can you try to write only the association logical name like this:

var toWrite = _context.Client.Write(associationLn, 6);

Try this if you are getting an error:

GXReplyData reply = new GXReplyData();
ReadDataBlock(Client.Write("0.0.40.0.2.255", GXDLMSTranslator.HexToBytes("60857405080201"), DataType.OctetString, ObjectType.AssociationLogicalName, 6), reply);

BR,
Mikko

lah

4 weeks 1 day ago

Hi, E360 is a bit specific…

Hi,

E360 is a bit specific and it rejects the frame if data are sent as a struct. It also needs set request with list. Your second suggestion did produce the desired output but the meter does not work correctly if I write just the AssociationLn (it also wants security setup in same command)

However I managed to get desired output using this https://www.gurux.fi/Gurux.DLMS.Objects.custom and implementing just that specific attribute 6 on it as byte[] which produced the desired output, when calling Client.WriteList(), that meter accepts.

Thank you for your help, you can treat this topic as closed.

  • Log in or register to post comments
  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Tue, 05/20/2025 - 08:40
    gurux.dlms.c 9.0.2505.2001
  • Mon, 05/19/2025 - 10:19
    gurux.net.java 1.0.30
  • Mon, 05/19/2025 - 10:00
    gurux.dlms.c 9.0.2505.1901
  • Thu, 05/15/2025 - 16:26
    gurux.dlms.c 9.0.2505.1501
  • Wed, 05/14/2025 - 08:30
    gurux.dlms.c 9.0.2505.1401

New forum topics

  • Reading all "Data" object type parameter together
  • com_read getting failed for billing profile and instantaneous profile
  • Simulator connection closed
  • Regarding the dlms android project
  • Issue with "ServiceError Initiate Error exception. Service UNSUPPORTED"
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin