Uses command line access to WiFi information via Mozilla Location Services API from Python. The command line programs used to access WiFi information include:
Note that a similar service with better accuracy is available from Google.
Get latest release
pip install mozloc
or for latest development version:
git clone https://github.com/scivision/mozilla-location-wifi/
pip install -e ./mozilla-location-wifi
python -m mozloc
Shows time
lat
lng
accuracy
N BSSIDs heard
.
In urban areas, accuracy of less than 100 meters is possible.
dump raw signals, without using API:
python -m mozloc --dump
Note: macOS 14.4+ no longer works as "airport" has been removed. If someone has time to implement, perhaps starting with example CoreLocation code, we would welcome a PR.
On macOS, much more accurate results come by running as root by using sudo. This is because "airport" only emits BSSID if running with sudo.
Possible future implementation could use CoreWLAN.
On Windows, NetSH is used. You may need to disconnect from WiFi (leave WiFi enabled) to make your WiFi chipset scan and be able to get location.
Display logged data in Google Earth or other KML viewer after converting from CSV to KML:
python -m mozloc.csv2kml in.log out.kml
which uses
pip install simplekml
Note that your time MUST be in ISO 8601 format or some KML reading programs such as Google Earth will just show a blank file. E.g.
2016-07-24T12:34:56
Would like to add Bluetooth beacons.
To print verbose information about nearby WiFi:
- Windows:
netsh wlan show networks mode=bssid
- MacOS:
airport -s
- Linux:
nmcli dev wifi list