I want to detect if my iPhone connects / is connected to my LAN, so I can turn on the lights. This is pretty close to this question https://serverfault.com/questions/91369/how-to-detect-an-iphone-connecting-a-network
I want to detect if my iPhone (with or without a known IP / MAC) is active on the LAN by polling, log scanning, event trigging or something else.
This will be done from the router, which is running Ubuntu, dhcpd and ufw.
One option would be to make the dhcpd run a script
on commit, but the iPhone rarely changes IP, so I guess that wouldn't work.
nmap -v -sP 10.0.0.73 but it only works sometimes. When it does, it outputs this:
Starting Nmap 6.47 ( http://nmap.org ) at 2015-02-12 22:54 CET Initiating Ping Scan at 22:54 Scanning 10.0.0.73 [2 ports] Completed Ping Scan at 22:54, 1.61s elapsed (1 total hosts) Initiating Parallel DNS resolution of 1 host. at 22:54 Completed Parallel DNS resolution of 1 host. at 22:54, 0.00s elapsed Nmap scan report for 10.0.0.73 Host is up (0.10s latency). Read data files from: /usr/local/bin/../share/nmap Nmap done: 1 IP address (1 host up) scanned in 1.62 seconds
I've tried some other options, including ping and arp, non of which I've got to work reliably (probably doing something wrong).
Help is greatly appreciated!