Dear Sir,
I am trying to read the Make Serial Number of Secure Meter Model Sprint 350 by Arduino ESP32. I am able to read the Mfr Name Obis code 0.0.96.1.1.255 with no issues but if I use the same code for Serial number I get a error to the extent that ESP32 restarts
The code is
cosem_init(BASE(ldn), DLMS_OBJECT_TYPE_DATA, "0.0.96.1.0.255"); // Serial No
com_read(BASE(ldn),2);
obj_toString(BASE(ldn), &data);
strcpy(str,data);
Serial2.print(str);
Soon I run this I get a error and ESP32 restarts.
DLMS Director shows as under
15:34:35 Read object type Data index: 2
TX: 7E A0 19 03 41 32 3A BD E6 E6 00 C0 01 C1 00 01 00 00 60 01 00 FF 02 00 89 A0 7E
15:34:35
RX: 7E A0 1A 41 03 52 E9 3D E6 E7 00 C4 01 C1 00 09 08 59 30 35 31 35 31 36 34 9F 71 7E
And value is read correctly.
Can you please advise me where am I going wrong.
Thanks and Regards
ASP
Hi, Why do you copy data to…
Hi,
Why do you copy data to str? The data is already a string. Have you allocated space for str? Try this instead.
char* data = NULL;
obj_toString(BASE(ldn), &data);
Serial2.print(data);
free(data);
BR,
Mikko