Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

MxChip Devkit- Telemetry #337

chandra-rayaprol started this conversation in General
Discussion options

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?

You must be logged in to vote

Replies: 3 comments 2 replies

Comment options

Hi @RaysApps,

The only possible return codes from this function are:

  1. NX_AZURE_IOT_SUCCESS = 0
  2. NX_AZURE_IOT_SDK_CORE_ERROR = 0x2001
  3. NX_AZURE_IOT_INVALID_PARAMETER = 0x2002

I'm wondering if you are truncating the return and you actually seeing a NX_AZURE_IOT_SDK_CORE_ERROR.

You must be logged in to vote
0 replies
Comment options

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.

You must be logged in to vote
0 replies
Comment options

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.

You must be logged in to vote
2 replies
Comment options

I have created an issue again netxduo about providing improved feedback on this function:
eclipse-threadx/netxduo#105

Comment options

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request

AltStyle によって変換されたページ (->オリジナル) /