openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.88k stars 3.59k forks source link

[network] Ping response state changes are slow #3875

Closed dastrix80 closed 6 years ago

dastrix80 commented 6 years ago

[network] appears to be slow in updates using Ping and the network binding to detect if my TV has been turned on or off, as indicated by successful (ON) pings or failed pings (OFF)

Expected Behavior

When the TV is switched on, Ping responses should be immediate or close to when pinging from a standard computer on my network and they are. The item state in OH2 should update almost immediately to reflect it being online or not.

Current Behavior

When using the network binding to detect the state change of an item as being online or offline, the state change can take up to 1 minute, despite the ping responses occurring and being successful. Changing the timers to many different figures makes no difference.

My current network is made up of a Cisco 3945 Router and Cisco 3560E Gigabit Switch, all ports are running Port Fast.

Possible Solution

Unknown

Steps to Reproduce (for Bugs)

  1. Turn TV on using remote or using the HabPanel Switch item for this device
  2. Observe state using karaf console

Context

I use the state of the item in rules which trigger scenes for my home Theatre, as the state is showing OFF, when its actually been on for 10seconds or more, the rule fails.

Your Environment

TV, OpenHAB 2.4.0 Snapshot currently all on the same Gigabit POE Cisco 3560. This issue occured on previous hardware also, a TPLink Gigabit switch so its definitely independent of network hardware.

Debugs:

``

From 192.168.0.3 icmp_seq=17 Destination Host Unreachable From 192.168.0.3 icmp_seq=18 Destination Host Unreachable From 192.168.0.3 icmp_seq=19 Destination Host Unreachable From 192.168.0.3 icmp_seq=20 Destination Host Unreachable From 192.168.0.3 icmp_seq=21 Destination Host Unreachable 64 bytes from 192.168.0.11: icmp_seq=22 ttl=64 time=1024 ms 64 bytes from 192.168.0.11: icmp_seq=23 ttl=64 time=0.324 ms 64 bytes from 192.168.0.11: icmp_seq=24 ttl=64 time=0.262 ms 64 bytes from 192.168.0.11: icmp_seq=25 ttl=64 time=0.235 ms 64 bytes from 192.168.0.11: icmp_seq=26 ttl=64 time=0.257 ms 64 bytes from 192.168.0.11: icmp_seq=27 ttl=64 time=0.253 ms 64 bytes from 192.168.0.11: icmp_seq=28 ttl=64 time=0.227 ms 64 bytes from 192.168.0.11: icmp_seq=29 ttl=64 time=0.275 ms 64 bytes from 192.168.0.11: icmp_seq=30 ttl=64 time=0.263 ms 64 bytes from 192.168.0.11: icmp_seq=31 ttl=64 time=0.292 ms 64 bytes from 192.168.0.11: icmp_seq=32 ttl=64 time=0.256 ms 64 bytes from 192.168.0.11: icmp_seq=33 ttl=64 time=0.252 ms 64 bytes from 192.168.0.11: icmp_seq=34 ttl=64 time=0.255 ms 64 bytes from 192.168.0.11: icmp_seq=35 ttl=64 time=0.256 ms 64 bytes from 192.168.0.11: icmp_seq=36 ttl=64 time=0.263 ms 64 bytes from 192.168.0.11: icmp_seq=37 ttl=64 time=0.258 ms 64 bytes from 192.168.0.11: icmp_seq=38 ttl=64 time=0.248 ms 64 bytes from 192.168.0.11: icmp_seq=39 ttl=64 time=0.256 ms 64 bytes from 192.168.0.11: icmp_seq=40 ttl=64 time=0.216 ms 64 bytes from 192.168.0.11: icmp_seq=41 ttl=64 time=0.260 ms 64 bytes from 192.168.0.11: icmp_seq=42 ttl=64 time=0.259 ms 64 bytes from 192.168.0.11: icmp_seq=43 ttl=64 time=0.257 ms 64 bytes from 192.168.0.11: icmp_seq=44 ttl=64 time=0.255 ms 64 bytes from 192.168.0.11: icmp_seq=45 ttl=64 time=0.263 ms 64 bytes from 192.168.0.11: icmp_seq=46 ttl=64 time=0.266 ms 64 bytes from 192.168.0.11: icmp_seq=47 ttl=64 time=0.323 ms 64 bytes from 192.168.0.11: icmp_seq=48 ttl=64 time=0.257 ms 64 bytes from 192.168.0.11: icmp_seq=49 ttl=64 time=0.245 ms 64 bytes from 192.168.0.11: icmp_seq=50 ttl=64 time=0.255 ms 64 bytes from 192.168.0.11: icmp_seq=51 ttl=64 time=0.263 ms 64 bytes from 192.168.0.11: icmp_seq=52 ttl=64 time=0.253 ms 64 bytes from 192.168.0.11: icmp_seq=53 ttl=64 time=0.254 ms 64 bytes from 192.168.0.11: icmp_seq=54 ttl=64 time=0.278 ms 64 bytes from 192.168.0.11: icmp_seq=55 ttl=64 time=0.209 ms 64 bytes from 192.168.0.11: icmp_seq=56 ttl=64 time=0.333 ms 64 bytes from 192.168.0.11: icmp_seq=57 ttl=64 time=0.257 ms 64 bytes from 192.168.0.11: icmp_seq=58 ttl=64 time=0.278 ms 64 bytes from 192.168.0.11: icmp_seq=59 ttl=64 time=0.256 ms 64 bytes from 192.168.0.11: icmp_seq=60 ttl=64 time=0.295 ms 64 bytes from 192.168.0.11: icmp_seq=61 ttl=64 time=0.248 ms 64 bytes from 192.168.0.11: icmp_seq=62 ttl=64 time=0.130 ms 64 bytes from 192.168.0.11: icmp_seq=63 ttl=64 time=0.295 ms 64 bytes from 192.168.0.11: icmp_seq=64 ttl=64 time=0.192 ms ^C --- 192.168.0.11 ping statistics --- 64 packets transmitted, 43 received, +21 errors, 32% packet loss, time 64515ms rtt min/avg/max/mdev = 0.130/24.069/1024.162/154.317 ms, pipe 4 kris@openhab2:/etc/openhab2/rules$ ``

` smarthome:status TVStatus OFF openhab> openhab> openhab> openhab> openhab> openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus OFF openhab> smarthome:status TVStatus ON openhab> smarthome:status TVStatus ON openhab>

Items definition:

` kris@openhab2:/etc/openhab2/items$ cat proxy.items Switch Scene_Watch_Netflix "Proxy for Netflix Scene" Switch Night_time "Night" String MENU_page Switch HeaterTimer "Proxy for The Heater"

/ This switch will be used in the Entertainment Rule to change Input to FTA / Switch TVProxyFTA "FTA Switch" Switch TVStatus { channel="network:pingdevice:1bad045e:online" }

/ Perform OpenHab2 Operations /

Switch restartoh2 "Restarts OpenHab2" Switch restartserver "Restarts Server" kris@openhab2:/etc/openhab2/items$

dastrix80 commented 6 years ago

HI, does anyone still maintain this binding?

wborn commented 6 years ago

Closing this issue since it's a duplicate of https://github.com/openhab/openhab2-addons/issues/3761.