gavinying/modpoll

breaking change in paho.mqtt.python

Closed this issue · 1 comments

I beleve there is a breaking change in paho.mqtt for version 2

from there doc

Add version to user callbacks (on_publish, on_connect…). tl; dr:
add mqtt.CallbackAPIVersion.VERSION1 as first argument to [Client()]

https://eclipse.dev/paho/files/paho.mqtt.python/html/migrations.html

change

        mqttc = mqtt.Client(
            clientid,
            clean_session=(args.mqtt_qos == 0),
            userdata={"qos": args.mqtt_qos},
         )

to

        mqttc = mqtt.Client(
            mqtt.CallbackAPIVersion.VERSION1,
            clientid,
            clean_session=(args.mqtt_qos == 0),
            userdata={"qos": args.mqtt_qos},
         )

Hi @mitchell-pioneer , noted the breaking changes on paho v2, thanks.
Currently, I am doing a major refactoring on master branch, will tackle this issue later for sure.
Stay tuned.