@seb Can you please help me. I'm trying exactly the same thing, connecting Pycom to IoT-Hub using MQTTClient. Only thing that is different is that I'm using pregenerated password. All my credentials and password is ok, because I've tested it with MQTT Client Desktop App (MQTT.fx) and everything is working fine. When I call client.connect() I'm receiving following error line: Traceback (most recent call last): File "main.py", line 40, in <module> File "/flash/lib/mqtt.py", line 84, in connect IndexError: bytes index out of range Firmware version is: Pycom MicroPython 1.18.1.r1 [v1.8.6-849-b0520f1] on 2018-08-29; LoPy4 with ESP32 Thank you in advance.