iPhone Presence Detection with hping3 and ARP

Are you asking about the Exec Binding? I’ve installed the 2.1 binding for OH2.

@David_Graeff I’ve upgraded to the latest openHAB build today and tried to use the new Network binding. I’m stuck at

java.lang.IllegalArgumentException: Cache expire time must be greater than 0

thrown by this code part.

Here are my configuration details:

Thing   network:pingdevice:BirkePC  [ hostname="", retry=1, timeout=5000, refreshInterval=10000 ] 


(the refresh_interval is a relic from the old binding config)

I could try to delete the cache, configuration or reinstall the Binding but I guess this could be a real bug that needs to be dealt with. Any ideas?

Yup, real bug and fixed in master.
Cheers David

I see, Thanks! Will test this evening.

Where can I find the latest jar of the network binding with the fix?

For arping, do I need to add the device MAC ID to the thing or just the ip of the device? (The demo documentation shows only the option of using hostname ip).


It was merged and is now part of the latest openHAB 2.2 snapshot. Upgrading would be an option, otherwise you can upgrade individual bindings:


The link is for influxdb …

Oh, wrong link :laughing: there you go.


I took the pull request version:

199 | Active | 80 | | Network Binding | org.openhab.binding.network

and it seems that it doesn’t work for me. The binding is working and devices that respond to ping do work, but devices that don’t respond to ping doesn’t work (status is off). When I run ‘arping’ from command line to the device I do get ping. Any idea why?

(This also happens with the version Thom pointed me too)


Please direct your questions at @David_Graeff

OK, thx

Please have a look at the thing properties (eg via PaperUI). They should tell you about the recognized arping, because there are multiple existing. arping need to run without sudo on the command line.

Regarding providing the IP or MAC: You only provide the IP, arping does the rest for us.

Cheers, David

Thx will check later today.

In my case I am able to run arping from command line.

Will it be possible (or maybe it is already exist) to specify in the thing which method should be use (ping, dhcp, arping or all)?

Will the thing will work for devices that doesn’t respond to ping (e.g. Alexa)?


Please read the documentation of the binding to find all your questions answered :wink:

It is not possible to select the method, because we use all methods at the same time to improve accuracy.

Alexa has specific tcp ports open. Just use a servicething for alexa.

Cheers, David

1 Like


Can you please explain "They should tell you about the recognized arping, "?

In my system i can run arping in command line:

19:01:06] openhabian@openHABianPi:~$ arping
ARPing 2.14, by Thomas Habets thomas@habets.se
usage: arping [ -0aAbdDeFpPqrRuUv ] [ -w ] [ -W ] [ -S <host/ip> ]
[ -T <host/ip ] [ -s ] [ -t ] [ -c ]
[ -C ] [ -i ] <host/ip/MAC | -B>
For complete usage info, use --help or check the manpage.
[19:03:49] openhabian@openHABianPi:~$ whoami
[19:03:54] openhabian@openHABianPi:~$

Please note that in my openhab binding configuration I see that the “ARP ping tool path” is set to : arping


I have tested the binding with the iputils arping, You are using Thomas version. They should both work, but we need to confirm the recognised version. Please have a look at the thing properties in paperui.

Properties are read-only and I have used them for this binding instead of the log to show all kind of information.


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.

Thing Status IIThing Status

Thanks. Jan


Hi David, i’m trying to use the new binding without the script file but it seams i’m missing something essential.

in paperui this is how my binding looks like:

thing looks like this:

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.

regards, Matt


See my properties. Also for me it seems that arping is not used

@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.