Closed fhtagnn closed 4 years ago
This work much better for me.
I think the ping is not needed. It just delays the check but has no other effect.
With https://github.com/mueslo/openwrt_hass_devicetracker/pull/30 it's also working. Can you maybe try it?
My first approach was to add sleep 5
as you did. However, this did not work in my case.
May be assicoated to the two wlan interfaces in my openwrt installation. Not sure. With the ping you make sure that the device is disassociated without adding a "fiddling factor" that each users has to adjust to his or her setup.
I am not sure how a ping would lead to the device being disassociated as at that time hostapd noticed already the device is disconnected and will disassociate it by itself.
Checking MAC addresses via
iw
has the disadvantage that clients are only removed after a timeout. To avoid a positive MAC check even though a device has been disconnected from all wlan interfaces the IPs (v4 & v6) associated with a MAC are found viaip neigh
and aping
is issued to all IPs. After theping
disconnected MAC should be removed from the iw list and theiw
check is repeated.