1

I am using the azure IOT sdk in an ESP32-based device to connect to the IOT hub using MQTT, sending messages with QOS 1. When the connection is good, all works exactly as intended. However, when we deploy to areas where the connectivity seems somewhat more spotty, the messages often time out (i.e. callback is called with the timeout error). The MQTT still thinks it has a connection (i.e. the disconnect callback has not been called), but all sends end up timing out. Interestingly, I see that when I send c2d messages, they do get picked up. I have configured the firmware to tear down and rebuild the MQTT connection in these scenarios and that sometimes helps but not always.

Two questions:

  1. Why does this seem to happen, and are there parameters that I can twiddle to prevent it. I have reduced the size of the packets but that did not seem to make a difference.

  2. What is the appropriate way of handling this condition? I have seen scenarios where once the communication gets "stuck" like this, it can stay stuck for tens of minutes.

Hope there's someone from MSFT IOT group listening... :)

kgalic
  • 2,441
  • 1
  • 9
  • 21
farhadf
  • 1,918
  • 3
  • 19
  • 27
  • Are you using the Espressif environment or Arduino? Either way, can you check the version of the SDK you are using. It is in iothub_client/inc/iothub_client_version.h. And yes I am in the MSFT IoT group. – Mark Radbourne Oct 18 '19 at 04:06
  • @MarkRadbourne I am currently using "1.2.8" w/ esp-idf version v3.0.2-1. – farhadf Oct 19 '19 at 01:04
  • I'm assuming then that you are using this: https://github.com/espressif/esp-azure. The version of the MS IoT SDK is pretty old in there. You might start by posting an issue and asking them to pick up a later version. Presumably you are using the LL versions of the SDK. How often are you calling DoWork? – Mark Radbourne Oct 22 '19 at 20:42

0 Answers0