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. Incomplete Frame Detection Question - Causes RR Loop On Kamstrup

Incomplete frame detection question - causes RR loop on Kamstrup

By L0uisc_iot , 27 January, 2026
Forums
Gurux.DLMS

Hi Kurumi,

I’m using Gurux DLMS with HDLC and based part of my receive logic on the examples in the Gurux repository. In particular, I copied the pattern here (https://github.com/Gurux/Gurux.DLMS.Net/blob/751914f4a9a6fd504e5b8c6430…) where a reply is treated as “no data yet” when:

reply.Error == 0 && reply.Data.Size == 0

This generally works, but I ran into a subtle issue during disconnect handling, specifically with Kamstrup meters.

What I’m seeing:

When I send an HDLC Disconnect (DISC), the meter correctly replies with UA.

UA is a valid HDLC control frame and has no DLMS payload, so reply.Data.Size == 0.

Because reply.Error == 0 && reply.Data.Size == 0 matches, my code enters the loop that sends Receiver Ready (RR) / continuation frames.

This causes Gurux to think more data is expected, even though the link was cleanly disconnected.

The request and response is:

TX: 7E A0 07 21 25 53 E0 16 7E // DISC
RX: 7E A0 07 25 21 73 E3 33 7E // UA

GXDLMSDirector decodes this correctly as DISC / UA.

My question:

Is the (reply.Error == 0 && reply.Data.Size == 0) condition intended to be used only for I-frames / DLMS-level continuation, and not for HDLC control frames like UA?

Should user code explicitly check the HDLC frame type (UA/DISC/SNRM/etc.) and avoid sending RR / GetMoreData in those cases?

Or is this a limitation/bug in the example that should be guarded with additional checks?

My workaround is to add a bool parameter which I set to true when sending disconnect. I add it to the clause checking for empty data above so I don't enter the while loop if it is true and I received a valid frame with no data. This fixes the issue. I just want to confirm the intended pattern so I can use it if there is something more explicit.

Thanks — and thanks for the excellent library.

L0uisc_iot

3 months 4 weeks ago

Any comments/updates on this?

Any comments/updates on this?

Profile picture for user Kurumi

Kurumi

2 months 1 week ago

Hi, I'm sorry for this. This…

Hi,

I'm sorry for this. This was a specific version for one of the customers and was not planned to be added to GitHub.

Get the latest version. That will fix this.

BR,
Mikko

L0uisc_iot

2 months ago

Hi, this is in the latest…

Hi, this is in the latest version of the example in the Gurux.DLMS C# library still. No recent changes happened in that part of the code. Am I misunderstanding you? Which latest version do you refer to?

Profile picture for user Kurumi

Kurumi

2 months ago

Hi, I was too fast. This is…

Hi,

I was too fast. This is now available on GitHub.

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
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin