Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Bluetooth LE app for TomTom GPS watches: Runner, MultiSport, Cardio, Spark, Runner v2

License

NotificationsYou must be signed in to change notification settings

dlenski/ttblue

Repository files navigation

Build Status

Table of Contents

Introduction

The TomTom Multi-Sport and Runner are nice GPS watches and quiteaffordable, but they suffer from subpar official software. There is noofficial desktop app for interfacingwirelessly with the TomTom GPS watches,(only for Android and iPhone).

Now you can usettblue to download your activites wirelessly andkeep the QuickFix GPS ephemeris data up-to-date.

Building

Requirements

You need to be running a recent Linux kernel, with a Bluetooth4.0 adaptersupportingBluetooth Low Energy.Many newer PCs include built in Bluetooth 4.0 adapters; if you need one, I've hadgood success withthis $6dongle,which works out-of-the-box with thebtusb driver from recent Linuxkernels.

Thelibbluetooth (BlueZ),libcurl, andpopt libraries are required.On Debian/Ubuntu-based systems, these can be installed with:

$ sudo apt-get install libbluetooth-dev libcurl4-gnutls-dev libpopt-dev

Compiling

Compilation withgcc should be straightforward:

$ make$ make setcap# requires sudo/root access

To fix the issue withvery slow file transfers, themost secure solution I've been able to come up with so far is to givethe binary elevated capabilities as discussedon StackExchange:make setcap will do this automatically or you can do it manually asfollows:

sudo setcap'cap_net_raw,cap_net_admin+eip' ttblue

(Note that this ismore secure than giving the binarysetuid root permissions, becauseit only allows root-like privileges for these specific capabilities.)

Use it

For initial pairing, you'll need to go to thePhone|Pair Newmenu on the watch.

For subsequent reconnection, ensure thatPhone|Sync is enabled,and you may need to "wake up" the device's BLE radio by pressing afew buttons.

Try the following command line:

./ttblue -a [-d <bluetooth-address>] [-c <pairing-code>] [-s <activity-store>]
  • bluetooth-address is the MAC address of your TomTom GPS watch, forexampleE4:04:39:17:62:B1. If not specified,ttblue will attemptto scan for BLE devices, and try to connect to the first onematching TomTom's vendor ID (E4:04:39).

  • Thepairing-code is a previously-used pairing code (can be from one ofthe "official" TomTom mobile apps). If left blank,ttblue will tryto create a new pairing.

  • The-a/--auto option tellsttblue to download all activities andupdate QuickFixGPS.

  • The-s/--activity-store option specifies a location for.ttbinactivity files to be output (current directory is the default).

As invoked above,ttblue will download your activity files (saved as0091000n_YYYYMMDD_HHmmSS.ttbin), and attempt to download theQuickGPSFix update and send it to the watch. (You can then usettbincnvto convert the TTBIN files to GPX/TCX format.)

$ ./ttblue -a -d E4:04:39:17:62:B1 -c 123456Opening L2CAP LE connection on ATT channel: src: 00:00:00:00:00:00dest: E4:04:39:17:62:B1Connected to HC4354G00150.  maker     : TomTom Fitness  serial    : HC4354G00150  user_name : Lenski  model_name: Runner  model_num : 1001  firmware  : 1.8.42  rssi      : -90 dBSetting PHONE menu to 'dlenski-ultra-0'.Found 1 activity files on watch.  Reading activity file 00910000 ...11: read 55000 bytes from watch (1807/sec)    Saved 55000 bytes to ./00910000_20150801_123616.ttbin    Deleting activity file 00910000 ...Updating QuickFixGPS...  Last update was at at Sat Aug 1 04:11:03 2015.  Downloading http://gpsquickfix.services.tomtom.com/fitness/sifgps.f2p3enc.ee?timestamp=1439172006  Sending update to watch (32150 bytes)...7: wrote 32150 bytes to watch (1891/sec)

There's also a fairly rudimentary "daemon" mode whereinttblue justloops over and over (by default it waits an hour to retry after asuccessful connection, but only 10 seconds after a failed one), and a-p/--post option to specify a command to be run on eachsuccessfully downloaded.ttbin file (seettbin2strava.sh)for an example):

$ ./ttblue -a --daemon -d e4:04:39:17:62:b1 -c 123456 -s ~/ttbin -p ttbin2strava.sh

Why so slow?

By default, Linux (as of 3.19.0) specifies a very intermittent connection interval for BLE devices. This makes sense for things like beacons and thermometers, but it is bad for devices that use BLE to transfer large files because the transfer rate is directlylimited by the BLE connection interval.

If you run asroot or if yougive thettblue binary elevated capabilities, it will attempt to set the minimum connection interval (7.5 ms) and activity file downloads will proceedmuch faster (about 1800 B/svs. 500 B/s for me).

Unfortunately, elevated permissions are required to configure this feature of a BLE connection. For gory details, seethis thread on the BlueZ mailing list.

TODO

  • More command line options?
  • Real config file?
  • Better daemon mode that actually puts itself in the backgroundand writes output to a log file?
  • Integrate withttwatchwhich already does all these things, but over USB?

Protocol documentation

Seett_bluetooth.md for reverse-engineered protocol documentation.

Credits

@ryanbinns did a lot of the heavylifting by writing his excellentttwatch utility to sync withTomTom GPS watches overUSB, and in the process documenting thettbin binary format of the activity files, as well as many of theinternal data structures of the units.

@Grimler91 for adding support forTomTom GPS watches using the "v2" protocol. (Spark, Runner v2, etc.)

License

I'd like to license it asGPLv3 or later, but it uses snippets from the BlueZ source which areGPLv2 so... let's call it GPLv2 or later?

By Dan Lenski <dlenski@gmail.com> © 2015


[8]ページ先頭

©2009-2025 Movatter.jp