Skip to main content

Read-Symbian-SportsTracker-file -- How to read binary dat files.

This python script, convert_nst_files_to_gpx.py, describes how you can read symbian (Nokia) Sports Tracker files (W*.dat and R*.dat) stored in your phone as binary format. You can use this code, as it is, to convert from dat to gpx. The code depends on lxml with a fallback to built-in ElementTree. For performance reasons, use of lxml is highly recommended.

The code was tested with > 1000 of track log files copied from my Nokia phone equipped with GPS receiver, never tested with heart-rate sensor, though...

There is still a few unknown part in the track logs. So, your feedback is welcomed.

How to use

Install from PyPI

pip install symbian-sports-tracker

alternatively from github as follows:

pip install "git+https://github.com/ekspla/Read-Symbian-SportsTracker-file.git@pip_install"

or simply download/copy the *.py files to an appropriate directory from the master branch in github.

Now you can run

convert_nst_files_to_gpx input_filename.dat > output_filename.gpx

where input_filename.dat is the name of the track or route file.

The reference and test files (see below), that are not included in the package of PyPI, can be obtained from github.

Detailed explanation

This package consists of five *.py files. nst.py, scsu.py and mini_gpx.pyare pure library modules while convert_nst_files_to_gpx.py and convert_nst_rec_to_gpx.py are scripts using the modules.

convert_nst_files_to_gpx.py works also for track/route files created by the old Nokia Sports Tracker, whose format is a bit different from the new version released from Sports Tracking Technologies Ltd.
For details, please see the codes. (1-byte instead of 2-byte long header, start address of trackpoint is different, etc.)

The version number of the file is stored as WORD at 0x0008.

  • Track log files of the old Nokia SportsTracker (ver0): version < 10000.
  • Track/Route files of the old Nokia SportsTracker (ver1): 10000 <= version < 20000.
  • Track log files of Symbian SportsTracker (ver2): 20000 <= version.

The track reading function was tested for the old and the new NST versions of 9991-9998, 10102 and 20001-20002, while the route reading one was tested for version of 11400.

The file formats of symbian are completely different from those of Android and iOS.

These codes are not based on reverse engineering of the app itself, but on careful analysis of the track log files.

Non ASCII (non-alphanumeric) characters contained in the track log files that are encoded by SCSU are read by using an external module, scsu.py.
This is a ported version of Czyborra's decoder written in C, references/scsu.c.
(Characters of Arabic, Bengali, Chinese, German, Hindi, Japanese, Portuguese, Punjabi, Russian, Spanish and surrogate pairs were tested, see test_scsu/.)

Files in the phone

There are files as followings in the directory named drive_name:\SportsTracker\ (old version) or drive_name:\SportsTracker2\ (new version). Drive_name (C, D, E, etc.) depends on where you installed the app (phone memory, sd card, etc.).

  • config.dat: contains a lot of personal data, including id--name lookup tables of user and activity, etc.
  • W*.dat: track log files in binary format. The file formats of the new and the old versions are slightly different each other as mentioned before. A fetched sample file (the old format), another one (the new format) and the converted gpx files are in references/.
  • R*.dat: route files of the old version in binary format. The file format, though it lacks for timestamps, is very similar to that of track log of the old version NST.
  • Rec*.tmp: temporal track log files we see on application crash. More example is needed, yet a file useful to test was obtained from the internet. The file format seems to be very simple, see references/Rec211109168_dump.txt (a hex dump file with comments), convert_nst_rec_to_gpx.py (the script) and references/Rec211109168.gpx (the converted gpx file) for details.

Limitation

  • Units other than Metrics (km and km/h), such as Imperial (mi and mph) and Nautical (nm and kn), were not tested.

Note added for the users of www.sports-tracker.com

  • Its gpx handling code seems very faulty.
  • The time format should be YYYY-MM-DDThh:mm:ss[.SSS][+-HH:MM]. Use of Z as UTC timezone is not allowed. The resolution should be milliseconds (microseconds not allowed).

You have to modify as followings:

in format_time() of mini_gpx.py, delete .replace('+00:00', 'Z') to use +00:00 as UTC.

    return datetime.isoformat()

in store_trackpt() of nst.py, add round( , 3) to remove microseconds.

        time=dt_from_timestamp(round(tp.unix_time, 3), dt.timezone.utc), 

TODO

  • A few unknown field in the track points.
  • Support for heart rate in track log files of the new version (example files needed).

License

This software is released under the LGPL v2.1 License.

Reference

Metadata

Release files for symbian-sports-tracker 0.9.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for symbian-sports-tracker 0.9.9
File Size Uploaded
symbian_sports_tracker-0.9.9.tar.gz 32.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for symbian-sports-tracker 0.9.9
File Interpreter ABI Platform
symbian_sports_tracker-0.9.9-py3-none-any.whl Python 3 none any Details

Total release size: 69.3 kB

Release files / symbian_sports_tracker-0.9.9.tar.gz

Download URL symbian_sports_tracker-0.9.9.tar.gz
Size 32.9 kB
Tags Source
SHA-256 checksum
How to use checksums
8639c1011ea2e6892cbc3a2b27520f304cdcb5bbf88c1814f0eb7f7aa97adc41
BLAKE2b-256 checksum
How to use checksums
4616cfe7481e3dae8a9d8136e30af8c9aadf84c03dd3ba03597076b49afed6fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/29.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.4 tqdm/4.59.0 importlib-metadata/4.8.3 keyring/23.0.1 rfc3986/1.4.0 colorama/0.4.4 CPython/3.6.4

Release files / symbian_sports_tracker-0.9.9-py3-none-any.whl

Download URL symbian_sports_tracker-0.9.9-py3-none-any.whl
Size 36.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9b44afcc69a78c87c825c2748aec65a4985a1ed990d9bacbe9ddd123238794d1
BLAKE2b-256 checksum
How to use checksums
2b868271c5695ffb01a88dfdbeb898758e91fae9aa4dd0f83486dac7265dd11f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/29.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.4 tqdm/4.59.0 importlib-metadata/4.8.3 keyring/23.0.1 rfc3986/1.4.0 colorama/0.4.4 CPython/3.6.4

Release history Release notifications | RSS feed

This release

0.9.9 This release

2 release files

0.9.8

2 release files

0.9.7

2 release files

0.9.6

2 release files

0.9.5

2 release files

0.9.4

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page