Skip to main content

Using Mozilla Location services, log location vs. time using WiFi or convert to KML.

Project description

Mozilla Location Services from Python

ci PyPi Download stats

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.signal

macOS

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

Raspberry Pi 3 / 4 / Zero W

Debian comes without NetworkManager by default. Thus we recommend using Ubuntu or similar on the Raspberry Pi with this program.

If you do use Debian with the procedure below, you lose Wifi password and stored WiFi networks.

  1. Install network manager and remove the old
    apt install network-manager
    apt purge dhcpcd5
    
  2. Reboot and try
    nmcli dev wifi list
    
    you should see several wifi access points and signal.
  3. try the MLS geolocation program above.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mozloc-1.5.0.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

mozloc-1.5.0-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file mozloc-1.5.0.tar.gz.

File metadata

  • Download URL: mozloc-1.5.0.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for mozloc-1.5.0.tar.gz
Algorithm Hash digest
SHA256 c7a5f09ce70656910cfe18f41365ff5f594b4145d5fbfaed91c7a6cb2a519267
MD5 3654985c270b0a20daf92375fad61a50
BLAKE2b-256 54dd950919baf939ced6e0f3ceaa5688a9b5689cc76542906ac52b6c8dd46b99

See more details on using hashes here.

File details

Details for the file mozloc-1.5.0-py3-none-any.whl.

File metadata

  • Download URL: mozloc-1.5.0-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for mozloc-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bbf60a9bd90378970836bc7fe675e2b069d5ced934df7befa3c8c9e0ba5704be
MD5 aac7e0ce6af46d82a4e853cef2e71eac
BLAKE2b-256 07bf5a64b2a445d266415ddf247b1914d67f71efc301fd3c3a16373b2a46282e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page