Skip to content

Part 2. Scanning for Devices

Rachel edited this page Aug 24, 2016 · 3 revisions

I decided to use a tool called arp-scan to look for devices on my network. Arp-scan is an Address Resolution Protocol packet scanner that shows every active IPv4 device on your local internet.

To install arp-scan, enter:

sudo apt-get install arp-scan

Once it's installed, you can test arp-scan by running:

sudo arp-scan -l

You should see a list of devices and corresponding MAC addresses run down the screen (it could take a little while to load if on a large network).

So we can see connected devices! But we want to know when a particular device is connected, which means we need to know that device's MAC address. I decided that my phone was the best device to use to detect my presence, so I looked up how to get it's address (this can be done for any other internet connected device too).

On an iPhone

  • Go to Settings
  • -> General
  • -> About
  • Scroll down until you see "Wi-Fi Address"

On an Android phone

  • Go to Menu
  • -> Settings
  • -> About Tablet
  • -> Status
  • Scroll down until you see "Wi-Fi MAC Address"

The series of 12 letters and numbers separated by colons is the phone's MAC address.

You can check to see if your phone appears on the arp-scan list of devices by running the earlier command and looking for it, or you can run:

sudo arp-scan -l | grep PHONEMACADDRESS

If your phone was found, the command will output its address. If it wasn't found, make sure that it is connected to the same WiFi network as the Pi. You may also need to wake up your device as many devices disappear when they "sleep".

The last thing we need to install is the Initial State python streamer so that we can stream who's home and who's not!

<< Part 2: Presence Detection - Part 2: Initial State >>

Clone this wiki locally