iPhone question:

So I can never tell when my roommate is home so he suggested making an arduino project that detects when our phones are on the wifi network. Easy, just assign both phones a static IP in the router and have an arduino ping them. The problem is, I can't figure out how to ping an iPhone and get a response. Pinging an android works fine. Anyone have any ideas on how to go about this project? The goal would be to have an LED for each of us that turns on when our phone is on the wifi network.

Thanks!

There's a library for that: GitHub - BlakeFoster/Arduino-Ping: ICMP ping library for the Arduino

pinging my iPhone 6 works fine:

Johns-MacBook-Pro:arduino john$ ping 10.0.1.14
PING 10.0.1.14 (10.0.1.14): 56 data bytes
64 bytes from 10.0.1.14: icmp_seq=0 ttl=64 time=94.131 ms
64 bytes from 10.0.1.14: icmp_seq=1 ttl=64 time=113.128 ms
64 bytes from 10.0.1.14: icmp_seq=2 ttl=64 time=31.332 ms
64 bytes from 10.0.1.14: icmp_seq=3 ttl=64 time=50.625 ms

Keep in mind that an iPhone is not permanently logged on the WiFi - especially not when in sleep mode. The same applies for Android devices but within Android there is a setting somewhere to keep WiFi enabled as long as it charges... So it's basically not that easy to "track" someone based on it's phone WiFi presence.

Thanks for the replies. I tried loading a webpage on my iPhone then pinging it and it got a response. Sleep mode may be a problem as was said.

Any other ideas on how to go about this? Doesnt have to be the phone on the wifi network, and short of us carrying an RFID I cant think of another way.

Perhaps the Bluetooth or BLE (Bluetooth Low Energy) interfaces can be detected.

I did a quick Google for iPhone presence detection and found a guy who is happy with the WiFi solution:

Bluetooth should/could work okay as my car auto connects to my iPhone (in sleep mode) when the ignition is turned on.

You should check out the app called IFTTT (if this then that). It can do various events based on position and/or connection to wifi.

Thanks for all the replies!