It works ok for the first 12 times, then in teturns an empty json object.
I think it gets out of memory, because there are no destructors/garbage colletors, right? Or maybe something else is wrong in the code?
Please, can comeone help me to sort this out? Thanks.
The null/empty aJson string is returned by Serial.print(aJson.print(sensorType)); and also in the txt file i write using aJsdon.print(sensortype) as parameter in OpenWriteFile.
I've tried with
aJson.delete(objectname);
but got the same error.
At the moment I deleted everything and I'm writing the jSon string into the file by using
log_string=("{\"DATA\":\"%o\", \"DATA2":\"%d\", \"DATA3\":\"%e\", \"DATA4\":\"%k\"}");
log_string.replace("%o",STRINGTOWRITE); //and so on for all the values
It works and also give me a slightly smaller code footprint, even if it took me some time for preparing and converting the various values (doubles, datetime etc to write).
I think I'll use aJson library only for retrieving the data to be showed on a graphicval display on the arduino (and also by a windows app I'm writing in .net).
But if in case I'll have to rewrite the code also for aJson objects creation/writing, I hope to find out what's wrong with that code.
Thanks.