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. AARQ HDLC Packet

AARQ HDLC packet

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 jan.kolar , 21 August, 2019
Forums
Gurux.DLMS

I am trying to communicate with Sanxing meter. This is communication log:

[06:58:27:767] - Open port COM11 (c:\elma\edex\dlms.exe)

[06:58:27:800] Written data (COM11)
2f 3f 21 0d 0a /?!..
[06:58:28:997] Read data (COM11)
2f 41 55 58 35 5c 32 53 58 35 41 32 53 45 4c 53 /AUX5\2SX5A2SELS
2d 30 47 50 30 31 34 0d 0a -0GP014..
[06:58:29:247] Written data (COM11)
06 32 35 32 0d 0a .252..
[06:58:29:794] Read data (COM11)
06 b2 35 b2 8d 0a .˛5˛Ť.
[06:58:29:794] Written data (COM11)
7e a0 0a 00 02 00 21 03 93 23 d4 7e ~ ....!.“#Ô~
[06:58:29:942] Read data (COM11)
7e a0 23 03 00 02 00 21 73 70 7b 81 80 14 05 02 ~ #....!sp{€...
00 72 06 02 01 e8 07 04 00 00 00 01 08 04 00 00 .r...č..........
00 01 0c b2 7e ...˛~
[06:58:29:942] Written data (COM11)
7e a0 4a 00 02 00 21 03 10 b6 a5 e6 e6 00 60 36 ~ J...!..¶Ąćć.`6
a1 09 06 07 60 85 74 05 08 01 01 8a 02 07 80 8b ˇ...`…t....Š..€‹
07 60 85 74 05 08 02 01 ac 0a 80 08 31 32 33 34 .`…t....¬.€.1234
35 36 37 38 be 10 04 0e 01 00 00 00 06 5f 1f 04 5678ľ........_..
00 00 1e 1d ff ff e6 e6 00 95 f9 7e ....˙˙ćć.•ů~

As you can see last packet is AARQ. What I do not understand when I copy this packet into your online DLMS translator (of course without ascii characters on the right) I get error "Message to XML failed. Invalid DLMS framing.". Also the meter doesnt response to AARQ packet with AARE. Can you please check if AARQ packet is correct ? I have parsed the above message and found no errors. All fields including CRC seems to be correct.

Profile picture for user Kurumi

Kurumi

6 years 9 months ago

Hi,

Hi,

There are invalid data at the end of the packet (e6 e6 00). Remove them.
BR,

Mikko

jan.kolar

6 years 9 months ago

Is this a bug in Gurux.dlms

Is this a bug in Gurux.dlms.cpp library ? I see these bytes are added in int CGXDLMS::GetLNPdu method.

Profile picture for user Kurumi

Kurumi

6 years 9 months ago

Hi,

Hi,

You are right we have broken this. I added an issue from this.
https://www.gurux.fi/node/13783

Then new version is on tests and it's released later today.

BR,

Mikko

BR,
Mikko

jan.kolar

6 years 9 months ago

In reply to Hi, by Kurumi

Thank you. I have also found

Thank you. I have also found another small error in GuruxDLMSClientExample project in method CGXCommunication::Read. When the overlapped operation fails because of timeout, you dont cancel read operation. I changed it like this:

//Wait until data is actually read
if (::WaitForSingleObject(m_osReader.hEvent, m_WaitTime) != WAIT_OBJECT_0)
{
(!CancelIo(m_hComPort))
{
return DLMS_ERROR_CODE_RECEIVE_FAILED;
}

GetOverlappedResult(m_hComPort, &m_osReader, &bytesRead, TRUE);
return DLMS_ERROR_CODE_RECEIVE_FAILED;
}

Without calling CancelIo later write operation will cause that first byte received from meter will be swallowed by background overlapped read operation. GetOverlappedResult is needed because CancelIo itself is asynchronous.

Profile picture for user Kurumi

Kurumi

6 years 9 months ago

Hi Ján,

Hi Ján,

Thank you from this info. Is this happening in Linux or Windows?
We'll check this.

BR,

Mikko

jan.kolar

6 years 9 months ago

Windows.

Windows.

Profile picture for user Kurumi

Kurumi

6 years 9 months ago

Hi Ján,

Hi Ján,

Thanks from this info. We'll make a test environment and test this. A new version was released yesterday.

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