Skip to main content

Assisted location services for MicroPython

Project description

micropython-agps

For use with micropython on GPRS module A9/A9G.

Examples

Location over internet connection:

# Enable data connection
import cellular
cellular.gprs("apn", "user", "pass")

# Get location
import agps
agps.get_location_opencellid(cellular.agps_station_data(), "api-token") # Please visit https://opencellid.org for getting your API token
(3.484547378491735, 78.86739615869062)

Location using local database:

Create a binary database of GSM cells:

./bs-dl.py --mcc 234 --mnc 3 --circle=-0.118092,51.509865,3 -v --token api-token # Please visit https://opencellid.org for getting your API token

Filtering is done through entries mcc - mobile country code, mnc - mobile network code and circle - location and radius of a circle with cells. All entries are optional, however, the full worldwide database is as large as 1Gb. Providing mcc and mnc will reduce the databse size down to few Mb. Providing a circle will further filter data towards the circular area specified: 3 km of urban area results in around 10Kb of data.

Note that the token is optional: without a proper token, the script will fall back to a git mirror which may contain outdated data.

Then, upload the database to the module (note the file name):

ampy --port /dev/ttyUSB0 put 234-3.bin

Finally, determine the location (no data connection needed):

# Get location
import agps
import cellular
agps.get_location_local(cellular.agps_station_data(), "234-3.bin")
(3.484547378491735, 78.86739615869062)

Raw data

Please find here.

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

micropython-agps-0.1.1.tar.gz (2.4 kB view details)

Uploaded Source

File details

Details for the file micropython-agps-0.1.1.tar.gz.

File metadata

  • Download URL: micropython-agps-0.1.1.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.5

File hashes

Hashes for micropython-agps-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2e0f13beb5b9245479aca9832da8a133fb3ee1403191505316cd554c7738afff
MD5 e64394414bb8c81746983c84a894b782
BLAKE2b-256 533330df05885500cdebcd14a39e846374a627b3df650625db0a1c8cc6ec9a52

See more details on using hashes here.

Supported by

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