This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Large device twins with Azure - Causes disconnect when response to get twin request exceeds ~2k.

We're using the Azure iot hub implementation in a custom product that works with Azure.

One of the things we've noted is that if the total size of the device twin exceeds about 2k, then when the device twin is fetched initially, the connection is terminated. I've not run this down completely, but I'm pretty sure that what's happening is that the response exceeds the ~2k+ TLS size that Nordic supports, and that's what causes the disconnect. Reducing the size of the twin fixes this issue, so I'm pretty confident this is the issue.

We can work around this issue for the time being, but it would be nice to have a way to fix this.

Some possible ideas:

  • Configuration change on the Azure end to force fragmenting packets to a small enough size.
  • A mechanism to fetch only selected parts of the device twin.
  • Increase the size of the TLS packet that the Nordic stack can handle.

Can Nordic provide any information on which of these ideas (or other ideas) might be worth pursuing? This is not an urgent issue for us, but we will eventually need a solution.

Related