zdar / elan2mqtt

MQTT client (gateway) for eLan
MIT License
11 stars 4 forks source link

MQTT disconect reason 7 or reason 1 #3

Open lordrak007 opened 2 years ago

lordrak007 commented 2 years ago

Hello, could you help me plase with behaviour of MEEQ vs your conector? When i disable auto discovery mQTT disconnect me with reason 7. [2021-10-25 10:18:45,083] {main_worker.py:808} INFO - Connected to MQTT broker [2021-10-25 10:18:46,086] {main_worker.py:808} INFO - Connected to MQTT broker [2021-10-25 10:18:46,087] {main_worker.py:813} INFO - MQTT broker disconnected. Reason: 7 [2021-10-25 10:18:47,090] {main_worker.py:808} INFO - Connected to MQTT broker [2021-10-25 10:18:47,091] {main_worker.py:813} INFO - MQTT broker disconnected. Reason: 7 [2021-10-25 10:18:48,094] {main_worker.py:813} INFO - MQTT broker disconnected. Reason: 7 [2021-10-25 10:18:48,095] {main_worker.py:808} INFO - Connected to MQTT broker [2021-10-25 10:18:49,097] {main_worker.py:808} INFO - Connected to MQTT broker [2021-10-25 10:18:49,098] {main_worker.py:813} INFO - MQTT broker disconnected. Reason: 7 [2021-10-25 10:18:50,103] {main_worker.py:808} INFO - Connected to MQTT broker [2021-10-25 10:18:50,103] {main_worker.py:813} INFO - MQTT broker disconnected. Reason: 7

When i enable auto discovery mQTT disconnect me with reason 1.

Thanky you Lordrak

zdar commented 2 years ago

Please check https://github.com/mgdm/Mosquitto-PHP/issues/66

lordrak007 commented 2 years ago

Yes, it is about client side which i can not setup. Reason 7 -> keep-alive - its your internal setup, i can not cange from HA. Reason 1 -> multiple connections - here also cannot manage how elan2mqtt make connections. I have installed elan2mqttq onl once. Is it possible provide these settings to settings for HA? Which user can manage? Thank you

zdar commented 2 years ago

Keep-alive is set to 120 s. It can be changed on line mqtt_cli_connect(mqtt_broker, 1883, 120) It is the last value.

Looking at you log it isn't probably keep alive. The timestamps are too close togeather. Could you enable debug on both elan2mqtt and mqtt server and send me logs via PM/email?

For some reason it looks like you have two main workers running. Just as precausion unistall add-on, clear it's working directory, reinstall it.

You can also try to set mqtt_id in config (it prevents two elan2mqtt instances to compete for connection)