Page 1 of 1

presence detection help

Posted: Thursday 10 August 2017 11:55
by nood
Hi

I am new to scripting but with some copy-pasting and a lot of trial and error I managed to get some things working already.
Today I tried to get the presence detection script working which I found on the wiki. But I get an error with the arping method:

10:39:19- script started.
10:39:19- according to domoticz, 192.168.0.99 is offline
arping: invalid option -- 'W'
10:39:20- 192.168.0.99 offline, waiting for it to come back
arping: invalid option -- 'W'
arping: invalid option -- 'W'

If I use the normal ping method I can get the script to work, but when my phone goes in standby the switch turns off.
I used the ''arp -an" command and in this list my phone gets detected.

Can someone point me in the right direction to solve this problem?

Thanks

Re: presence detection help

Posted: Thursday 10 August 2017 15:00
by freijn
Nood,

ARP is not the best alternative. As an ARP table can life for several hours...

Ping is a much better and almost realtime solution. ( script loopt time only)

If this does not work because your phone goes into standby, then have a look in a a GEO solution.

==============================
How long does it take for ARP to expire?
For example, when the ARP timeout is 4 hours or 240 minutes (Cisco default value), the router sends an ARP request when reaching 239 minutes (1 minute before the expiration time).Feb 13, 2012
================================

Re: presence detection help

Posted: Thursday 10 August 2017 18:30
by nood
I got the arping method to work, I changed the "-W 1" to "-w 1000000"
Even though this method works better, it isn't reliable. It loses its connection frequently and turns the switch off and on.

I think I will have to look into another method.

Thanks for the help