Using Mozilla Location services, log location vs. time using WiFi or convert to KML.
Project description
Mozilla Location Services from Python
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.
Install
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
Usage
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
macOS
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.
Windows
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.
convert to KML
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
TODO
Would like to add Bluetooth beacons.
Notes
To print verbose information about nearby WiFi:
- Windows:
netsh wlan show networks mode=bssid
- MacOS:
airport -s
- Linux:
nmcli dev wifi list
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mozloc-1.7.0.tar.gz
.
File metadata
- Download URL: mozloc-1.7.0.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 583aa51cb66a3ba03b276b50bb6cc76919d2dc92692fbd46ee2ec6bdf6e24782 |
|
MD5 | 31bbb1f4d2396d0caf8b6283c558947d |
|
BLAKE2b-256 | 3a148de099c6b89e0c66a812be85a322cf9cfce8bfe976be3dbc62b92f3c9a19 |
File details
Details for the file mozloc-1.7.0-py3-none-any.whl
.
File metadata
- Download URL: mozloc-1.7.0-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a85f688933d4d0a880a5eb99c643294f2580b9f5ec4357f6b572d277b11ba5c |
|
MD5 | 459b6ab51f7ad289c16a60ec6697414a |
|
BLAKE2b-256 | f6d61eae3b800b1cbb2d62d44952ad699f553cbf399bac20bddefabfdbc7577a |