Skip to main content

CLI GPSD Client

Project description

pindrop

Requirements

Setup

I'm using this tool in an old vehicle to track it's location. However, it can be used for many applications! This is just a command line wrapper for the gpsd-py3 library, which in effect is a gpsd client library. Gpsd is the server that is handling the serial communication from the modem, and will still have to be set as such. There are plenty of tutorials to set up gpsd, here is one that I find useful.

Once gpsd is successfully set up, install whereami's dependencies.

pip3 install -r requirements.txt

Operation

usage: pindrop.py [-h] [--loc] [--lat] [--lon] [--map] [--alt] [--speed]
                   [--climb] [-v] [-a]

GPSD CLI Client

optional arguments:
  -h, --help     show this help message and exit
  --loc          get location as lat/lon pair
  --lat          get latitude in decimal format
  --lon          get longitude in decimal format
  --map          get link to your location on a map
  --alt          get altitude in meters
  --speed        get speed in m/s
  --climb        get climb in m/s
  -v, --verbose  increase verbosity
  -a, --all      display all location information

Example output:

For all possible output printed in a nice way, use the -a flag for all output

pi@carbox:~ $ whereami -a

               *****
              *******
             ***   ***
             ***   ***
              *** ***
               *****
                ***
                 *
            Where Am I?

Lat,Lon: (48.4363038, -69.979379213)
Alt: 234.708 m
Speed: 0.0 m/s
Climb: 0.0 m/s
Time (UTC): 2020-02-12T20:09:53.000Z

View Here: http://www.openstreetmap.org/?mlat=48.4363038&mlon=-69.979379213&zoom=15

For terse output, you can limit your check:

pi@carbox:~ $ whereami --alt
248.763

For verbose output of a single command, use -v. You can also add multiple flags:

pi@carbox:~ $ whereami --alt --loc -v
Altitude: 245.936m
Lat,Lon: (30.436288299, -23.979343698)

Roadmap

  • Completely wrap gpsd-py3 options, all functions and variables covered.
  • Allow for many output modes (json, csv, nmea, kml)
  • Pass interface path as an argument
  • daemon mode
  • REST API Endpoint logging feature (will work with my other project, hq, in the future)
  • HomeAssistant Logging feature
  • database logging feature
  • geocoding lat/lon to address

Contributions

  • Please contribute! If there's an error let me know -- even better if you can fix it :)

  • A big thank you to anyone who has helped:

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

gpsd_pindrop-1.0.3.tar.gz (3.8 kB view details)

Uploaded Source

File details

Details for the file gpsd_pindrop-1.0.3.tar.gz.

File metadata

  • Download URL: gpsd_pindrop-1.0.3.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.3

File hashes

Hashes for gpsd_pindrop-1.0.3.tar.gz
Algorithm Hash digest
SHA256 95ada93fc694a96fdd171a33985140d91021c28c8dbfb6f2ae48be5779249d53
MD5 2ae3db6463d6a7575cdf28b470dfd62a
BLAKE2b-256 271fda6f7d9c74859eaede506bf30c0d820bff13f3ceb89ccba2cb1190e22e77

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