Azure IoTHub MQTT connect issue



  • What are the steps to reproduce this issue?

    1. Connect to WiFi network
    2. Call MQTTClient(...) with Azure IoTHub credentials.
    3. Call client.connect().

    What happens?

    Following error appears:

    Traceback (most recent call last):
    File "main.py", line 45, in
    File "/flash/lib/mqtt.py", line 85, in connect
    IndexError: bytes index out of range

    What were you expecting to happen?

    I'm expecting successfully MQTT connect to Azure IoTHub.

    What versions of software are you using?

    (sysname='LoPy4', nodename='LoPy4', release='1.18.1.r7', version='v1.8.6-849-d1c5ea9 on 2018-12-17', machine='LoPy4 with ESP32', lorawan='1.0.2', sigfox='1.0.1')



  • Hello @Paul-Thornton ,

    Glad to here that, it's very important to me to have this possibility with Pycom. All my devices should be connected to Azure.

    I've done some researching and found out that your MQTT libs are sending bytes that Azure doesn't understand. Short description of this is on the link: https://www.youtube.com/watch?v=pRqpKZ7mO1s



  • Hello,

    Just to let you know we are aware of this. Our MQTT libs were specifically written to support AWS. That said they should also work with Azure. I took a quick look last night into why they dont but ran out of time. I will be doing some more investigation today and hopefully will have a solution.



Pycom on Twitter