ARPING does not work in openHAB, but it does on cmd

  • Platform information:
    • Hardware: Synology DS 218+
    • OS: Docker
    • Java Runtime Environment: Docker
    • openHAB version: 2.4.0
  • Issue of the topic: ARPING not working
  • Please post configurations (if applicable):
    • Items configuration related to the issue
    • Sitemap configuration related to the issue
    • Rules code related to the issue
    • Services configuration related to the issue

Hello all,

i got arping for the network binding working in docker on its cmd (with user openhab), but it does not work in openhab itself; it always states “arp_state Disabled”. I don’t know what else i could try.
I checked the path, it is correct, the user openhab ca use arping. there is no error in the openhab log.
I tried a lot, I restarted Openhab, i recreated the items in their .items file, …

How can i find out why it is disabled? what am I doing wrong here?

I know very little about Docker but I can post what I have in my network.cfg file and hopefully it will help.

binding.network:allowSystemPings=true
binding.network:allowDHCPlisten=false
binding.network:arpPingToolPath=arping
binding,network:cacheDeviceStateTimeInMS=2000
uses_arp_pings=yes

Thanks for your answer,
sadly, nothing changed. neither disabling dhcp nor “uses_arp_ping”.

if the path is wrong, i get an error. i set the path right, as there is no error.
it still shows arping_state = disabled…

:frowning:

EDIT:
i created an sh script for logging what openhab does, aparently openhab does never execute arping at all?

why?

Are the permissions set correctly for arping? Also which arp ping did you install?

This is listed in the doco for setting the permission:

chmod u+s /usr/sbin/arping

yes, they are by default in docker (arping is preinstalled in the docker image).

As you can see, i am executing arping from the openhab user inside the container, the same openhab uses. As the script of mine does not log anything, it does not get triggered at all. Openhab seems to not even try it. Strange…

it is arping V2.14 by Thomas Habets.

Is there some check the network binding does, which makes it think arping is not available?

Can you put the binding in TRACE? You’ll see that arping does in fact work, it’s just incorrectly indicated in the UI as being unavailable :slight_smile:

Also see https://community.openhab.org/t/adventures-implementing-reliable-network-detection-using-arping

This is also in Docker…

hmm…it does indeed say it performs ARP pings, and there are no errors…

i will see, if my phone gets lost tonight in deep sleep or not… thanks so far :slight_smile:

There is a recent thread of another user having problems with arping and he is going to submit a fix soon.
arping might be broken in the current release.

If you use Paper UI, please don’t apply those lines shown above. The binding can and should be fully configured via Paper UI (section Bindings).

If you use text files, don’t apply those lines as well. The defaults are on auto-detection. You only want to DISABLE something via the configuration. You can’t enable anything. And the last line is … completely nonsense. Without the “binding.network” part openHAB will not know to which binding that setting should be applied. Please always stick to the binding documentation.

Thank you,
I try to configure as much as possible (if not all) in text files (I had things configured via Paper UI before…), since everything that was not was a mess when trying to move from a native openhab system to the docker image…

my mobile phone did not get lost in deep sleep tonight, so i guess it is indeed working!

i will modify my network.cfg and throw out everything unnecessary as you said.

How does your .things File look like ? And your .items File too ?

I have the following SetUp in .network.cfg

binding.network:allowSystemPings=true
binding.network:allowDHCPlisten=false
binding.network:arpPingToolPath=arping
binding.network:cacheDeviceStateTimeInMS=2000

.things

Thing network:pingdevice:192_168_178_38     [ hostname="192.168.178.38", retry=1, timeout=5000, refreshInterval=60000 ]
Thing network:pingdevice:192_168_178_57     [ hostname="192.168.178.57", retry=1, timeout=5000, refreshInterval=60000 ]
Thing network:pingdevice:192_168_178_20     [ hostname="192.168.178.20", retry=1, timeout=5000, refreshInterval=60000 ]

.items

Switch              Printer_WF2760              "Drucker WF-2760 [MAP(tech.map):%s]"            <workforce>   (EG_Buro,gNet)    {channel="network:pingdevice:192_168_178_38:online"}
Switch              RasPi_online                "Raspberry Office[MAP(tech.map):%s]"            <network>     (EG_Buro,gNet)    {channel="network:pingdevice:192_168_178_57:online"}
Switch              iPhone_Peter                "iPhone Peter [MAP(tech.map):%s]"               <iphone>      (EG_Buro,gNet)    {channel="network:pingdevice:192_168_178_20:online"}

and the result looks like