Find the MAC address of all devices connected to the same Wifi network
I'm trying to build a software that checks what devices are connected to my home network and return a list of those device's MAC address every 10 minutes or so. My approach was to ping all of the possible IP addresses on the network and call "arp -a" afterwards. The following code works to find if a device is registered on an IP address, but I don't know how to get the MAC address from this. try { String currentIP = InetAddress.getLocalHost().toString(); String subnet = getSubnet(currentIP); System.out.println("subnet: " + subnet); for (int i=1;i<254;i++){ String host = subnet + i; System.out