-
Notifications
You must be signed in to change notification settings - Fork 721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrating from mqtt Paho V1 to V2 reinitialise fails #844
Comments
Perhaps the reason there's so little documentation for Create a new client from scratch with the new API enum. The first error does indeed occur because issue #841 has not been fixed. In the second attempt, you're calling a method with 4 arguments that expects 3. But your arg no. 3 is the kwarg that is also set by positional arg 2. My PR's not included yet, but it should preserve the callback_api_version that is already set. It does not alter the .reinitialise call signature however. The call to that with 4 args would still be incorrect. |
Thx. OK, clear. |
You can use Don't try to use |
OK but that's not what I am doing (I think) as I do create a V2 client
|
Ah I misunderstood - sorry. You're creating the Client correctly. However "the V2 reinitialise method" (and the V1 alike) is broken due to #841. the precise way it breaks is because a Value Error is raised inside |
Question
On a reconnect, on_reconnect calls my reconnect function where I reinitialise the connection calling the reinitialise method of the client
mqttc.reinitialise(mqtt_clientID, clean_session=False, userdata=None)
However, this triggers an error
Searching online for information I do find the migration information but nothing is mentioned about this method. Looking for the method, I only find info in the documentation indicating I do the right thing. (cfr: https://eclipse.dev/paho/files/paho.mqtt.python/html/client.html)
I even tried this
mqttc.reinitialise(mqtt.CallbackAPIVersion.VERSION2, mqtt_clientID, clean_session=False, userdata=None)
but that triggers an error saying clean_session is mentioned twice.
What is wrong here? Where can I find information on the V2 reinitialise method?
Environment
The text was updated successfully, but these errors were encountered: