|Project Name||Stars||Downloads||Repos Using This||Packages Using This||Most Recent Commit||Total Releases||Latest Release||Open Issues||License||Language|
|Traccar||3,995||20 hours ago||417||apache-2.0||Java|
|Traccar GPS Tracking System|
|X Track||3,670||7 months ago||14||gpl-3.0||C|
|A GPS bicycle speedometer that supports offline maps and track recording|
|Traccar GPS Tracking System|
|Traccar Client Android||556||a month ago||180||apache-2.0||Kotlin|
|Traccar Client for Android|
|Pizero_bikecomputer||449||2 months ago||gpl-3.0||Python|
|An open source bike computer based on Raspberry Pi Zero (W, WH, 2W) with GPS and ANT+. Including offline map and navigation.|
|Mad Location Manager||447||5 months ago||45||mit||Java|
|Mad Location Manager is a library for GPS and Accelerometer data "fusion" with Kalman filter|
|Hckalmanfilter||212||3||3 years ago||5||January 26, 2018||15||mit||Swift|
|HCKalmanFilter is Swift implementation of Kalman filter algorithm intended to solve problem with GPS tracking|
|Traccar Manager Android||191||a month ago||42||apache-2.0||Kotlin|
|Traccar Manager for Android|
|Traccar Client Ios||182||a month ago||48||apache-2.0||Swift|
|Traccar Client for iOS|
|Corelocationcli||176||4 months ago||June 25, 2017||4||mit||Swift|
|Command line program to print location information from CoreLocation|
The availability and affordability of GPS receivers enables the access to relatively accurate positionning data. In this project, I developed a real-time GPS data logger. This multi-threaded application allows connecting to a GPSD server, retrieve real-time location data and save it to a local SQLite database. In addition, the stored data can be exported in both Keyhole Markup Language (KML) and GPS Exchange Format (GPX) formats.
To improve its performance, the application uses three distinct threads to handle the different tasks:
|Main thread||The main application thread. It manages the application configuration as well as the starting and stopping of the other threads.|
|Monitor thread||This thead retrieves the location data at regular time intervals and saves it to a synchronized shared queue.||Started and stopped before the Recorder thread|
|Recorder thread||This threads retrieves the location data from the shared queue and stores it to the SQLite database at regular time intervals.||Started and stopped after the Monitor thread|
In addition to these threads, the application (especially the Monitor thread) requires an external process (i.e., GPSD server) in order to retrieve location data. If the GPSD process is not already running (and launched with the appropriate parameters), the Monitor thread stops and the application exits.
The application launches two distinct threads to seperately handle location data retrieval and storage.
The application can be configured by altering the JSON file in the
config folder. The available parameters are the following:
|gpsd_ip_address||The GPSD server IP address (or hostname)||127.0.0.1|
|gpsd_port||The GPSD server TCP port||2947|
|start_gpsd||A flag indicating if the application should automatically start the GPSD server (This is useful especially if the GPSD service startup is set to manual)||true|
|default_device||The default port to which the USB GPS device is attached||"/dev/ttyACM0"|
|enable_new_session||A flag indicating that every time the application starts, it creates a new session||true|
|database_filename||The SQLite database filename and path||gps_logger.db|
|database||The name of the SQLite database||gps_logger|
|session_tablename||The name of the session datatable||session|
|location_tablename||The name of the location datatable||location|
|monitor_delay||The time interval of the monitor thread, in seconds||0.5|
|recorder_batch_size||The maximum number of data records stored simultaneously in the database||100|
|recorder_interval||The time interval of the recorder thread, in seconds||5|
The location data stored in the database consists of the following fields:
|latitude||Latitude in degrees||deg.|
|longitude||Longitude in degrees||deg.|
|altitude||Altitude in meters||m|
|heading||Course over ground, in degrees from true north||degrees|
|climb||Vertical speed : climb (positive) or sink (negative) rate, in meters per second||m/s|
|speed||Ground speed, in meters per second||m/s|
|mode||Indicates the status of the GPS reception (0: None, 1: No-fix, 2: 2D-Fix, 3: 3D-Fix)|
|utc_time||Full date/time string in ISO8601 format (UTC).||'%Y-%m-%dT%H:%M:%S.%fZ'|
|db_timestamp||Full date/time string of record storage to the database, according to local timezone.||'%Y-%m-%d %H:%M:%S'|
The application's database schema is illustrated below:
The GPS Data Logger database schema.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
For both Ubuntu and Raspbian, the following tools should be installed:
gpsd: the GPSD service
gpsd-clients: a client package for GPSD including cgps and xgps
python-gps: a GPSD library for Python
[email protected]:~ $ sudo apt-get install gpsd gpsd-clients python-gps
Other optional software tools for visualizing, dumping and converting GPS data can also be installed. For example, one can install:
foxtrotgps: a tool for real-time GPS navigation, track logging and trip planning
gpsbabel: a tool for GPS data conversion
Any GPS device that is compatible with the official GPSD release can be used in conjunction with this code. In this project, I used the Stratux Vk-162 Remote Mount USB GPS and it worked as intended.
Stratux Vk-162 Remote Mount USB GPS. (Photo credit: www.amazon.com)
Prior to running this project, the GPSD service should be properly configured, up and running.
The GPSD service can be typically parametrized as follows:
gpsd [-b ] [-D debuglevel] [-F control-socket] [-f framing] [-G ] [-h ] [-l ] [-n ] [-N ] [-P pidfile] [-r ] [-S listener-port] [-s speed] [-V ] [ [source-name] ...]
I use this minimalist command to configure and run the GPSD service:
[email protected]:~ $ sudo gpsd -D 4 -F /var/run/gpsd.sock -P /var/run/gpsd.pid -N -n /dev/ttyACM0
For more information about the GPSD configuration, please refer to the official documentation.
To check that the GPSD is up and running, one can use the command:
[email protected]:~ $ cgps
Running cgps command is expected to show the current device's location.
The GPS Data Logger requires the installation of two Python packages:
To install the required dependencies, the following command can be used:
[email protected]:~ $ pip install -r requirements.txt
To run the application, the following steps are recommended:
[email protected]:~ $ python3 app.py
To stop the application, the key combination
CTRL + C can be used.
This project is licensed under the MIT License - see the LICENSE file for details.