I am trying to communicate Apex 150 Energy Meter over TCP with ANSI C stack; I am getting below error In getting association view
GetObjects failed Not enough memory available.
Whereas with same settings DLMS Director is able to read.
What else I have to do to make it work ?
We did run this against your trace file and there are no problems. We was able to read all 56 objects.
Are you running this on the microcontroller?
It might be that there is not enough heap to create all objects. If this is the problem, can you skip association view reading and create objects manually.
Ok but trace file is of DLMS Director it works fine their where as when I use sample DLMS Client using C in that case I am getting error.
No Micro controller, I am testing on my Laptop only.
cnt = connection->data.capacity - connection->data.size;
Above line returns error as data capacity and data size comes 306
How can I create objects manually to read profile generic OBIS code by skipping association view ?
Find this
//Allocate 50 bytes more because some meters count this wrong and send few bytes too many.
con_initializeBuffers(connection, 50 + connection->settings.maxPduSize);
and change it to:
con_initializeBuffers(connection, 50 + 1024);
Now you can read it even there is an issue on the meter.
Hi,
Hi,
Can you send GXDLMSSDirector trace to me by email. We can check this.
BR,
Mikko
Your mail Id Please.
Mail sent
Any updates sir ? Any
Any updates sir ? Any findings from log file ?
Hi,
Hi,
We did run this against your trace file and there are no problems. We was able to read all 56 objects.
Are you running this on the microcontroller?
It might be that there is not enough heap to create all objects. If this is the problem, can you skip association view reading and create objects manually.
BR,
Mikko
Ok but trace file is of DLMS
Ok but trace file is of DLMS Director it works fine their where as when I use sample DLMS Client using C in that case I am getting error.
No Micro controller, I am testing on my Laptop only.
cnt = connection->data.capacity - connection->data.size;
Above line returns error as data capacity and data size comes 306
How can I create objects manually to read profile generic OBIS code by skipping association view ?
I am trying like below code
I am trying like below code
const unsigned char ln[] = { 1,0,99,1,0,255 };
gxProfileGeneric reg_profile;
cosem_init2((gxObject*)®_profile, DLMS_OBJECT_TYPE_PROFILE_GENERIC, ln);
ret = com_read(connection, (gxObject*)®_profile, 3);
ret = com_read(connection, (gxObject*)®_profile, 2);
still I am getting error as below
ReadObject failed Profile Generic 1.0.99.1.0.255:2 Not enough memory available.
Hi,
Hi,
We was running this trace file in our simulator and then read data using ANSI C client.
Are you suing malloc? Have you made any changes for the code?
BR,
Mikko
I have only modified code of
I have only modified code of 'int com_readAllObjects(connection *connection)' by below code and passed connection settings statically as below
connection con;
gxByteBuffer item;
bb_init(&item);
con_init(&con, 0);
cl_init(&con.settings, 1, 32, 1, DLMS_AUTHENTICATION_LOW, "ABCD0001", DLMS_INTERFACE_TYPE_WRAPPER);
con.trace = GX_TRACE_LEVEL_VERBOSE;
con.data.capacity = 307;
int ret, opt = 0;
int port = 0;
char* address = NULL;
char* serialPort = NULL;
unsigned char iec = 0;
char* p, * readObjects = NULL;
int index, a, b, c, d, e, f;
if (readTcpIpConnection(&con, "192.168.0.1", 4059, readObjects) != 0)
{
printf("Error.");
}
ret = com_initializeConnection(connection);
if (ret != DLMS_ERROR_CODE_OK)
{
return ret;
}
const unsigned char ln[] = { 1,0,99,1,0,255 };
gxProfileGeneric reg_profile;
cosem_init2((gxObject*)®_profile, DLMS_OBJECT_TYPE_PROFILE_GENERIC, ln);
ret = com_read(connection, (gxObject*)®_profile, 3);
ret = com_read(connection, (gxObject*)®_profile, 2);
Hi,
Hi,
Can you run GuruxDLMSClientExample with parameters:
GuruxDLMSClientExample.exe -h 192.168.0.1 -p 4059 -c 32 -a Low -P ABCD0001
It should succeed to read all the data from the meter.
BR,
Mikko
Without any changes
Without any changes downloaded latest code from github ad run as suggested still error
Hi,
Hi,
We tested this with HDLC framing because it was in your log file. Now you have connected with WRAPPER.
I'll let you know as soon as I have more info.
BR,
Mikko
Hi,
Hi,
This is now tested with WRAPPER.
Meter say that max PDU size is 255 bytes and it sends 901 bytes in PDU.
http://www.gurux.fi/GuruxDLMSTranslator?translate=000100010020002B6129A…
Can you ask them to fix this?
Find this
//Allocate 50 bytes more because some meters count this wrong and send few bytes too many.
con_initializeBuffers(connection, 50 + connection->settings.maxPduSize);
and change it to:
con_initializeBuffers(connection, 50 + 1024);
Now you can read it even there is an issue on the meter.
BR,
Mikko