I'm wondering if anyone has had any success with getting values parsed from a json sent over mqtt and populated into usable variables. I'm using a Nano 33 IoT.
The ArduinoJson library claims to be able to do that, but I feel that I am not grasping the concepts well enough to apply it correctly.
I am able to read the contents of the message using:
but I would like to be able to expand on this and parse the JSON to extract the information, but I'm stuck.
I think I'm having conversion trouble. If there is an easier way of doing this please let me know. I'm open for options.
This is what I get when I send that test JSON from AWS.
And this is the function that is called when the MQTT comes in.
...as expected.
The issue I have is when I'm trying to implement the ArduinoJson.h:
There's something in my understanding that I'm missing. I tried to effectively replicate what was in one of the examples but it doesn't seem to be compatible with what I am trying to do.
In the example, they 'provide' the json[] for it to deserialise.... You can see how I've tried to replace the json in the example with (char)mqttClient.read(); and hoped it would work(?). I think I need to understand what I'm missing and why that can't be done.