Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Controllers
  3. OpenHAB
  4. MQTT gateway works great but drops the connection every 2 mins?

MQTT gateway works great but drops the connection every 2 mins?

Scheduled Pinned Locked Moved OpenHAB
9 Posts 3 Posters 3.9k Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    George Whitehouse
    wrote on last edited by
    #1

    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'

    YveauxY 1 Reply Last reply
    0
    • G George Whitehouse

      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'

      YveauxY Offline
      YveauxY Offline
      Yveaux
      Mod
      wrote on last edited by
      #2

      @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.

      http://yveaux.blogspot.nl

      G 1 Reply Last reply
      0
      • YveauxY Yveaux

        @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.

        G Offline
        G Offline
        George Whitehouse
        wrote on last edited by
        #3

        @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

        YveauxY 1 Reply Last reply
        0
        • G George Whitehouse

          @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

          YveauxY Offline
          YveauxY Offline
          Yveaux
          Mod
          wrote on last edited by
          #4

          @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.

          http://yveaux.blogspot.nl

          G 1 Reply Last reply
          0
          • YveauxY Yveaux

            @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.

            G Offline
            G Offline
            George Whitehouse
            wrote on last edited by
            #5

            @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

            YveauxY 1 Reply Last reply
            0
            • G George Whitehouse

              @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

              YveauxY Offline
              YveauxY Offline
              Yveaux
              Mod
              wrote on last edited by
              #6

              @George-Whitehouse I'm not very familiar with OpenHAB. Google is your friend ;-)
              This could be something.

              http://yveaux.blogspot.nl

              G 1 Reply Last reply
              0
              • YveauxY Yveaux

                @George-Whitehouse I'm not very familiar with OpenHAB. Google is your friend ;-)
                This could be something.

                G Offline
                G Offline
                George Whitehouse
                wrote on last edited by
                #7

                @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

                1 Reply Last reply
                0
                • DerPestD Offline
                  DerPestD Offline
                  DerPest
                  wrote on last edited by
                  #8

                  maybe this is related to this issue https://github.com/mysensors/Arduino/issues/389
                  try the mqtt client from development branch.

                  G 1 Reply Last reply
                  0
                  • DerPestD DerPest

                    maybe this is related to this issue https://github.com/mysensors/Arduino/issues/389
                    try the mqtt client from development branch.

                    G Offline
                    G Offline
                    George Whitehouse
                    wrote on last edited by
                    #9

                    @DerPest great thanks for that.

                    Yes I will give the MQTT client gateway a try tomorrow.

                    Thanks.

                    Regards,
                    George

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    33

                    Online

                    11.7k

                    Users

                    11.2k

                    Topics

                    113.1k

                    Posts


                    Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • MySensors
                    • OpenHardware.io
                    • Categories
                    • Recent
                    • Tags
                    • Popular