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. Forums
  3. Authentication Required When Running Without Encryption

Authentication required when running without Encryption

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 AndreasAtPowel , 15 November, 2017
Forums
Gurux.DLMS

Hello
Earlier we have been able to switch between Security.Authentication and Security.AuthenticationEncryption without any problem. When we needed to debug and use Wireshark to look at the DLMS data we used to set Security.Authentication, and in production we used Security.AuthenticationEncryption. But now when we switch to Security.Authentication we get the error "Connection is permanently rejected. Authentication is required". We use Gurux.DLMS version 8.5.1709.1901.

The DLMS data looks like this:

char peer0_0[] = { /* Packet 2699 */
0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x5f,
0x60, 0x5d, 0xa1, 0x09, 0x06, 0x07, 0x60, 0x85,
0x74, 0x05, 0x08, 0x01, 0x03, 0xa6, 0x0a, 0x04,
0x08, 0x4d, 0x4d, 0x4d, 0x00, 0x00, 0xbc, 0x61,
0x4e, 0x8a, 0x02, 0x07, 0x80, 0x8b, 0x07, 0x60,
0x85, 0x74, 0x05, 0x08, 0x02, 0x05, 0xac, 0x12,
0x80, 0x10, 0xd7, 0xc3, 0xfa, 0xf2, 0x79, 0xa8,
0xd3, 0xa3, 0xef, 0xf1, 0xce, 0x60, 0x1e, 0x8a,
0x66, 0x3f, 0xbe, 0x23, 0x04, 0x21, 0x21, 0x1f,
0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x06, 0x5f, 0x1f, 0x04, 0x00, 0x00, 0x1f,
0x1f, 0x00, 0xc8, 0x01, 0x88, 0x28, 0x95, 0x12,
0xfc, 0x98, 0xa9, 0x9d, 0xc2, 0x26, 0xf6 };
char peer1_0[] = { /* Packet 2718 */
0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x2a,
0x61, 0x28, 0xa1, 0x09, 0x06, 0x07, 0x60, 0x85,
0x74, 0x05, 0x08, 0x01, 0x03, 0xa2, 0x03, 0x02,
0x01, 0x01, 0xa3, 0x05, 0xa1, 0x03, 0x02, 0x01,
0x0e, 0x89, 0x07, 0x60, 0x85, 0x74, 0x05, 0x08,
0x02, 0x05, 0xbe, 0x06, 0x04, 0x04, 0x0e, 0x01,
0x06, 0x00 };

We are running against Kaifa meters, and when we use their tool SmartSet we send the data successfully without encryption. So it should be able to send without encryption with Gurux as well.

Hope you can help us with this.

Regards
Helena

AndreasAtPowel

8 years 6 months ago

Hi again

Hi again

The reason why we want to run without encryption is because we need to see in Wireshark what we send when we try to set WeekProfile in the passive calendar in the meter. When we try this, we get the error "Device reports unmatched type". And when we set Week profile with Kaifas tool SmartSet we get no error. Maybe you have an idea why we get "Device reports unmatched type"?

Regards
Helena

AndreasAtPowel

8 years 6 months ago

Hi

Hi

I think I´ve found the problem why I can´t set Week profile in the meter. It was because the wrong DataType (Array) was set in GetWeekProfileTable(), When I changed to Structure it went ok.

