Closed tikismoke closed 7 years ago
From mosquitto server i've got this:
1485080695: New connection from 192.168.0.63.
1485080695: Invalid protocol "MQTT" in CONNECT from 192.168.0.63.
1485080695: Socket read error on client (null), disconnecting.
can you give me mosquitto server and paho-mqtt version ?
Mine:
Mosquitto serveur:
# dpkg -l|grep mosquitto
ii libmosquitto1:amd64 1.4.10-2 amd64 MQTT version 3.1/3.1.1 client library
ii mosquitto 1.4.10-2 amd64 MQTT version 3.1/3.1.1 compatible message broker
ii mosquitto-clients 1.4.10-2 amd64 Mosquitto command line MQTT clients
On Domogik server:
# pip list|grep paho
paho-mqtt (1.1)
Do you have configured mosquitto server with password ?
Sending all information in the evening.
on server:
root@mosquitto:~# dpkg -l|grep mosquitto
ii libmosquitto0 0.15-2 amd64 MQTT version 3.1 client library
ii mosquitto 0.15-2 amd64 MQTT version 3.1 compatible message broker
ii mosquitto-clients 0.15-2 amd64 Mosquitto command line MQTT clients
ii python-mosquitto 0.15-2 all MQTT version 3.1 client library, python bindings
on client:
root@domogik:~# pip list|grep paho
Usage: pip COMMAND [OPTIONS]
pip: error: No command by the name pip list
(maybe you meant "pip install list")
pip --version
pip 1.1 from /usr/lib/python2.7/dist-packages (python 2.7)
your server mosquitto and domogik are not on Debian jessie ? => pas bien :) mosquitto is to old, it don't support MQTT version 3.1.1 protocol
Can you test with parameter protocol=MQTTv31 in lib/mqtt.py:
class MQTT:
""" MQTT
"""
def __init__(self, log, cb_send, stop, mqtthost, mqttport, mqtttopic, devicelist):
...
self.MQTTClient = mqtt.Client('mqtt2dmg_' + platform.node(), protocol=MQTTv31)
...
Yes still under wheezy.....
With self.MQTTClient = mqtt.Client('mqtt2dmg_' + platform.node(), protocol=MQTTv31)
i get :
Traceback (most recent call last):
File "bin/mqtt.py", line 183, in <module>
MQTTManager()
File "bin/mqtt.py", line 97, in __init__
self.mqttClient = MQTT(self.log, self.send_pub_data, self.get_stop(), self.mqtthost, self.mqttport, self.mqtttopic, self.device_list)
File "/var/lib/domogik/domogik_packages/plugin_mqtt/lib/mqtt.py", line 88, in __init__
self.MQTTClient = mqtt.Client('mqtt2dmg_' + platform.node(), protocol=MQTTv31)
NameError: global name 'MQTTv31' is not defined
With self.MQTTClient = mqtt.Client('mqtt2dmg_' + platform.node(), protocol='MQTTv31')
Plugin start but i get this in server side:
1485203511: Invalid protocol "MQTT" in CONNECT from 192.168.0.63.
i've tried a lot of thinks even with evil google but can't find the issue :(
protocol=3
allow plugin start
IT WORKS :)
With:
self.MQTTClient = mqtt.Client('mqtt2dmg_' + platform.node(), protocol=3)
for old Mosquitto version, i't ok for you ?
thanks
Yes with a basic test ;) Will try to migrate my xpl arduinos and after somes asterisk things to mqtt in future ;)
Le 23 janvier 2017 22:55:09 GMT+01:00, vdomos notifications@github.com a écrit :
With:
self.MQTTClient = mqtt.Client('mqtt2dmg_' + platform.node(), protocol=3)
for old Mosquitto version, i't ok for you ?
thanks
-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/vdomos/domogik-plugin-mqtt/issues/6#issuecomment-274629892
-- Envoyé de mon appareil Android avec K-9 Mail. Veuillez excuser ma brièveté.
me too, I replace old xPL sensors with MQTT.
For info., there is still a bug if network connexion lost, MQTT Client disconnect not properly. I have to find a better solution
Like mq in domodroid no way to know if connection is still alive?
Yep also replaced xpl in favor for mqtt on my arduino sensors... really like its support (eg espeasy, android mqtt dashboard, sonoff... ) and now domogik ;-)
@tikismoke can you test the last push version (Not in prod in a first time). I added plugin parameter to choose the old protocol => MQTTv31 Domogik must be restarted after pull (info.json modified)
@tikismoke, @jschaeke: You can test also the reload new/update devices without restarting the plugin to test if it's ok for you.
thank,
Will have a look in the week no problems.
I can do it in prod I still not move anything to mq :(
Updated, added a new sensor and sent after that a value to it (with mosquitto_pub without restart of domogik) I saw it immediately in the history of the new sensor. So it's ok for me!
Same for me using the right version in conf seems to works :)
WELL DONE.