{"id":13425092,"url":"https://github.com/schollz/find-lf","last_synced_at":"2025-04-04T08:05:49.694Z","repository":{"id":144202308,"uuid":"75767569","full_name":"schollz/find-lf","owner":"schollz","description":"Track the location of every Wi-Fi device (:iphone:) in your house using Raspberry Pis and FIND","archived":false,"fork":false,"pushed_at":"2018-01-25T08:45:06.000Z","size":1244,"stargazers_count":1016,"open_issues_count":29,"forks_count":119,"subscribers_count":54,"default_branch":"master","last_synced_at":"2025-03-28T07:04:42.308Z","etag":null,"topics":["smarthome","smartphone","tracking","wifi"],"latest_commit_sha":null,"homepage":"https://www.internalpositioning.com/plugins/#using-find-without-an-app","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/schollz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-12-06T20:17:38.000Z","updated_at":"2025-03-18T04:40:11.000Z","dependencies_parsed_at":"2023-04-19T14:47:40.580Z","dependency_job_id":null,"html_url":"https://github.com/schollz/find-lf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schollz%2Ffind-lf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schollz%2Ffind-lf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schollz%2Ffind-lf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schollz%2Ffind-lf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/schollz","download_url":"https://codeload.github.com/schollz/find-lf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247142018,"owners_count":20890651,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["smarthome","smartphone","tracking","wifi"],"created_at":"2024-07-31T00:01:04.419Z","updated_at":"2025-04-04T08:05:49.662Z","avatar_url":"https://github.com/schollz.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# find-lf\n\nThis is a extension of FIND, [the Framework for Internal Navigation and Discovery](https://github.com/schollz/find), which is based on the idea of [Lucius Fox's sonar system in *The Dark Knight*](http://batman.wikia.com/wiki/Lucius_Fox_(Morgan_Freeman)) that is used to track cellphones.\n\nThe system uses a network of Raspberry Pis which sniff the WiFi probe requests from WiFi-enabled devices and sends these parcels to a central server which compiles and forwards the fingerprint to the [FIND server](https://github.com/schollz/find) which then uses machine learning to classify the location based on the unique WiFi fingerprints.\n\nThis system does not require being logged into a particular WiFi - it will track *any phone/device with WiFi enabled*! (Caveat: for iOS devices it will only track if Wi-Fi is associated with a network - any network, though - because of [MAC spoofing](http://blog.mojonetworks.com/ios8-mac-randomization-analyzed/) it uses for security). This system also does not require installing any apps on a phone. Tracking occurs anytime a WiFi chip makes a probe request (which is every minute or so). For this to work, it requires a one-time setup to populate the system with known fingerprints of known locations before it can pinpoint locations (see #3 below).\n\n### Note: **It may be illegal** to monitor networks for MAC addresses, especially on networks that *you do not own*. Please check your country's laws (for US [Section 18 U.S. Code § 2511](https://www.law.cornell.edu/uscode/text/18/2511)) - [discussion](https://github.com/schollz/howmanypeoplearearound/issues/4).\n\n# How does it work?\n\nYou can setup Raspberry Pis around a house in a way that they will see different signal strengths from various WiFi devices. Each WiFi-enabled device see requests from the various Raspberry Pis with different strengths (see colored bars in Figure below). These graphs are a *fingerprint* which can be used to uniquely classify the location.\n\n![](/docs/graphic/room-schematic.png)\n\nThe Raspberry Pi cluster gets probe requests to various WiFi devices, and compiles these and forwards them to a FIND-LF server. This FIND-LF server then sends a compiled fingerprint to a main server. This system uses WiFi probe requests, which occur on any WiFi enabled device, as long as WiFi is enabled. These probe requests generally occur when a scan takes place, which is every few minutes when the phone is being used.\n\n![](/docs/graphic/find-lf-example.png)\n\nOnce sent to the FIND server, the location can be directly determined. For more information about this, see the [FIND README](https://github.com/schollz/find).\n\n# Requirements\n\nYou will need a Raspberry Pi. Ones with built-in Wifi work best:\n\n- [Raspberry Pi Zero W](https://www.amazon.com/gp/product/B071L2ZQZX/ref=as_li_tl?ie=UTF8\u0026tag=scholl-20\u0026camp=1789\u0026creative=9325\u0026linkCode=as2\u0026creativeASIN=B071L2ZQZX\u0026linkId=ab2f9d564a4f517c5b004a760d0d6e29)\n- [Raspberry Pi 3](https://www.amazon.com/gp/product/B01C6EQNNK/ref=as_li_tl?ie=UTF8\u0026tag=scholl-20\u0026camp=1789\u0026creative=9325\u0026linkCode=as2\u0026creativeASIN=B01C6EQNNK\u0026linkId=805012388be781415a6be827b50c76ac)\n\nYou will need a monitor-mode enabled wifi USB adapter. There are a number of possible USB WiFi adapters that support monitor mode. Here's a list that are popular:\n\n- [USB Rt3070 $14](https://www.amazon.com/gp/product/B00NAXX40C/ref=as_li_tl?ie=UTF8\u0026tag=scholl-20\u0026camp=1789\u0026creative=9325\u0026linkCode=as2\u0026creativeASIN=B00NAXX40C\u0026linkId=b72d3a481799c15e483ea93c551742f4)\n- [Panda PAU5 $14](https://www.amazon.com/gp/product/B00EQT0YK2/ref=as_li_tl?ie=UTF8\u0026tag=scholl-20\u0026camp=1789\u0026creative=9325\u0026linkCode=as2\u0026creativeASIN=B00EQT0YK2\u0026linkId=e5b954672d93f1e9ce9c9981331515c4)\n- [Panda PAU6 $15](https://www.amazon.com/gp/product/B00JDVRCI0/ref=as_li_tl?ie=UTF8\u0026tag=scholl-20\u0026camp=1789\u0026creative=9325\u0026linkCode=as2\u0026creativeASIN=B00JDVRCI0\u0026linkId=e73e93e020941cada0e64b92186a2546)\n- [Panda PAU9 $36](https://www.amazon.com/gp/product/B01LY35HGO/ref=as_li_tl?ie=UTF8\u0026tag=scholl-20\u0026camp=1789\u0026creative=9325\u0026linkCode=as2\u0026creativeASIN=B01LY35HGO\u0026linkId=e63f3beda9855abd59009d6173234918)\n- [Alfa AWUSO36NH $33](https://www.amazon.com/gp/product/B0035APGP6/ref=as_li_tl?ie=UTF8\u0026tag=scholl-20\u0026camp=1789\u0026creative=9325\u0026linkCode=as2\u0026creativeASIN=B0035APGP6\u0026linkId=b4e25ba82357ca6f1a33cb23941befb3)\n- [Alfa AWUS036NHA $40](https://www.amazon.com/gp/product/B004Y6MIXS/ref=as_li_tl?ie=UTF8\u0026tag=scholl-20\u0026camp=1789\u0026creative=9325\u0026linkCode=as2\u0026creativeASIN=B004Y6MIXS\u0026linkId=0277ca161967134a7f75dd7b3443bded)\n- [Alfa AWUS036NEH $40](https://www.amazon.com/gp/product/B0035OCVO6/ref=as_li_tl?ie=UTF8\u0026tag=scholl-20\u0026camp=1789\u0026creative=9325\u0026linkCode=as2\u0026creativeASIN=B0035OCVO6\u0026linkId=bd45697540120291a2f6e169dcf81b96)\n- [Sabrent NT-WGHU $15 (b/g) only](https://www.amazon.com/gp/product/B003EVO9U4/ref=as_li_tl?ie=UTF8\u0026tag=scholl-20\u0026camp=1789\u0026creative=9325\u0026linkCode=as2\u0026creativeASIN=B003EVO9U4\u0026linkId=06d4784d38b6bcef5957f3f6e74af8c8)\n\nNamely you want to find a USB adapter with one of the following chipsets: Atheros AR9271, Ralink RT3070, Ralink RT3572, or Ralink RT5572.\n\n\n# Setup\n\n## 1. Initialize Pis\n\n[Install Raspbian lite](https://www.raspberrypi.org/downloads/raspbian/) onto a Pi. If you don't use the `pi` user, make sure to give the user sudo acess. Then initialize the Raspberry Pi with the following script\n```\nsudo sh -c \"$(curl -fsSL https://raw.githubusercontent.com/schollz/find-lf/master/node/initialize.sh)\"\n```\nAlternatively, you can do this using [my script](https://raw.githubusercontent.com/schollz/find-lf/master/node/pibakery.xml) for [PiBakery](http://www.pibakery.org/).\n\nAlso edit `/etc/network/interfaces` and remove the `wpa-conf` line for `wlan1`.\n\nDo this for several Pis and then plug in the WiFi adapter that has \"monitor\" mode.\n\n## 2. Start Pi cluster\n\nFirst make sure you have SSH installed and nmap.\n\n```\nsudo apt-get install openssh-client openssh-server nmap\n```\n\nIts useful to add your SSH key to each Pi, which you can do just using:\n\n```\nssh-keygen                                               # do this once\ncat ~/.ssh/id_rsa.pub | ssh pi@1YOURADDRESS \\\n  \"mkdir -p ~/.ssh \u0026\u0026 cat \u003e\u003e ~/.ssh/authorized_keys\"     # do for every Pi\n```\n\nThen download `cluster.py` for accessing the cluster\n```\nwget https://raw.githubusercontent.com/schollz/find-lf/master/tools/cluster.py\n```\n\nThen, to initialize, just run\n```\npython3 cluster.py initialize\n```\nto which you'll be asked for the information about your cluster. Choose any `group` that you want, but remember it, as you will need it to login to the FIND server. For the `lf address`, you can use the default (a public server) or set it to your own. See `find-lf/server/README.md` for more information.\n\nTo easily find which hostnames/IPs are on your network, use\n\n```\npython3 cluster.py list\n```\n\nStartup the Pi cluster using `python3.py cluster start`. You can check the status with `python3 cluster.py status`\n\n## 3. Classify locations using Pi cluster\n\nAfter the cluster is up in running, you need to do learning. Take a smart phone and identify its mac address, something like `AA:BB:CC:DD:EE:FF`. Take your phone to a location. Then activate the find-lf server to do learning either by switching on [the find-lf website](https://lf.internalpositioning.com) or running `python3 cluster.py -u AA:BB:CC:DD:EE:FF -l location learn`.\n\n*This is important!* Before moving to a new location, make sure to turn off learning by switching to tracking. Activate this on the find-lf server using the [the find-lf website](https://lf.internalpositioning.com) or use `python3 cluster.py track`.\n\nRepeat these steps for as many locations as you want.\n\n## 4. Track all the cellphones!\n\nNow just go to https://ml.internalpositioning.com and login using your group name to see tracking of all the phones!\n\nYou can also track a single phone using https://ml.internalpositioning.com/GROUP/dashboard?user=AA:BB:CC:DD:EE:FF.\n\n# License\n\nCopyright 2015-2017 Zack Scholl (zack@hypercubeplatforms.com, @zack_118). All rights reserved. Use of this source code is governed by a AGPL license that can be found in the LICENSE file.\n\n# Todo\n\n- [ ] Determine the wlan0/1 of the Wi-Fi adapter automatically (currently it defaults to wlan1, which is right most of the time)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschollz%2Ffind-lf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fschollz%2Ffind-lf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschollz%2Ffind-lf/lists"}