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,
    George

    2016-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'


  • Mod

    @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


  • Mod

    @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


  • Mod

    @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


Log in to reply
 

Suggested Topics

  • 22
  • 5
  • 132
  • 2
  • 4
  • 3

36
Online

11.4k
Users

11.1k
Topics

112.6k
Posts