Connections to network devices unstable

Over the past several weeks now OpenHAB has been constantly losing connections to all of my network devices, including a Philips Hue Bridge, TPLink wifi outlets, Homematic HMIP Wired devices, unifi network controller, and the OpenHAB Cloud Service.

I have installed the Network Binding and monitored some of these devices. I have not seen a disconnect error reported by this binding.

The worst offender is the Hue Bridge. I set the log for this binding to debug, and below is a snippet of the logs just before OpenHAB reports the connection was lost:

2022-04-25 08:33:29.792 [DEBUG] [ue.internal.handler.HueBridgeHandler] - Connection to Hue Bridge lost: connect timed out
	at org.openhab.binding.hue.internal.HttpClient.doNetwork( ~[bundleFile:?]
	at org.openhab.binding.hue.internal.HttpClient.doNetwork( ~[bundleFile:?]
	at org.openhab.binding.hue.internal.HttpClient.get( ~[bundleFile:?]
	at org.openhab.binding.hue.internal.HueBridge.getSensors( ~[bundleFile:?]
	at org.openhab.binding.hue.internal.handler.HueBridgeHandler$1.doConnectedRun( ~[bundleFile:?]
	at org.openhab.binding.hue.internal.handler.HueBridgeHandler$ [bundleFile:?]
2022-04-25 08:33:29.793 [DEBUG] [ue.internal.handler.HueBridgeHandler] - Bridge connection lost. Updating thing status to OFFLINE.
2022-04-25 08:33:29.794 [DEBUG] [hue.internal.handler.HueGroupHandler] - bridgeStatusChanged OFFLINE: @text/offline.bridge-connection-lost
2022-04-25 08:33:29.794 [DEBUG] [hue.internal.handler.HueLightHandler] - bridgeStatusChanged OFFLINE: @text/offline.bridge-connection-lost
2022-04-25 08:33:29.795 [DEBUG] [hue.internal.handler.HueLightHandler] - bridgeStatusChanged OFFLINE: @text/offline.bridge-connection-lost
2022-04-25 08:33:29.795 [DEBUG] [hue.internal.handler.HueLightHandler] - bridgeStatusChanged OFFLINE: @text/offline.bridge-connection-lost
2022-04-25 08:33:29.795 [DEBUG] [hue.internal.handler.HueGroupHandler] - initializeThing thing hue:group:ecb5fa833088:11 bridge status OFFLINE
2022-04-25 08:33:29.795 [DEBUG] [hue.internal.handler.HueLightHandler] - initializeThing thing hue:0210:ecb5fa833088:22 bridge status OFFLINE
2022-04-25 08:33:29.795 [DEBUG] [hue.internal.handler.HueLightHandler] - initializeThing thing hue:0210:ecb5fa833088:17 bridge status OFFLINE
2022-04-25 08:33:29.795 [DEBUG] [hue.internal.handler.HueLightHandler] - bridgeStatusChanged OFFLINE: @text/offline.bridge-connection-lost
2022-04-25 08:33:29.795 [DEBUG] [hue.internal.handler.HueLightHandler] - initializeThing thing hue:0210:ecb5fa833088:15 bridge status OFFLINE
2022-04-25 08:33:30.796 [DEBUG] [ue.internal.handler.HueBridgeHandler] - Connection to Hue Bridge established.
2022-04-25 08:33:30.796 [DEBUG] [ue.internal.handler.HueBridgeHandler] - Bridge connection resumed.
2022-04-25 08:33:30.826 [DEBUG] [hue.internal.handler.HueGroupHandler] - bridgeStatusChanged ONLINE

I have updated Ubuntu, java, and all other software to the latest version last week. I can set other bindings to debug and post the output of other network-connected devices/bindings as well.

  • Platform information:
    • Hardware: Gigabyte Brix MiniPC model GB-BXI7-5775R/MBHM87P-00 BIOS F2. 8GB RAM, 228GB HDD.
    • OS: Ubuntu 20.04 LTS
    • Java Runtime Environment: openjdk version “11.0.8” 2020-07-14 LTS
      OpenJDK Runtime Environment Zulu11.41+23-CA (build 11.0.8+10-LTS)
      OpenJDK 64-Bit Server VM Zulu11.41+23-CA (build 11.0.8+10-LTS, mixed mode)
    • openHAB version: 3.2 Stable
  • Issue of the topic: OpenHAB frequently loses connections to network devices. Items such as Hue Bridge, various wifi smart outlets, Homematic HMIP Wired devices.
  • Please post configurations (if applicable):
    • Items configuration related to the issue
    • Sitemap configuration related to the issue
    • Rules code related to the issue
    • Services configuration related to the issue
  • If logs where generated please post these here using code fences:

This isn’t going to be an openHAB specific issue. The fact that it’s happening with multiple bindings which I’m sure work in multiple different ways points to a more fundamental networking problem. You are unlikely to learn any more from openHAB logs. Each binding will probably give you roughly the same error: “connection timed out”.

You will need to look at the syslog and systemd logs and perhaps other operating system specific logs to see if there are errors there. If you were on an RPi I’d recommend looking at the power supply because frequently dropping off the network is one symptom of a poor power supply. Use the timestamps in the openHAB logs to narrow your search through those logs. You’ll want to look for networking errors within a minute or so before the error in openHAB.

See if you can set up some sort of network monitoring on some other machine. Even a shell script run once a minute with cron to ping the openHAB machine and send an alert if it can’t reach it might give you a clue. Check the logs of your router/gateway if you can.

Your best bet for help is probably going to be on the Ubuntu forums.

Are you sure that the issue is happening at the server level? I saw issues like this when I had dozens of tp-link devices plus other wifi IOT devices. If one of my access points went down, the load on the other AP was too much and many items couldn’t stay reliably connected. I suspect it’s not any one device, device family, or any specific connection issue. It’s just that your wifi traffic is now higher than your router(s) can handle.

Thanks guys. I did have a quick look at my network devices, but there was nothing obvious. Perhaps I put too much trust in my Ubiquiti/Unifi network. I will dig deeper on that front.

I appreciate the help.

Off-topic; Are you sure? Sometimes people look at Thing state online/offline and expect it reflect target device. It doesn’t, you must use the channels provided, with Items.