Azure IoTHub Python SDK: ConnectionFailedError while sending messages to Azure IoTHub using Python SDK

Praveen Palakodeti 11 Reputation points
2020-10-20T14:11:36.86+00:00

While sending messages to Azure IoTHub from Python SDK, frequently the connection is lost with different error messages viz: 'Failed to receive on socket', 'transport.connect raised error'
Attached the screenshot.

And some times, IoTHub is receiving multiple(duplicate) messages for the same request.

Versions:
azure-iot-device==2.2.0
azure-iot-hub==2.2.2

Attached the sample code.

Please help.
33664-iothub-connection-error.jpg

33549-iothubclient-pythonsdk.txt

Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,128 questions
Azure IoT SDK
Azure IoT SDK
An Azure software development kit that facilitates building applications that connect to Azure IoT services.
208 questions
{count} votes

1 answer

Sort by: Most helpful
  1. António Sérgio Azevedo 7,666 Reputation points Microsoft Employee
    2020-12-15T01:19:47.76+00:00

    Hello @Praveen Palakodeti ,

    As per the Azure Support Ticket closure reason:

    "We are not able to reproduce this now... this might be due to bad network conditions that occur randomly."

    Please feel free to comment below if you ever face the issue again. For now I will kindly request that you mark this as the answer to help others as well.

    Thank you so much for all the time you spent with us in this support request.

    Remember:

    • Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.
    0 comments No comments