I’ve done several searches for what I’m looking for, but I only find people unable to ping their arduino. What I want to do is control an alarm system by the presence of my smartphone on the network. Assume my phone is on the same lan as the arduino. The phone has a static IP address. The basic logic is: ping the phone. Is phone present? No, wait 5 minutes and start over. If Yes, turn off logical switch. The phone will actually be on the same network via wifi, but I can’t see where that is significant. I don’t want to have to rely on a client on the phone, or do anything to the phone that would kill the battery. Anyone have any suggestions on how to proceed. I have a uno and an ethernet shield.
There is no support for ICMP (a Ping is an ICMP echo request/reply packet pair) in the Ethernet library but you can do the programming yourself. The Wiznet 5100 chip supports an IP Raw mode and there you could set the IP protocol directly (ICMP is 1). You find the relevant information on page 55/56 of the Wiznet 5100 datasheet.
Please keep in mind that the reception of an ICMP echo reply packet is no authentication of the sender. Anybody with access to your network may send such a reply. I would at least check the MAC address although that’s just a minor improvement. Never use such a mechanism if security is just a minimal concern.