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. ReadObject Failed: Not Enough Memory Available.

ReadObject failed: Not enough memory available.

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 aashishkul , 16 March, 2021
Forums
Gurux.DLMS

I am trying to read ProfileGeneric 1.0.99.1.0.255:3 using DLMS C library. I get Not enough memory available. error.
Following is the communication log for your reference. (TX is data sent from C Application to meter, RX is response received from meter)

Meter is being read using TCP. HDLC Wrapper is enabled.

TX: 00 01 00 20 00 01 00 38 60 36 A1 09 06 07 60 85 74 05 08 01 01 8A 02 07 80 8B 07 60 85 74 05 08 02 01 AC 0A 80 08 41 42 43 44 30 30 30 31 BE 10 04 0E 01 00 00 00 06 5F 1F 04 00 00 1E 1D FF FF

RX: 00 01 00 01 00 20 00 2B 61 29 A1 09 06 07 60 85 74 05 08 01 01 A2 03 02 01 00 A3 05 A1 03 02 01 00 BE 10 04 0E 08 00 06 5F 1F 04 00 00 10 14 01 00 00 07

TX: 00 01 00 20 00 01 00 0D C0 01 81 00 07 01 00 63 01 00 FF 03 00

RX: 00 01 00 01 00 20 01 80 C4 01 81 00 01 15 02 04 12 00 08 09 06 00 00 01 00 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 01 1D 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 02 1D 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 05 1D 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 08 1D 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 06 1D 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 07 1D 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 09 1D 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 0A 1D 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 10 1D 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 8C 1D 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 97 1D 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 98 1D 00 FF 0F 02 12 00 00 02 04 12 00 01 09 06 01 00 60 05 04 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 20 1B 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 34 1B 00 FF 0F 02 12 00 00 02 04 12 00

ReadObject failed ProfileGeneric 1.0.99.1.0.255:3 Not enough memory available.

Profile picture for user Kurumi

Kurumi

5 years 2 months ago

Hi,

Hi,

You haven't read all the data yet. Meter says that the PDU size is 384 bytes and you have read only 298 bytes. Read data until reply->complete != 0.

BR,
Mikko

aashishkul

5 years 2 months ago

I am using the example app

I am using the example app which is in the library. It works fine when meter with serial interface is read. But when meter with Wrapper is read over TCP, it gives above error.

aashishkul

5 years 2 months ago

Source of this error is in

Source of this error is in communication.c
int readData(connection* connection, gxByteBuffer* data, int* index)
Following block of code causes out of memory error code to be returned.
uint32_t cnt = connection->data.capacity - connection->data.size;
if (cnt < 1)
{
return DLMS_ERROR_CODE_OUTOFMEMORY;
}
When this error occurs connection->data.capacity and connection->data.size both are same so cnt=0.

Profile picture for user Kurumi

Kurumi

5 years 2 months ago

Hi,

Hi,

Problem is that the meter tells that maximum PDU size is 256 bytes and the meter is sending 384 bytes. You need to ask the meter manufacturer to fix this.

In the mean time you can read your meter if you change this line in communication.c:
//Allocate 50 bytes more because some meters count this wrong and send few bytes too many.
con_initializeBuffers(connection, 50 + connection->settings.maxPduSize);

Change 50 to 200.
BR,
Mikko

aashishkul

5 years 2 months ago

Thanks, it worked.

Thanks, it worked.

  • 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