Hello,
cat /tmp/dhcp.leases
there be dragons for this suggested solution!
I faced a similar issue here. The problem with this solution is that the dhcp leases file reflect the leases not the connected devices. If a device connects, it get its DHCP lease, so its IP address and this is stored in the lease file. Depending on the time to live of a DHCP lease, this information persists. If the device disconnects the lease remains and you get false information from the lease file.
The only real information comes from an arp scan. I have modified my rc.local to install arp-scan on all my devices:
# Waiting for internet connection
RC=1
while [[ $RC -ne 0 ]] ; do
ping -c1 8.8.8.8 &> /dev/null
RC=$?
sleep 10
done
#install arp scan package
opkg update
opkg install arp-scan > /dev/kmsg
exit 0
Works on RUTOS webui release.
Best regards
Dennis