Hello,
I used GuruxDLMS.c running on ESP32 microcontroller, to read data from SL7000 meter.
I have success to read meter clock & serial number, for testing I read it every one second.
after run for several minutes, the microcontroller is crash. when I monitor the Free Heap, it show the heap used several bytes after we call "com_read" function, so the available heap decreased every we call it, and causes system reset when it reach the lower point.
is it normal? can we clear object or something to free the heap used after calling "com_read" function.
I try reading meter time (clock), and the value is read successfully, then print it to serial console, I use:
//Read clock.
ret = com_read(&clock1.base, 2);
if (ret != DLMS_ERROR_CODE_OK)
{
return;
}
Thank you Mikko,
I use this, the OBIS i get from GXDLMSDirector.
gxClock clock1;
cosem_init(&clock1.base, DLMS_OBJECT_TYPE_CLOCK, "0.0.1.0.0.255");
when I try to monitor the heap, befor and after calling "ret = com_read(&clock1.base, 2);", then subtract it, it use 144 bytes.
I try reading another value from the meter, for example I read the meter serial number using "com_read(&data1.base, 2);" it used different size.
and the free heap always decreased after we call it function, that use "com_read" inside,.
how about "var_clear()", is there any example usage of it?
You need to call var_clear for data and register if you -re-create object.
We found a memory leak issue from the client-side that is fixed and new version is released.
Get the latest version.
Hi,
Hi,
What value did you try to read? You should call var_clear after you have read the value.
BR,
Mikko
I try reading meter time
I try reading meter time (clock), and the value is read successfully, then print it to serial console, I use:
//Read clock.
ret = com_read(&clock1.base, 2);
if (ret != DLMS_ERROR_CODE_OK)
{
return;
}
Serial.printf("%02d-%02d-%04d %02d:%02d:%02d\r\n",
clock1.time.value.tm_mday,
clock1.time.value.tm_mon,
clock1.time.value.tm_year + 1900,
clock1.time.value.tm_hour,
clock1.time.value.tm_min,
clock1.time.value.tm_sec);
and the output is correct: "14-09-2019 16:15:50"
were I must put "var_clear()", and what value must be passed to it?
is there any example?
Regards,
Fery_rz
Hi,
Hi,
This looks correct. Are you creating clock by yourself or are you reading association view?
We'll check this right away.
BR,
Mikko
Thank you Mikko,
Thank you Mikko,
I use this, the OBIS i get from GXDLMSDirector.
gxClock clock1;
cosem_init(&clock1.base, DLMS_OBJECT_TYPE_CLOCK, "0.0.1.0.0.255");
when I try to monitor the heap, befor and after calling "ret = com_read(&clock1.base, 2);", then subtract it, it use 144 bytes.
I try reading another value from the meter, for example I read the meter serial number using "com_read(&data1.base, 2);" it used different size.
and the free heap always decreased after we call it function, that use "com_read" inside,.
how about "var_clear()", is there any example usage of it?
Best regards,
Fery
Hi
Hi
You need to call var_clear for data and register if you -re-create object.
We found a memory leak issue from the client-side that is fixed and new version is released.
Get the latest version.
Thank you for pointing this out.
BR,
Mikko