Hallo zusammen habe ein MQTT Problem.
import paho.mqtt.client as mqtt
client = mqtt.Client()
client.connect("ip", 1883, 60)
in IP seht die richtige Nummer!
Exception ignored in: <function Client.__del__ at 0x000002CA9EC17240>
Traceback (most recent call last):
File "C:\Users\ich\AppData\Local\Programs\Python\Python312\Lib\site-packages\paho\mqtt\client.py", line 874, in __del__
self._reset_sockets()
File "C:\Users\ich\AppData\Local\Programs\Python\Python312\Lib\site-packages\paho\mqtt\client.py", line 1133, in _reset_sockets
self._sock_close()
File "C:\Users\ich\AppData\Local\Programs\Python\Python312\Lib\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 "d:\Python3_VS\mqtt_senden.py", line 3, in <module>
client = mqtt.Client()
^^^^^^^^^^^^^
TypeError: Client.__init__() missing 1 required positional argument: 'callback_api_version'
PS D:\Python3_VS>
Frage was ist der Grund für den Fehler, was muss ich machen damit es Funktioniert?