MxChip Devkit- Telemetry #337
Replies: 3 comments 2 replies
-
Hi @RaysApps, The only possible return codes from this function are:
I'm wondering if you are truncating the return and you actually seeing a NX_AZURE_IOT_SDK_CORE_ERROR. |
Beta Was this translation helpful? Give feedback.
-
Moving onto this specific error, unfortunately the NetXDuo SDK swallows the errors from the underlying JSON library and returns a generic code which makes it less than useful. The best approach here would be to set a breakpoint when calling that function and then step through until you hit the error in the underlying json library. You will probably end up in this function. Most likely the issue is going to be that there wasn't enough space in the buffer. I would try and estimate the size of the buffer you would need and make sure you have allocated enough space. |
Beta Was this translation helpful? Give feedback.
-
Hi @ryanwinter, I was able to debug through the function you mentioned and found that the required buffer for the telemetry data is exceeding the allocated length. The buffer size allocated is equal to the '#define TELEMETRY_BUFFER_SIZE 256' value in 'azure_iot_nx_client.c' file. Updating the TELEMETRY_BUFFER_SIZE to 512 resolved this issue. Thank you for your helpful suggestion. |
Beta Was this translation helpful? Give feedback.
-
I've added a new function to the MxChip devkit sample to send all sensor info as telemetry to the cloud. While appending the data to the JSON, the method 'nx_azure_iot_json_writer_append_property_with_double_value' is returning 0x01.
I am not sure what this error indicates. Is this because of buffer overflow? Could you please help me in resolving this issue?
Beta Was this translation helpful? Give feedback.
All reactions