{"id":51309917,"url":"https://github.com/cluffa/garmin-ftms-sync-esp32","last_synced_at":"2026-07-01T03:00:34.748Z","repository":{"id":368256601,"uuid":"1284255284","full_name":"cluffa/garmin-ftms-sync-esp32","owner":"cluffa","description":"bridges a Bluetooth treadmill to a Garmin watch using an ESP32 microcontroller.","archived":false,"fork":false,"pushed_at":"2026-06-29T19:23:48.000Z","size":53,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-29T19:27:26.260Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cluffa.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,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-29T17:16:31.000Z","updated_at":"2026-06-29T19:23:52.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/cluffa/garmin-ftms-sync-esp32","commit_stats":null,"previous_names":["cluffa/garmin-ftms-sync-esp32"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/cluffa/garmin-ftms-sync-esp32","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cluffa%2Fgarmin-ftms-sync-esp32","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cluffa%2Fgarmin-ftms-sync-esp32/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cluffa%2Fgarmin-ftms-sync-esp32/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cluffa%2Fgarmin-ftms-sync-esp32/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cluffa","download_url":"https://codeload.github.com/cluffa/garmin-ftms-sync-esp32/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cluffa%2Fgarmin-ftms-sync-esp32/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34990845,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-01T02:00:05.325Z","response_time":130,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2026-07-01T03:00:20.729Z","updated_at":"2026-07-01T03:00:34.743Z","avatar_url":"https://github.com/cluffa.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# garmin-ftms-sync-esp32\n\n[![CI](https://github.com/cluffa/garmin-ftms-sync-esp32/actions/workflows/ci.yml/badge.svg)](https://github.com/cluffa/garmin-ftms-sync-esp32/actions/workflows/ci.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n\nFirmware that bridges a Bluetooth treadmill to a Garmin watch and an Android phone. The device connects to a treadmill as a BLE central (FTMS or iFit), re-broadcasts live speed and distance to a Garmin watch as a native BLE RSC sensor, and exposes a USB serial interface so an Android phone can select the treadmill, monitor workout data, and send speed/incline control commands.\n\n## Hardware\n\n| Board | Target | Notes |\n|-------|--------|-------|\n| Seeed XIAO ESP32-C6 | `esp32c6` | Primary — USB-C, compact |\n| Heltec WiFi LoRa 32 v3 | `esp32s3` | Has OLED display and battery management |\n\n## Data Streams \u0026 Architecture\n\nThe system coordinates two independent data streams:\n\n1. **Treadmill to Garmin (Implemented)**\n   * `Treadmill (FTMS/iFit)` -\u003e `ESP32 (BLE Central)` -\u003e `Garmin Watch (BLE RSC Peripheral)`\n   * Re-broadcasts live speed and distance to the watch.\n\n2. **Garmin to Treadmill (Implemented)**\n   * `Garmin Watch (ConnectIQ DataField)` -\u003e `Phone App (BLE)` -\u003e `ESP32 (BLE NUS)` -\u003e `Treadmill (FTMS/iFit Control)`\n   * Sends the current Garmin workout target pace to automatically control the treadmill's speed.\n   * **Watch -\u003e Phone**: ConnectIQ DataField reads `Activity.Info.currentWorkoutStep` for target pace; falls back to `currentSpeed`. Sends `workoutStatus` with `targetPace`, `targetPaceLow`, `targetPaceHigh` every 5s.\n   * **Phone -\u003e ESP32**: Phone app receives `workoutStatus` via BLE NUS, converts target pace (m/s → km/h), and sends a `speed` command to the ESP32.\n   * **ESP32 -\u003e Treadmill**: The ESP32 parses incoming `speed \u003cx\u003e` commands and writes the correct control characteristics to the treadmill.\n\n## Repo layout\n\n```\ncomponents/bridge_core/   — shared IDF component (parsers, BLE, serial ctrl)\nboards/heltec-v3/         — Heltec board firmware (display, battery, buttons)\nboards/xiao-c6/           — XIAO C6 board firmware (lean, USB serial only)\ntest/host/                — pure-C host tests (no hardware needed)\ntest/mock/                — Python mock treadmill and watch (macOS/Linux)\ntools/serial_cli.py       — interactive USB serial CLI for the device\n```\n\n## Build\n\nRequires [ESP-IDF v5.4+](https://docs.espressif.com/projects/esp-idf/en/stable/esp32/get-started/).\n\n```sh\n# Build and flash XIAO C6\ncd boards/xiao-c6\nidf.py build flash monitor\n\n# Build and flash Heltec v3\ncd boards/heltec-v3\nidf.py build flash monitor\n```\n\n## Host tests\n\n```sh\ncd test/host \u0026\u0026 make\n```\n\n## Serial CLI\n\n```sh\nuv run tools/serial_cli.py\n```\n\nCommands: `scan`, `list`, `connect \u003cn\u003e`, `speed \u003ckmh\u003e`, `incline \u003cpct\u003e`, `stop`, `status`\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcluffa%2Fgarmin-ftms-sync-esp32","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcluffa%2Fgarmin-ftms-sync-esp32","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcluffa%2Fgarmin-ftms-sync-esp32/lists"}