ESP32 - Mqtt Connecting with error


#1

Hi

I generate a code that connect to Mosquitto Broker. When a try to connect, the device raise an error:

[UnsupportedError @[000C:0005:0085:0213:0084:0025:0000:00F8].
[UnsupportedError at line 62 of main]
[raised at line 393 of mqtt.mqtt.connect]
[raised at line 454 of mqtt.mqtt._connect]
[raised at line 796 of builtins.len]

I tried using the “test.mosquitto.org” and a local Broker.
I just used the example code from Mosquitto Org and I changed the “SSID” and “PSWD” to use my network.

Thanks


#2

Could you please post the code you used here?


#3

I discovered now how what was my problem.
I forgot to put a “Cliente ID” on MQTT client.
Thank you so much


#4

Hii,
me too having same issue will you please tell me what is the issue here is my code.

try:
print(“testing”)
mqtt_c = mqtt.Client(“zerynth-mqtt”,True)
mqtt_c.set_username_pw(“USERNAME”,“PASSWORD”)

        for retry in range(2):
            try:
                mqtt_c.connect("HOST",PORT,60)
                break
            except Exception as e:
                print("connecting...")
        print("connected.")
        
        if not mqtt_c:
            print ('mqtt not connected')
        else:
            print ('mqtt connected')
            return
    except Exception as e:
        print ('exception from mqtt: ', e)
        sleep(30)