Python driver for SkyTraq Venus GPS data loggers — download, decode and export datalog flash
Project description
skytraq-datalog
Python driver for SkyTraq Venus GPS data loggers (as used in the CanWay GPS app, circa 2012). Downloads the device's flash datalog over USB-serial and exports it as GPX.
Ported from reverse-engineered C# using the SkyTraq binary protocol.
Requirements
- Python 3.11+
pyserial >= 3.5tqdm >= 4.60
Installation
pip install skytraq-datalog
This installs the skytraq-download command.
Usage
Command line
Either use as module with python -m skytraq or as tool skytraq-download
# Download all tracks, one GPX file per trip
skytraq-download /dev/ttyUSB0
# Custom file prefix
skytraq-download /dev/ttyUSB0 --prefix my_hike
# All trips in one file
skytraq-download /dev/ttyUSB0 --single --out all_tracks.gpx
# Custom initial baud rate (driver switches to 115200 automatically)
skytraq-download /dev/ttyUSB0 --baud 38400
# Adjust the gap that separates trips (default: 10 minutes)
skytraq-download /dev/ttyUSB0 --gap 5
By default each trip is written to a separate file named by its UTC start time:
tracks_2024-03-01_09-15-00.gpx, tracks_2024-03-01_14-32-00.gpx, …
Python API
from skytraq.gps import SkytraqGPS
from skytraq.gpx import export_gpx, export_gpx_split
gps = SkytraqGPS("/dev/ttyUSB0")
points = gps.download_tracks() # connects, downloads, reboots device
# One file per trip (split on >10 min gaps or device trip-start markers):
paths = export_gpx_split(points, "track")
# Or everything in one file:
export_gpx(points, "all_tracks.gpx")
How it works
- Opens the serial port and commands the device to switch to 115200 baud.
- Queries flash log metadata (sector count, time/distance/speed thresholds).
- Downloads raw 4096-byte flash sectors in batches, verifying each with an XOR checksum.
- Reboots the device so it returns to its default baud rate.
- Decodes each sector entry: GPS week number + time-of-week → UTC, ECEF → LLA, speed.
- Writes GPX 1.1 files with
<trkpt>,<ele>,<time>, and<speed>elements.
Entry types decoded
| Type | Size | Notes |
|---|---|---|
FIX_FULL |
18 B | Absolute position (ECEF) + absolute timestamp |
FIX_HALF |
8 B | Differential ECEF delta + delta TOW from previous entry |
FIX_POI |
18 B | Point-of-interest, same encoding as FIX_FULL |
FIX_FULL_MULTI_HZ |
20 B | High-frequency fix; direct LLA fixed-point + ms TOW |
FIX_POI_MULTI_HZ |
20 B | High-frequency POI |
FIX_FULL_TRIP |
— | FIX_FULL promoted to trip-start by a flag bit |
FIX_FULL_TRIP_MULTI_HZ |
— | FIX_FULL_MULTI_HZ promoted to trip-start |
Known limitations
- GPS leap-second offset is hard-coded to 15 seconds (correct for data logged before 2017-01-01; add 1 second per subsequent leap second if needed).
- Altitude is ellipsoidal height (WGS-84). No EGM96 geoid correction is applied, so altitudes read roughly 10–50 m higher than mean sea level depending on location.
Project layout
src/
├── __main__.py # CLI entry point (skytraq-download)
├── gps.py # SkytraqGPS driver: serial I/O, packet framing, commands
├── decompress.py # Flash sector decoder: entry parsing, coordinate conversion
├── gpx.py # GPX 1.1 writer and trip splitter
└── types.py # Dataclasses (LogPoint, LogInfo, LLA, ECEF) and enums
License
MIT
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file skytraq_datalog-0.1.1.tar.gz.
File metadata
- Download URL: skytraq_datalog-0.1.1.tar.gz
- Upload date:
- Size: 24.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d62920b92b7ce8327e9972f7604f26c49576c43b31cb0cd7970c3427734c456c
|
|
| MD5 |
d9b4cc9a3e91cf3942225378cc28c858
|
|
| BLAKE2b-256 |
52314854ee4ba76db17f1a727d8a2724e4f33238faf391beea7e4b301f9a6a63
|
File details
Details for the file skytraq_datalog-0.1.1-py3-none-any.whl.
File metadata
- Download URL: skytraq_datalog-0.1.1-py3-none-any.whl
- Upload date:
- Size: 24.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce83a939c0f5af6a873f5adaa4fdf50e5df0e7fc4b82f41a85f5e94e5fb5cc89
|
|
| MD5 |
8de651b4e262c00d9d4d216b8b53b712
|
|
| BLAKE2b-256 |
f903a5c4b32da27b2d8b06bd1cca3a92a299de07f7329f653f0efc7328977d6e
|