From f63eaed48d96700ab82530844f13829669f4b7bd Mon Sep 17 00:00:00 2001 From: markusbloch <> Date: Sun, 1 Sep 2013 09:43:08 +0000 Subject: [PATCH] PRESENCE: using ping command line utility to check presence on Windows based machines. git-svn-id: https://svn.fhem.de/fhem/trunk@3831 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 3 ++- fhem/FHEM/73_PRESENCE.pm | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 4c386daae..cf964ec6b 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -9,7 +9,8 @@ meter with a JeeLabs JeeLink as RF modem. The matching JeeNode sketch can be found in .../contrib/36_PCA301-pcaSerial.zip (by justme1968) - - change: PRESENCE: changing ping method for Windows systems to "tcp" + - change: PRESENCE: using ping command line utility to check presence on Windows + based machines. - feature: install FHEM as Windows service by T.E., see docs/HOWTO_Windows.txt - feature: new module 33_readingsGroup to display a collection of readings from one or more devices. this will replace weblink readings. diff --git a/fhem/FHEM/73_PRESENCE.pm b/fhem/FHEM/73_PRESENCE.pm index 154c1559e..5a32a20db 100755 --- a/fhem/FHEM/73_PRESENCE.pm +++ b/fhem/FHEM/73_PRESENCE.pm @@ -516,13 +516,13 @@ PRESENCE_DoLocalPingScan($) { - $temp = qx(ping -n $count $device); + $temp = qx(ping -n $count -4 $device); chomp $temp; if($temp ne "") { Log3 $name, 5, "PRESENCE ($name) - ping command returned with output:\n$temp"; - $return = "$name|$local|".($temp =~ /(Reply from|Antwort von) .* [Bb]ytes=\d+ .* TTL=\d+/ ? "present" : "absent"); + $return = "$name|$local|".($temp =~ /TTL=\d+/ ? "present" : "absent"); } else {