MQTT gateway works great but drops the connection every 2 mins?
-
Gday,
Well I have managed to set up a Mysensors MQTT gateway which I was quite pleased with and have a PIR & distance sensor connected too it and it works!
When I look to openHAB I noticed that every 2 minutes (almost exactly) the broker connection was lost.
Is there are setting or reason this would occur? (MQTTlens seems to stay connected ok)
It is openHAB 1.8 running on a Windows 7 box.Has this happened to anyone else? Could someone point me in the right direction with this?
A grab from the log below.Regards,
George2016-02-06 23:31:36.661 [ERROR] [o.i.t.m.i.MqttBrokerConnection] - MQTT connection to broker was lost
org.eclipse.paho.client.mqttv3.MqttException: Unexpected error
at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:115) ~[na:na]
at java.lang.Thread.run(Unknown Source) [na:1.8.0_71]
2016-02-06 23:31:41.403 [ERROR] [o.i.t.m.i.MqttBrokerConnection] - MQTT connection to 'mysensors' was lost: Unexpected error : ReasonCode 6 : Cause : Unknown
2016-02-06 23:31:41.403 [INFO ] [o.i.t.m.i.MqttBrokerConnection] - Starting connection helper to periodically try restore connection to broker 'mysensors'
2016-02-06 23:31:51.419 [INFO ] [o.i.t.m.i.MqttBrokerConnection] - Starting MQTT broker connection 'mysensors'2016-02-06 23:33:36.663 [ERROR] [o.i.t.m.i.MqttBrokerConnection] - MQTT connection to broker was lost
org.eclipse.paho.client.mqttv3.MqttException: Unexpected error
at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:115) ~[na:na]
at java.lang.Thread.run(Unknown Source) [na:1.8.0_71]
2016-02-06 23:33:42.785 [ERROR] [o.i.t.m.i.MqttBrokerConnection] - MQTT connection to 'mysensors' was lost: Unexpected error : ReasonCode 6 : Cause : Unknown
2016-02-06 23:33:42.786 [INFO ] [o.i.t.m.i.MqttBrokerConnection] - Starting connection helper to periodically try restore connection to broker 'mysensors'
2016-02-06 23:33:52.787 [INFO ] [o.i.t.m.i.MqttBrokerConnection] - Starting MQTT broker connection 'mysensors'2016-02-06 23:35:36.661 [ERROR] [o.i.t.m.i.MqttBrokerConnection] - MQTT connection to broker was lost
org.eclipse.paho.client.mqttv3.MqttException: Unexpected error
at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:115) ~[na:na]
at java.lang.Thread.run(Unknown Source) [na:1.8.0_71]
2016-02-06 23:35:40.080 [ERROR] [o.i.t.m.i.MqttBrokerConnection] - MQTT connection to 'mysensors' was lost: Unexpected error : ReasonCode 6 : Cause : Unknown
2016-02-06 23:35:40.080 [INFO ] [o.i.t.m.i.MqttBrokerConnection] - Starting connection helper to periodically try restore connection to broker 'mysensors'
2016-02-06 23:35:50.082 [INFO ] [o.i.t.m.i.MqttBrokerConnection] - Starting MQTT broker connection 'mysensors'
-
@George-Whitehouse Probably some default timeout of 2 mins for openHAB connection to the MQTT broker.
Search your OpenHAB/MQTT broker settings for a default timeout, or enable keep-alive messages.
-
@Yveaux I initially thought the same thing, I will have another look. But I also have mosquitto running on the same win7 box for OwnTracks and that one seems to stay connected without any drop outs.
Regards,
George
-
@George-Whitehouse The client connecting to Mosquitto passes a keep-alive time during the connection. For pubsubclient (used by MySensors) this is set to 15 seconds. OpenHab should have an identical parameter. Check what it is set to, it might be different from OwnTracks, as it is a different MQTT client.
-
@Yveaux said:
cting to Mosquitto passes a keep-alive time during the connec
That sounds like it could be the problem, do you happen to know where that setting might be? I had a look in the config file but there does not seem to be a mention there.
Regards,
George
-
@George-Whitehouse I'm not very familiar with OpenHAB. Google is your friend
This could be something.
-
@Yveaux Thanks for you help. I was just looking around and saw this article.
I just cant seem to find any setting in openHAB that can be adjusted for testing.
Does anyone else run the MQTT gateway with openHAB 1.x have any drop outs?
Cheers,
George
-
maybe this is related to this issue https://github.com/mysensors/Arduino/issues/389
try the mqtt client from development branch.
-
@DerPest great thanks for that.
Yes I will give the MQTT client gateway a try tomorrow.
Thanks.
Regards,
George
Suggested Topics
-
Boxes and Enclosures
Enclosures / 3D Printing • 29 Mar 2014, 21:02 • PITP2 31 Aug 2014, 19:27 -
MQTT losing messages...
OpenHAB • 8 Jul 2022, 11:27 • ben999 17 Jul 2022, 18:00 -
voltage sensor via esp and mqtt
OpenHAB • 7 Nov 2020, 09:49 • muhammed 7 Nov 2020, 09:49 -
OH3, RPi3, GPIO-NRF24 gateway. MySensors binding (ETH or MQTT?)
OpenHAB • 30 Sept 2021, 10:24 • perIpI 1 Oct 2021, 09:19 -
openHAB 2.2 binding
OpenHAB • 18 Jul 2017, 12:49 • TimO 23 Dec 2020, 14:32 -
OH3 Serial Gateway Problem
OpenHAB • 15 Feb 2022, 09:48 • seppi9 22 Feb 2022, 13:44