I set mine to 194 to allow for the JSON data and the strings
How to work this out on the fly for different sensor and outputs?
The main problem with the outputting is with serializeJsonPretty, this puts out a very long output with all those nice spaces and ^M at the end.
This seems to overrun the memory which is put into String result="";
I am not sure how the String object looks after its memory, or if you have to reserve memory for it yourself, and free it up afterwards etc.
You can specify how much to output in the serialze functions
I tried to output to a buffer and set a size limit on this