Hi @armor. I have assumed you are asking how to embed a " character in a string within particle code.
I used the " (backslash) before the inserted " character.
This worked for me.
And for the embedded escaped double quotes don’t mind them.
Just have a look at the actual string via
Serial.print(dataStr);
BTW, what’s your target for that data? I’d think JSON key value pairs usually should be connected with colons (:) and individual pairs separated with commas (,).
This was exactly what I did first however " are showing in the CLI rather than " when I do a Particle Subscribe Mine. Is that the issue i.e. if I output to Serial with print it will appear OK?
In answer to your BTW - I have been asked to output the events in the following JSON like format:
Because the event data is represented as a string in the event object, any JSON characters in the string have to be escaped. Thus it shows as {\"a\":123} when it’s printed, but if you use that event data from something that understands JSON, like webhooks, or a node.js script, it’s handled properly. In other words, this is what a webhook would see: