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. Node
  3. Gurux Dlms Data Collector Using Wirepas

Gurux Dlms data collector using wirepas

Profile picture for user psantosh
By psantosh , 4 August, 2023
Forums
Gurux.DLMS

Hi, i am using the gurux dlms data collector with wirepas , while i am using with HDLC i received the Connect command "7E A0 07 03 21 93 0F 01 7E" with client address 0x10 and while the reply is giving

"7E A0 1E 21 03 73 C3 7A 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E"

code went into the DataReceivedSP function and set the "received" flag as 1

in the below function

in app.c line no 173:
static int com_readSerialPort(
unsigned char eop)
{
char loopCount = 0;
//Read reply data.
frameData.size = 0;
frameData.position = 0;
#ifdef USE_HDLC
int pos;
unsigned char eopFound = 0;
unsigned short lastReadIndex = 0;
do
{
++loopCount;
if (received)
{
char i = (char)frameData.size;Usart_sendBuffer(&i, 1);//Search eop.
if (frameData.size > 5)
{
//Some optical strobes can return extra bytes.
for (pos = frameData.size - 1; pos != lastReadIndex; --pos)
{
if (frameData.data[pos] == eop)
{
eopFound = 1;
received = false;
break;
}
}
lastReadIndex = pos;
}
}
user_delay_ms(50);
} while (eopFound == 0 && loopCount != 4);
if (!eopFound)
{

return 1;
}
#else
do
{
++loopCount;
user_delay_ms(50);
} while (!received && loopCount != 4);
if (!received)
{
return 1;
}
received = false;
#endif //USE_HDLC
return DLMS_ERROR_CODE_OK;
}

Here i am struck here while the receive flag is high and this condition is not satisfing in it" if (frameData.size > 5)" can you please tell what is the issue

Regards
Santosh

Profile picture for user Administrator

Administrator

3 years ago

Hi, If you are reading data…

Hi,

If you are reading data from the serial port you need to change
Usart_sendBuffer to something that reads data from the serial port, not send it.

BR,
Mikko

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Wed, 08/26/2026 - 09:04
    Gurux.DLMS.Python 1.0.203
  • Mon, 08/17/2026 - 11:28
    Gurux.DLMS.Python 1.0.202
  • Mon, 08/17/2026 - 09:47
    gurux.dlms.cpp 9.0.2608.1701
  • Mon, 08/17/2026 - 09:25
    gurux.dlms.c 9.0.2608.1701
  • Mon, 07/27/2026 - 12:37
    gurux.dlms.cpp 9.0.2607.2701

New forum topics

  • Security vulnerability report — request for a private contact (GuruxDLMS.c / ANSI C)
  • Topic: Insufficient Memory Error When Reading Class 7 Profile Generic Objects
  • SN ReadResponse returns all-null values when response spans multiple HDLC frames
  • Gurux.Serial.Android 3.0.6 – CH340 (HL-340) USB-Serial Adapter Not Working,
  • Trying to talk to a L&G E360 meter (Using Python Gurux)
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin