Network Binding arping not working


(Remco) #1

I run openhab on a raspberry pi b2. Installed the network binding. scanned for my mobile phone, has a fixed ipadress. added the thing through paperui. works as expected.

When I check properties the thing, it tells me ‘uses_arpings No’ and ‘Uses dhcp listen NO’. I created a network.cfg in the services folder

binding.network:allowSystemPings=true
binding.network:allowDHCPlisten=true
binding.network:arpPingToolPath=/usr/bin/arping
binding.network:cacheDeviceStateTimeInMS=2000

I checked the user rights on arping, used it with /usr/bin/arping and just arping. It all works from prompt.

What am I missing here? Do I need to manually create a item for it? How do I get “Uses Arp_pings YES”?


(Remco) #2

Ok, i found some more information in another topic.

I created the following device in custom.things file:
Thing network:pingdevice:OnePlus5t [ hostname=“10.0.0.30”, uses_dhcp_listen=1, uses_arp_pings=1, retry=30, timeout=5000, refreshInterval=30000 ]

but still:

uses_dhcp_listen no
dhcp_state Running normally
presence_detection_type
arp_state IPUTILS_ARPING
uses_ios_wakeup On
icmp_state IPUTILS_LINUX_PING
uses_arp_pings no

I can see some change though, ios_wakeup is now on while I have not specified it. Cannot turn it of. I use android so I just want the arping and the dhcp_listen on yes.


(Rossko57) #3

Make sure you haven’t duplicated your Thing name in the PaperUI and xxx.things file versions. You’ll want to delete the PaperUI one if so.


(Remco) #4

Thanks. I did remove the device before adding it mannually. And I used a different name to be sure.


(CM6.5 H102) #5

@khakzoy if it help’s, here’s my network.cfg file that works well with OH.

etc/openhab2/services/network.cfg

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

(Remco) #6

Thanks, I added the line to my network.cfg. Added the device once more and now I have

uses_dhcp_listen no
dhcp_state Running normally
presence_detection_type ARP_PING, ICMP_PING
arp_state IPUTILS_ARPING
uses_ios_wakeup On
icmp_state IPUTILS_LINUX_PING
uses_arp_pings no

Still tells me no but now there is arp_ping at presence type so there is some progress. :slight_smile:


(Remco) #7

I still have the same output, uses_arp_ping no. But the presence detection is working as intended, it is fast an reliable so for now this is just fine. I will look into it further when I have a better understanding of OpenHab. There is so much cool stuff to look into so for now I will park this and return to it later. Thanks for the help so far.


(CM6.5 H102) #8

I’m not sure why the output is no,:thinking: maybe try stopping OH, cleaning the cache and restarting. Or, as you mentioned, its working so not a big deal what the output is.

I have a rule that checks when I’m present and starts a timer (20 min) when I’m away. After the 20 min, if I’m still away, other rules are used to turn stuff like lights off. If during the 20 min timer period my presents is detected the timer stops and gets reset. This prevents turning stuff off if I leave the network area for a short time e.g. walk over to the neighbors for a few minutes. If your interested let me know, I can share what I have and you can tweak it to fit your needs.

Now that arping is working, please mark the post solved by clicking the square box (lower right corner) on the post that provided the solution. Also add [Solved] to the start of the title as well.

Thanks


(Anders Alfredsson) #9

The same thing have bogged my mind, so some time ago I checked the source code from the binding. The uses_arp_pings, uses_ios_wakeup and uses_dhcp_listen are all defined in the ThingType xml-file, but in the binding code these properties are never used or updated, instead the presence_detection_type is updated according to the discovery methods that finds the device in the network. Probably the developer changed the code, but haven’t changed the ThingType xml accordingly.

Someone with more info is very welcome to correct me if I misread the code :slight_smile:


(David Graeff) #10

Correct and I have fixed this now.


(Remco) #11

Cool. Presence_detection_type was updated indeed and stated ‘Arp_Pings’. That’s why is was fine with it. Cool to see that it is fixed now. Thanks for the help anyway!


(HomeAutomation) #12

I found a little problem, not verified with latest snapshot but exist in snapshot 1443

Not on every time the binding reloads the network.cfg file on changes. Only a bundle:stop (binding number) and bundle:start (binding number) will force a reload of network.cfg file


(David Graeff) #13

Could you please open an Issue for this? I have never changed the values during runtime. I can imagine that binding modifications during runtime are not propagated to the Things.


(HomeAutomation) #14

can you lead me where to open it.