static byte[] GetWeekProfileTable(GXDLMSSettings settings, GXDLMSWeekProfile[] target)
{
GXByteBuffer data = new GXByteBuffer();
data.SetUInt8((byte)DataType.Array);
if (target == null)
{
//Add count
GXCommon.SetObjectCount(0, data);
}
else
{
int cnt = target.Length;
//Add count
GXCommon.SetObjectCount(cnt, data);
foreach (GXDLMSWeekProfile it in target)
{
data.SetUInt8((byte)DataType.Structure);

Is this something that has been fixed in a later version of Gurux? Or is it maybe the meter that handles this wrong?

Regards
Helena

AndreasAtPowel

8 years 6 months ago

Hello

Hello

I also got the same error "Device reports unmatched type" when I tried to set SpecialDays table. But when I added DataType.Array as last argument to client.Method in Insert (GXDLMSSpecialDaysTable) it started working ok.
Is this a bug in Gurux, or am I doing something else wrong?

Regards
Helena

Profile picture for user Kurumi

Kurumi

8 years 6 months ago

Authentication required when running without Encryption

Hi,

You have secure the connection, but not use authentication (authentication is None). Set authentication and password and this will work.

BR,

Mikko

Profile picture for user Kurumi

Kurumi

8 years 6 months ago

Activity Calendar

Hi,

Sorry, in GetWeekProfileTable there should be one array that includes structures. I checked the source code and it seems to be correct. What array did you change to Structure? If it was this, there is an issue on the meter.

static byte[] GetWeekProfileTable(GXDLMSSettings settings, GXDLMSWeekProfile[] target)
{
GXByteBuffer data = new GXByteBuffer();
data.SetUInt8((byte)DataType.Array);

BR,

Mikko

AndreasAtPowel

8 years 6 months ago

Hi

Hi
No, I didn´t change that one. I changed this one from Array to Structure:

foreach (GXDLMSWeekProfile it in target)
{
data.SetUInt8((byte)DataType.Structure);

Regards
Helena

Profile picture for user Kurumi

Kurumi

8 years 6 months ago

Activity Calendar

Hi,

Check that you have the latest version. I just checked the source code and its Structure.

BR,

Mikko

AndreasAtPowel

8 years 6 months ago

Hi

Hi

I have updated to the latest version and I can see that it´s Structure, so that should be ok now.

What about GXDLMSSpecialDaysTable? I get the same error "Device reports unmatched type" when I try to set SpecialDays table. But when I added DataType.Array as last argument to client.Method in Insert (GXDLMSSpecialDaysTable) it started working ok.

public byte[][] Insert(GXDLMSClient client, GXDLMSSpecialDay entry)
{
GXByteBuffer bb = new GXByteBuffer();
bb.SetUInt8(DataType.Structure);
bb.SetUInt8(3);
GXCommon.SetData(null, bb, DataType.UInt16, entry.Index);
GXCommon.SetData(null, bb, DataType.OctetString, entry.Date);
GXCommon.SetData(null, bb, DataType.UInt8, entry.DayId);
return client.Method(this, 1, bb.Array(),DataType.Array);
}

Regards
Helena

Profile picture for user Kurumi

Kurumi

8 years 6 months ago

GXDLMSSpecialDaysTable

Hi,
You are right. This should be an array of GXDLMSSpecialDays. We'll fix this. The new version is released today.

BR,
Miko

Profile picture for user Kurumi

Kurumi

8 years 6 months ago

GXDLMSSpecialDaysTable

Hi,

This is fixed, tested and released. Get the latest version.

BR,

Mikko

AndreasAtPowel

8 years 6 months ago

Hi

Hi
Thank you for the new release.

I still can´t get the communication to work without Encryption. Could you maybe be more specific in what I need to change? This is how I try to create the client with Ciphering.Security set to Security.Authentication. But this will end up with the following error: "Authentication is required"

gxdlmsClient = new GXDLMSSecureClient(true, 0x01, 0x01, Authentication.HighGMAC,
authenticationSettings.UniqueSecret, InterfaceType.WRAPPER)
{
ProposedConformance = Conformance.Action |
Conformance.EventNotification |
Conformance.SelectiveAccess | Conformance.Set |
Conformance.Get | Conformance.InformationReport |
Conformance.MultipleReferences |
Conformance.BlockTransferWithAction |
Conformance.BlockTransferWithSetOrWrite |
Conformance.BlockTransferWithGetOrRead,
MaxReceivePDUSize = 0x00C8,
Password = authenticationSettings.UniqueSecret.ToByteArray(),
CtoSChallenge = GXDLMSTranslator.HexToBytes("D7C3FAF279A8D3A3EFF1CE601E8A663F")
};
if (authenticationSettings.InvocationCounter > 0)
{
((GXDLMSSecureClient)gxdlmsClient).Ciphering.InvocationCounter = authenticationSettings.InvocationCounter;
}
((GXDLMSSecureClient) gxdlmsClient).Ciphering.SystemTitle = authenticationSettings.SystemTitle.ToByteArray();
((GXDLMSSecureClient) gxdlmsClient).Ciphering.Security = Security.Authentication;
((GXDLMSSecureClient)gxdlmsClient).Ciphering.AuthenticationKey = authenticationSettings.AuthenticationKey.ToByteArray();
((GXDLMSSecureClient)gxdlmsClient).Ciphering.BlockCipherKey = authenticationSettings.UnicastKey.ToByteArray();

Regards
Helena

Profile picture for user Kurumi

Kurumi

8 years 6 months ago

Encryption

Hi,

Your settings seem to be right. Can you ask the vendor is HighGMAC authentication supported or should you use some other authentication level?

BR,

Mikko

AndreasAtPowel

8 years 6 months ago

Hi

Hi
HighGMAC is supported, that´s the common way that we communicate with the meters. But when I want to look at the DLMS packets with Wireshark I need to run without encryption. The question is, how can this be done?
Regards
Helena

Profile picture for user Kurumi

Kurumi

8 years 6 months ago

Authentication vs. Ciphering

Hi,

You can remove encryption if you set this:
client.Ciphering.Security = Security.None;

Authentication is used to tell what kind of access rights you have to the meter.
client.Authentication = Authentication.HighGMAC

Ciphering is used encrypt sent and received messages.

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