Skip to content
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

paho-mqtt 2.x is out, breaking compatibility with rtl_433_mqtt_hass.py #2840

Closed
deviantintegral opened this issue Feb 17, 2024 · 3 comments
Closed

Comments

@deviantintegral
Copy link
Contributor

The current directions don't specify a version of paho-mqtt to install, which means users will now be getting the 2.x branch. I know for sure this breaks rtl_433_mqtt_hass.py, and it wouldn't surprise me if it examples/rtl_433_mqtt_relay.py too.

Starting rtl_433_mqtt_hass.py...
[2024-02-17T10:53:24+0100] INFO:root:Enabling debug logging
[2024-02-17T10:53:24+0100] INFO:root:Discovering all devices
Exception ignored in: <function Client.__del__ at 0x7fb05d0900>
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/paho/mqtt/client.py", line 874, in __del__
    self._reset_sockets()
  File "/usr/local/lib/python3.12/site-packages/paho/mqtt/client.py", line 1133, in _reset_sockets
    self._sock_close()
  File "/usr/local/lib/python3.12/site-packages/paho/mqtt/client.py", line 1119, in _sock_close
    if not self._sock:
           ^^^^^^^^^^
AttributeError: 'Client' object has no attribute '_sock'
Traceback (most recent call last):
  File "/rtl_433_mqtt_hass.py", line 990, in <module>
    run()
  File "/rtl_433_mqtt_hass.py", line 917, in run
    rtl_433_bridge()
  File "/rtl_433_mqtt_hass.py", line 888, in rtl_433_bridge
    mqttc = mqtt.Client()
            ^^^^^^^^^^^^^
TypeError: Client.__init__() missing 1 required positional argument: 'callback_api_version'

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

We fixed this at pbkhrv/rtl_433-hass-addons#180 by pinning the old version for now.

@zuckschwerdt
Copy link
Collaborator

Thanks! We should check if we can use 2.x by just using mqttc = mqtt.Client(mqtt.CallbackAPIVersion.VERSION1)

@rct
Copy link
Contributor

rct commented Feb 20, 2024

There's a commit for that as part of #2841. In that PR there are two commits that are essentially fixes and two for adding the feature of being able to pull the MQTT connection details from the rtl_433 conf file. Probably would have been better of those were separate PRs.

@zuckschwerdt
Copy link
Collaborator

Closed by #2916

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants