Giter Site home page Giter Site logo

ekspla / xoss_sync Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 0.0 719 KB

A python code to bring fit files from XOSS G+ cyclo-computer over BLE

License: MIT License

Python 100.00%
ble bleak bluetooth-low-energy cycling cycplus python python3 xoss fit fit-file gps

xoss_sync's Introduction

xoss_sync

A python code to fetch fit files from XOSS G+ cyclo-computer over bluetooth (BLE) for you.

(C) 2024 ekspla

A quick/preliminary version of code for use with XOSS G+ GPS cyclo-computer, inspired by f-xoss project.

This code is a modified version of cycsync.py for Cycplus M2, which does not work for my use case as is.

The code shown here was tested with XOSS G+ (gen1), Windows10 on Core-i5, TPLink USB BT dongle (UB400, v4.0), Python-3.8.6 and Bleak-0.22.2.

Features

This script allows you to:

  • Obtain a list of data files on your device
  • Download data (in FIT fromat) from your device
  • See free/usage of storage in your device

Usage

  1. Install bluetooth low energy interface/driver software on your PC.

  2. Check if your device and the PC are paired.

  3. Install python (of course).

  4. Install bleak:

pip install bleak
  1. Download and run the script python xoss_sync.py:
D:\backup\Bicycle\XOSS\python>python xoss_sync.py
Scanning for Bluetooth devices...
Found device: XOSS G-040989 - EC:37:9F:xx:yy:zz
Found target device: XOSS G-040989 - EC:37:9F:xx:yy:zz
Connected to XOSS G-040989
Notifications started
Free Diskspace: 684/8104kb
Successfully wrote combined data to filelist.txt
Skip: 20240713062144.fit
Skip: 20240609141047.fit
Skip: 20240504063456.fit
Skip: 20240525060956.fit
Skip: 20240511055922.fit
Skip: 20240609130215.fit
Skip: 20240608063049.fit
Skip: 20240615062615.fit
Retrieving 20240715062336.fit
Successfully wrote combined data to 20240715062336.fit
Skip: 20240420055014.fit
Skip: 20240427061131.fit
Skip: 20240502061739.fit
Skip: 20240518060936.fit
Skip: 20240707055411.fit
Skip: 20240429060242.fit
Skip: 20240622055813.fit
Skip: 20240629073413.fit
Skip: 20240506053748.fit
Skip: 20240706062605.fit
Skip: 20240601060515.fit

D:\backup\Bicycle\XOSS\python>

Though I tested this only with XOSS G+ (gen1) and Windows10 & 11, combinations of the other XOSS device/OS might work. C.f. Bleak supports Android, MacOS, Windows, and Linux.

Limitation

The script seems to work perfectly for my use case as shown above, but there are possible limitations due mainly to the implementation of YMODEM in part as followings.

  • The script expects a transport with MTU of 23, 128-byte data per block, and CRC16/ARC (not CRC16/XMODEM). I am not sure if the SoC(seems to be nRF52832)/software in the XOSS device supports larger MTU or 1024-byte data in YMODEM (see, Notes 1 & 2).

Notes

  1. My XOSS-G+ (Gen1) was found to be not changing MTU(23)/data size(128) with Win11 and Bluetooth 5.1 interface, which always requests MTU of 525, while f-xoss project for XOSS-NAV used MTU of 206.

  2. The proprietary XOSS App on mobile phone itself seems to support larger MTU/data size by DLE (data length extension) and STX. See, for example this Xingzhe's web site.

xoss_sync's People

Contributors

ekspla avatar

Stargazers

 avatar  avatar

Watchers

Lucian avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.