I wonder if you might explain that to me as I understand all I am doing is constructing a single json string containing multiple key value pairs?
JSON stores values in arrays, while your C code indeed sets it all to one string, thats not how JSON is meant to work. If you store it as a string you are not really takeing advantage of what JSON gives you.
A collection of name/value pairs. In various languages, this is realized as an object, record, struct, dictionary, hash table, keyed list, or associative array.
An ordered list of values. In most languages, this is realized as an array, vector, list, or sequence.
in C/C++ I would use an array for it, or perhaps a struct. A string in C is an array.
My structure starts and ends with braces, and has no other braces or brakets within to suggest it is an array containing arrays.
I mean to say that it would be more usefull if it was an associative array (or a class with objects) as thats how JSON kind of is supposed to be used. There is a few C/C++ libaries to handle JSON to, but I don't know if there is any Arduino specific ones
Going on what AWOL was saying, I have just tinkered with the following method;
That is much better then you start yes. And it might be more memory effecient then other methods.