Network Binding - iPhone Presence Detection - arping Configuration question

Thank you!
Just posted this: https://github.com/openhab/openhab2-addons/issues/3112

Hope this explains it good enough.

1 Like

If not expect questions on the issue. :slight_smile:

Another way to detect MAC address presence is to parse DHCP leases. I do just that on my DHCP server - and send the presences to Openhab through MQTT.

Here is what I wrote - in production at my home.

I also opened a thread about it.

1 Like

Does it work even when the phones are in deep sleep mode ?

With the right retry and timeout value. See Presence arrival using DHCPlisten possible?

1 Like

Thank you I am trying to install arping 2.19 now.

I downloaded the .tar.gz put it on my raspberry and unpacked it now I want to install it but I get this error:

[15:16:19] openhabian@openHABianPi:~$ cd arping-arping-2.19
[15:16:27] openhabian@openHABianPi:~/arping-arping-2.19$ ls
bootstrap.sh  doc    fuzz        INSTALL  Makefile.am         README
configure.ac  extra  HACKING.md  LICENSE  Makefile.am.common  src
[15:16:28] openhabian@openHABianPi:~/arping-arping-2.19$ ./configure
-bash: ./configure: No such file or directory
[15:17:51] openhabian@openHABianPi:~/arping-arping-2.19$ make
make: *** No targets specified and no makefile found.  Stop.
[15:17:51] openhabian@openHABianPi:~/arping-arping-2.19$ sudo make install
make: *** No rule to make target 'install'.  Stop.
[15:17:59] openhabian@openHABianPi:~/arping-arping-2.19$

What am I doing wrong, I was following the instructions in the install file (https://github.com/ThomasHabets/arping/blob/arping-2.x/INSTALL)

Iā€™ve never built it myself but you can open up the makefile and look to see if there is a typo on the install target.

Following this did the trick thanks a lot!

Hi, in my case I need to use sudo, IĀ“m not using Openhabian, How do I grant elevated access permissions? Thanks

https://docs.openhab.org/addons/bindings/network/readme.html#presence-detection---configure-your-openhab-installation

On Linux and MacOS you might need elevated access permissions, for instance by making the executable a suid executable (chmod u+s /usr/sbin/arping). Just test the executable on the command line, if sudo is required, you need to grant elevated permissions.

Thanks, but I done everything on that page, installed arping, set permissions, forwarded DHCP port, tested as I saw in this tread that I can arping from command line. But still get my files properties like this:

uses_dhcp_listen no
dhcp_state No access right for port 67. Bound to port 6767 instead. Port forwarding necessary!
presence_detection_type ARP_PING
arp_state THOMAS_HABERT_ARPING_WITHOUT_TIMEOUT
uses_ios_wakeup On
icmp_state IPUTILS_LINUX_PING
uses_arp_pings no

So I thought it would be some other command to pass permissions. I have a clean install raspberry pi3 with rasbian lite and Openhab installed as apt-get.

If you ran the chmod command on the arping command than you will automatically be given root when you run arping. That is what the u+s does.

You can test by running arping as your regular user. If it works you know the permissions are right. If not you havenā€™t set the suid permission correctly yet.

Just tested,

pi@OpenHab:~ $ arping -c 1 -I eth0 192.168.25.60 ARPING 192.168.25.60
60 bytes from 00:ae:fa:50:61:68 (192.168.25.60): index=0 time=237.932 msec

ā€” 192.168.25.60 statistics ā€”
1 packets transmitted, 1 packets received, 0% unanswered (0 extra)
rtt min/avg/max/std-dev = 237.932/237.932/237.932/0.000 ms
pi@OpenHab:~ $

Permissions are ok then. But file properties say ā€œno arpingā€ do I need to set the full path ā€œ/usr/sbin/arpingā€?

Thanks

File properties are things you set to configure the binding. They donā€™t set themselves. It wouldnā€™t hurt to set the full path but you also need to set uses_arp_pings to yes

Awesome thread, thank you to all contributors. Donā€™t mean to hijak this thread, but where to you configure the

ā€œuses_arp_pings to yesā€

and what syntax would I use?

Thank you so much!!

services/network.cfg file.

https://docs.openhab.org/addons/bindings/network/readme.html#binding-configuration

uses_apr_pings=yes

I created the network.cfg file but it did not work, I guess that those file on ā€œ/servicesā€ are bindings configurations and we are trying to change a ā€œthingā€ attribute that is already default on the binding as it has the arping path. The doc is not very clear how we do that, as the only attributes it offer for ā€œthingsā€ are retry, timeout and refleshInterval. Still not sure how to get it to work.

Thanks

There is no arp ping setting to make on a Thing.

See https://docs.openhab.org/addons/bindings/network/readme.html

I donā€™t think you can configure arping on a Thing by Thing basis. It is all or nothing meaning it is a binding level config, not a Thing config.

Now that I look there is no uses_arp_pings setting. @andredts, where are you seeing these properties?

Those properties can be found on Paper UI Configurations/Things. Then below the status of your, you have a button ā€œShow propertiesā€.

That isnā€™t a configurable property.

If arping is set up and you can run it from the command line without root access, the Network binding will use it if necessary. If itā€™s necessary, and itā€™s currently using it, then that Property will show Yes.

This is for my Huawei phone, which is working absolutely spot on now that arping is up and running:

image