{"id":19650159,"url":"https://github.com/alex-hhh/pifitsync","last_synced_at":"2025-04-28T16:30:47.275Z","repository":{"id":38434321,"uuid":"76076846","full_name":"alex-hhh/PiFitSync","owner":"alex-hhh","description":"Sync FIT files from Garmin watch to a Raspberry PI","archived":false,"fork":false,"pushed_at":"2024-12-24T03:49:40.000Z","size":255,"stargazers_count":17,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-26T09:13:04.184Z","etag":null,"topics":["garmin-device","raspberry-pi"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alex-hhh.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2016-12-09T23:04:40.000Z","updated_at":"2025-04-09T10:11:29.000Z","dependencies_parsed_at":"2024-01-15T11:09:13.441Z","dependency_job_id":"a05b5393-42f8-48a8-b745-0c75cd119055","html_url":"https://github.com/alex-hhh/PiFitSync","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex-hhh%2FPiFitSync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex-hhh%2FPiFitSync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex-hhh%2FPiFitSync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex-hhh%2FPiFitSync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alex-hhh","download_url":"https://codeload.github.com/alex-hhh/PiFitSync/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251345805,"owners_count":21574782,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["garmin-device","raspberry-pi"],"created_at":"2024-11-11T14:56:45.029Z","updated_at":"2025-04-28T16:30:45.207Z","avatar_url":"https://github.com/alex-hhh.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sync FIT files on a Raspberry PI\n\nUse a [Raspberry PI](http://www.raspberrypi.org) to dowload FIT files from a\nGarmin device and make them available over a network drive.  It can be used\nfor a complete offline solution of downloading FIT files for use with programs\nsuch as [ActivityLog2](https://github.com/alex-hhh/ActivityLog2)\nor [GoldenCheetah](http://www.goldencheetah.org/), without the need to attach\nthe USB charging cradle to a laptop or having to download them from a web\nservice.\n\n![Hardware Setup](./hwsetup.jpg)\n\nThis works as follows:\n\n* The Raspberry Pi is connected to the local home network\n* USB charging cradle is connected to a USB port on the Raspberry Pi\n* When a Garmin Device is connected to the cradle for charging, all the FIT\n  files are copied off the device onto a local folder.  At the same time,\n  updated EPO data (for GPS quick sync) is copied onto the device.\n* The downloaded FIT files are shared over a network folder on the local\n  network\n* On the laptop, the FIT files show up on a network drive and can be imported\n  into ActivityLog2 or GoldenCheetah.\n\nThere is also support for downloading files using an ANT-FS USB stick, for\nolder Garmin Devices that use this method.  In that case the download is\ninitiated when the device comes in range of the Raspberry PI.\n\n## Installation an Setup\n\n### Setup network shares on the Raspberry PI\n\nWe will create two network shares.  A \"FitFiles\" read-only share accessible\nwith the \"pi\" user and your password.  FIT files will become available on that\nshare.  Another share, \"PiDropbox\" is a read-write share, that can be used to\ntransfer files onto the Raspberry PI (it is mapped to the Dropbox folder\ninside the pi home folder).\n\nTo install samba run the following:\n\n    sudo apt-get install samba samba-common-bin smbclient\n\nSetup a SAMBA password for the `pi` user, (can be different than the login\npassword, but I like to keep them the same)\n\n    sudo smbpasswd -a pi\n\nTo add exported shares for the Pi user, first create the directories to be\nshared:\n\n    mkdir ~/FitSync\n    mkdir ~/Dropbox\n\nEdit `/etc/samba/smb.conf` to enable user shares with password authenticated\nusers, add the following to the `[Global]` section (**NOTE** it is unclear why\n\"wide links=yes\" is necessary, as all links are inside the shared folder):\n\n    unix extensions = no\n    log level = 3\n\nAlso add the following to the end of the same file (`/etc/samba/smb.conf`):\n\n    [FitFiles]\n            comment=FIT files downloaded from devices\n            valid users = pi\n            read only = yes\n            browseable = yes\n            follow symlinks = yes\n            wide links = yes\n            path=/home/pi/FitSync\n\n    [PiDropbox]\n            comment=Dropbox for the pi user\n            valid users = pi\n            read only = no\n            browseable = yes\n            path=/home/pi/Dropbox\n\n### Install PiFitSync\n\n#### Install other prerequisites\n\nPackages `libudev`, `git`, `python3` and `rsync`, `libusb` and `jmtpfs` will\nneed to be installed first:\n  \n    sudo apt-get install libudev-dev git rsync libusb-1.0-0-dev jmtpfs\n\n#### Build and install FitSync\n\nClone this repository on the Raspberry PI and run the following commands:\n\n    cd src\n    make\n    sudo make install\n\n#### Setup other directories\n\nThe `Makefile` sets things up to mount garmin device file systems in the\n`/media/` folder and will arrange for the sync programs to download data from\nthose folders into `~/FitSync`.  It is sometimes convenient to have access to\nthose folders directly.\n\nCreate symlinks so we can access device locations them from the PI home\ndirectory:\n\n    ln -s /media/garmin/GARMIN/ACTIVITY ~/fr920-activities\n    ln -s /media/garmin/GARMIN/NEWFILES ~/fr920-newfiles\n\nCreate a symlink of the device name to the devices activities, so we can\nbrowse directly to \"X:\\0-ByName\\fr920\" and won't have to remember the device\nID:\n\n    mkdir ~/FitSync/0-ByName\n    ### REPLACE with the real device serial number:\n    ln -s ~/FitSync/3916163708/Activities ~/FitSync/0-ByName/fr920\n\n### Monitoring and Diagnosing faults\n\nThe application will log its messages at `/var/log/syslog`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falex-hhh%2Fpifitsync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falex-hhh%2Fpifitsync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falex-hhh%2Fpifitsync/lists"}