mqtt-zabbix icon indicating copy to clipboard operation
mqtt-zabbix copied to clipboard

mosquitto python not currently exist

Open ghost opened this issue 8 years ago • 3 comments

The Mosquitto Python module does not currently exist, can change the script to paho mqtt client. https://eclipse.org/paho/clients/python/

ghost avatar Jul 26 '16 13:07 ghost

This seems to still be a problem, any way possible that this could be fixed? I have tried changing the code but im no programmer.

Changed these lines, but more needs uppdated to the paho client. import paho.mqtt.client as paho mqttc = paho.Client(client_id)

Got this far, but then im out of luck.

Traceback (most recent call last): File "./mqtt-zabbix.py", line 245, in connect() File "./mqtt-zabbix.py", line 214, in connect result = mqttc.connect(MQTT_HOST, MQTT_PORT, 60, True) File "/usr/local/lib/python2.7/dist-packages/paho/mqtt/client.py", line 686, in connect return self.reconnect() File "/usr/local/lib/python2.7/dist-packages/paho/mqtt/client.py", line 808, in reconnect sock = socket.create_connection((self._host, self._port), source_address=(self._bind_address, 0)) File "/usr/lib/python2.7/socket.py", line 565, in create_connection sock.bind(source_address) File "/usr/lib/python2.7/socket.py", line 228, in meth return getattr(self._sock,name)(*args) TypeError: coercing to Unicode: need string or buffer, bool found

swapper82 avatar Feb 07 '17 19:02 swapper82

@jamestutton kindly submitted an improvement that also includes the use of Paho. I don't use this project any more, but if anyone fancies testing it and letting me know if it works, we might be able to close this issue!

kylegordon avatar Oct 05 '17 11:10 kylegordon

you need separately install "pip install paho-mqtt" and launch it. *sign, al this uses Python2

TheUserDead avatar Jun 28 '20 12:06 TheUserDead