MicroPython ESP32 IndexError: bytes index out of range

Hello @rsemihkoca ,

Thank you for the outreach, and welcome to the HiveMQ Community!

Off the top, the first thing that comes to mind here is that the HiveMQ Cloud Broker requires TLS in order for a client to complete connection via port 8883 (port 1883 is not exposed for HiveMQ Cloud Brokers, resulting in connection error you’ve provided).

Based on the details provided here, it does not appear that we are providing a cert to the broker for connectivity, and SSL is currently set to false, with no provided parameters - this client implementation may require a server CA cert to complete TLS connectivity. This has been the case for some ESP32 implementations in the past, and the server CA file can be obtained from our Frequently Asked Questions thread here on the forum.

Aaron from the HiveMQ Team