Hi David, i still seem struggling to understand what changes i need to make in order to get the presence detection up and running again with the latest changes of the binding in the same way as it was before. With the “old” binding this worked perfectly well with my iphones. When they were entering the network, the status changed to ONLINE. Only when they left the network, the status went to OFFLINE. Now it seems that once the iphone gets into sleep mode, the status changes to OFFLINE with the last seen timestamp, even though the iphone is still within the network. This happens frequently over day of course and at night. This causes problems as i have based a couple of rules fired with the request if iphones are ONLINE or OFFLINE. I am wondering if this still is a bug, if this is the purpose or if i do need to change anything on the configuration to make it work again that only when the iphone is not in the Network, the status is OFFLINE.
arping can be used without sudo from terminal with the mentioned bath in the binding config.
from my understanding what i can see in paperUI of the Thing its not using arping at all.
@Matt77 You are using serviceDevice. Please read the description within the screenshot: …with running service… AND …which reachable state is detected by connecting to a TCP port."
arping will never be used for a serviceDevice. Use a pingDevice instead.
Oh, that “uses_arpping” property is not existing anymore actually. Ignore what it says. The other propery says that the thomas arping was recognised and will be used.
OK, so how could I know that the arping from the binding is working (as currently it seems not to work). Are there any logs I can enable that will help to debug it?
Can you get into the situation where nothing else then arping would work? Like a deep sleeping iphone/android?
It would be helpful if you could use the command line to try:
a normal ping (should fail)
an arp ping
The binding can only be as good as the tools it uses. There is unfortunately no further debug than what you see in the properties, but if it is listed there, you can be sure it is used, in parallel to everything else.
As stated already, I have only tested it with the iputils arping. iputils needs a network interface to work and I add this parameter to thomas arping as well. Might be that the program is confused because of that.
Process proc;
// IPutilsArping uses "-w", ThomasHabertArping "-W" for the timeout
String timeoutFlag = arpingTool == ArpPingUtilEnum.IPUTILS_ARPING ? "-w" : "-W";
proc = new ProcessBuilder(arpUtilPath, timeoutFlag, String.valueOf(timeoutInMS / 1000), "-c", "1", "-I", interfaceName, ipV4address).start();
is the code, the command line would be: arping -W 1000 -c 1 -I eth0 192.168.0.105 with eth0 being your network interface name. Can you try this as well?
It should respond with 1 result actually (c=count=1). Can you change the “-W 1000” which means timeout after 1000 to 5000 and see if the program halts the command line for 5 seconds? Because that would be the problem then.
Maybe "-W"s unit is seconds instead of milliseconds.
with -W 1000 the command seems to halt. It takes time between two responses. But I don’t know why as -c i 1 ???
With -W 5000 seems to behave the same …
-c count
Stop after sending count ARP REQUEST packets. With deadline option, arping waits for count ARP REPLY packets, until the timeout expires.
-w deadline
Specify a timeout, in seconds, before arping exits regardless of how many packets have been sent or received. In this case arping does not stop after count packet are sent, it waits either for deadline expire or until count probes are answered.
not sure if this is relevant here, but with a Raspi PI and arping these are the uage options you get, no capital -W option which is rejected if you execute with it.
pi@raspberrypi:~ $ arping
Usage: arping [-fqbDUAV] [-c count] [-w timeout] [-I device] [-s source] destination
-f : quit on first reply
-q : be quiet
-b : keep broadcasting, don’t go unicast
-D : duplicate address detection mode
-U : Unsolicited ARP mode, update your neighbours
-A : ARP answer mode, update your neighbours
-V : print version and exit
-c count : how many packets to send
-w timeout : how long to wait for a reply
-I device : which ethernet device to use
-s source : source ip address
destination : ask for what ip address