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. 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

2 years 9 months 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

  • 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