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. Send Large Data From Client Side To Meter

Send large data from client side to meter

Profile picture for user Dmitry
By Dmitry , 3 April, 2023
Forums
Gurux.DLMS

Hi, Mikko!

I try send large data from client to meter.

I do it:

CGXByteBuffer bb;
auto str = data_for_send.toByteArray().toStdString();
bb.AddString(str);
CGXDLMSVariant v(bb);
std::vector<CGXByteBuffer> data;
if(int ret=gcl->Write(obj, index, v, data); ret != 0)
{
qDebug().nospace() << "Failed generate message for write object " <<
obj->GetName().ToString().c_str() << " Error: " <<
CGXDLMSConverter::GetErrorMessage(ret);
}
else
{
send_data(data); // send data to meter
}

exchange:

TX: 7ea07f020161fc862ae6e600c10181000100006001feff02000963ef1c04e01080218025e0120881888189818a818b818c828883888488068b788178837889788e788d780c9f78b378c778a078b478c8789578a978bd789778ab78bf78028091809203e051e052e05305480112004802120048031200480412004801120189887e

RX: 7ea0086102019764e47e (UnacceptableFrame)

But if i send large data from anoter client (witout gurux lib) exchange like this:
TX1: 7ea878000200016170235fe6e600c101c1000100006001feff02000963ef1c04e01080218025e0120881888189818a818b818c828883888488068b788178837889788e788d780c9f78b378c778a078b478c8789578a978bd789778ab78bf78028091809203e051e052e05305480112004802120048031258117e

RX1:
7ea00a61000200013108947e

TX2: (send remaining data)
7ea01500020001617247db004804120048011201127c7e

RX2: OK

How can i split large data?
vector data has only 1 element after call Write() function.

Thanks!

Profile picture for user Dmitry

Dmitry

3 years 2 months ago

Data for send in hdlc packet…

Data for send in hdlc packet:
ef1c04e01080218025e0120881888189818a818b818c828883888488068b788178837889788e788d780c9f78b378c778a078b478c8789578a978bd789778ab78bf78028091809203e051e052e053054801120048021200480312004804120048011201

Profile picture for user Kurumi

Kurumi

3 years 2 months ago

Hi, The meter return maximum…

Hi,

The meter return maximum frame size when connection is establieshed using UA message. Your meter returns frame size that it can't handle. You need to fix that for the meter.

BR,
Mikko

Profile picture for user Dmitry

Dmitry

3 years 1 month ago

Hi, Mikko! I got 2 packets…

Hi, Mikko!

I got 2 packets in vector data after call Write() function. I send first packet and meter answer:

TX: 7ea875020161fc7647e6e600c10181000100006001feff02000963ef1c04e01080218025e0120881888189818a818b818c828883888488068b788178837889788e788d780c9f78b378c778a078b478c8789578a978bd789778ab78bf78028091809203e051e052e0530548011200480212004803c6997e

RX: 7ea008610201f154e27e //ok, need next frame

But how to parse this RX answer for send next part of data?

I call GetData(reply_buf, reply, notify) but reply.IsMoreData() returns false, reply.GetCommand() returns DLMS_COMMAND_NONE.

Thanks!

Profile picture for user Kurumi

Kurumi

3 years 1 month ago

Hi, You don't need to split…

Hi,

You don't need to split it. The wramework splits the data to PDUs and frames automatically for you.

Just add data that you want to write and call Write.

https://github.com/Gurux/Gurux.DLMS.cpp/blob/b779568dc96ccb07bba10a077c…

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