Hello guys!
We are using nRF9160 SiP module to transfer MQTT messages to AWS IoT. So far, thanks to the cloud_client example and your documentation from here, we were able to connect to AWS IoT server and transfer a simple hard coded message of the "Hello world" type. Now, we would like to be able to send generic MQTT messages of JSON type with the following structure, for example:
{ "state": { "reported": { "general": { "fw_version": "1", "hw_version": "1", "aws_id": "1234", }, "connection": { "last_connected_on": 1234567890, "last_error_code": 0 }, "status": { "temp": 27.0, "humidity": 50, "battery_level": 60, }, "configuration": { "wakeup_period": 60, } } }, }
As you can see, we want to have nested key-value pairs.
1) Is it possible to use cJSON library that can be found under nrf/ext/cjson to format MQTT message like above? Any example of that?
2) Also, can we use the same cJSON library to decode a message we receive from AWS IoT server?
AWS is offering their AWS IoT Device SDK for embedded C.
3) Is it worth trying to port that SDK into nRF Connect SDK (because I see there are some APIs for JSON formatting) or it's better to use aws_iot library that we have in master branch of the nRF Connect SDK? Do you have any experience with porting that AWS IoT SDK?
Thank you very much for your time and efforts! It is really appreciated.
Sincerely,
Bojan.