

I am not the author of the original script, I just adapted it a little bit to work with a Raspberry Pi.IF NOT "%%f"="" echo Found Raspberry Pi having IP %%f
PI NETWORK SCANNER MAC
:: Loop through arp table entries and look for Raspberry Pis MAC addressesįOR /L %%N IN (1,1,254) DO start /b ping -n 1 -w 200 %subnet%.%%N >nulįOR /f "tokens=1" %%f IN ('arp -a ^| findstr "28-cd-c1 b8-27-eb e4-5f-01 dc-26-32"') DO (
PI NETWORK SCANNER WINDOWS
:: This script, run from a Windows (10) machine, finds a Raspberry Pi on local network It is mostly based on the "arp -a" command, but it saves you some extra digging and helps you when your Raspberry Pi is not already in the Arp table.Ĭreate a text file with the following content and rename it as find_raspberry_pi.bat off If you are on Windows I suggest you to try out this script.

(To confirm if a Pi has Power Management enabled, ssh to the Pi and run: /sbin/iwconfig wlan0|grep Management) In that case, repeat the scans look for differences. Power Management may be a problem for you if you are scanning for multiple Pis on a LAN, as repeat scans might detect one Pi but not another. A Pi which has networking Power Management:on might not always respond to a scan. Because nmap is continually updated, it contains internal tables of Raspberry Pi MAC addresses (or uses other criteria to detect) and we can assume that will continue working.ĬAVEAT: If your scan does not identify all Pis you know are on the network, then repeat the scan - up to 10 times. The main difference above: we don't assume a MAC pattern, we just grep for the (summary), as this label is provided by nmap itself. MAC Address: DC:A6:32:1B:35:6A (Raspberry Pi Trading)

Here is something that's more future-proof. I could just add the "new" MAC as a comment, but the string could change again and again each model. Regarding your network, did you put correct network in net variable in network_tracker.In 2020, the accepted answer does not work anymore because the Raspberry Pi ships with a different range of MAC addresses. This will check your 192.168.2.0/24 network and then you can check if all results are as expected. Also its really unusual that you have network 192.168. That means that Fing couldnt get Mac address for your device on 192.168.1.1. The last case when Mac: is empty is really strange. Only if Fing mixes macs and ips for your raspberry… In this case you dont have problem with Fing. Script just takes mac address and looks in knowndevices.txt file for that mac and if its there than check ip after first. I think that problem should be in knowndevices.txt file. On my Raspberry I only use Wifi but if you still need to have both (you can always use just Ethernet and disconnect Raspberry from Wifi) it shloud still works. And don’t get me wrong I would love this as currently I have over 15 ping based entities set up to show my devices with fixed IP that I am expecting to be online always: This would be a super sophisticated presence detection implementation. maybe create a Lovelace custom card to show the online nodes on the network.create an integration that queries the Fing local API for the network nodes, store them in a database with their “trust status” as per the original script of fire an event if a new device is joining by changing the state of an entity.optionally create a Fing CLI based Hass.IO add-on as a low tech alternative to the Fingbox.How I could image an integration is the following: ‘model’: ‘Nighthawk XXXXXXXXXXXX Router’, So it is fairly simple as all you need in python is:Īnd you have a JSON representation of the devices on the network, that looks like this:
