{"id":20064660,"url":"https://github.com/paixaop/zwack","last_synced_at":"2025-06-25T07:05:06.566Z","repository":{"id":32904658,"uuid":"145655914","full_name":"paixaop/zwack","owner":"paixaop","description":"BLE (Bluetooth Low Energy) Sensor to simulate an indoor bike trainer or runner","archived":false,"fork":false,"pushed_at":"2023-03-04T02:48:08.000Z","size":121,"stargazers_count":118,"open_issues_count":19,"forks_count":39,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-06-02T17:38:04.100Z","etag":null,"topics":["bicycle-computer","bike","bluetooth","bluetooth-low-energy","indoor-trainer","simulation","virtual"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/paixaop.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}},"created_at":"2018-08-22T04:26:12.000Z","updated_at":"2025-05-25T22:05:39.000Z","dependencies_parsed_at":"2023-09-24T06:31:59.757Z","dependency_job_id":null,"html_url":"https://github.com/paixaop/zwack","commit_stats":{"total_commits":47,"total_committers":3,"mean_commits":"15.666666666666666","dds":"0.34042553191489366","last_synced_commit":"0abecc5f049770d3ac37d4a3212abaf50794b994"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/paixaop/zwack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paixaop%2Fzwack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paixaop%2Fzwack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paixaop%2Fzwack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paixaop%2Fzwack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paixaop","download_url":"https://codeload.github.com/paixaop/zwack/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paixaop%2Fzwack/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261823736,"owners_count":23215141,"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":["bicycle-computer","bike","bluetooth","bluetooth-low-energy","indoor-trainer","simulation","virtual"],"created_at":"2024-11-13T13:47:18.910Z","updated_at":"2025-06-25T07:05:06.518Z","avatar_url":"https://github.com/paixaop.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zwack BLE\n\nSimulate/Implement a Bluetooth Low Energy sensor that can send:\n\n  * Cycling Power and Cadence (CSP Bluetooth profile)\n  * Running Speed and Cadence (RSC Bluetooth profile)\n  * Cycling Power and Cadence (FTMS Bluetooth profile - partial support)\n\nZwack has many possible uses, here are some examples:\n\n  * Simulate an indoor bike trainer (turbo) generating cyclist power,cadence \u0026 speed data to test bike computers fitness, or virtual indoor bike apps. \n  * Simulate a runner's speed and pace test bike computers fitness, or virtual indoor bike apps. \n  * Integrate a common treadmill with Zwift, sending data from the treadmill to the Zwift game via bluetooth\n  * Simulate an indoor bike trainer (turbo) that is able to receive SetTarget (wattage) commands from test bike fitness apps (eg: BreakAway: Indoor Training) for testing. (This method is currently using the Cycling Power Profile with the addition of Wahoo's extension)\n  \n# Supports\n\nAt this time Zwack runs succesfuly on Mac OSX (Please check Requirements below) and Raspberry PI. Should run on Windows but it hasn't been tested. If it works let me know.\n\n# Installation\n\nInstall from npm\n\n    npm i zwack\n\nor clone this repo and run \n\n    npm install\n\nYou may need to install Xcode on Mac to compile the `bleno` Bluetooth module. \n\n# Debug Flags\n\nYou can see a lot of debug information if you run the simulator or your app with the DEBUG environment variable set to \n\n  * csp  - Cycling Power and Cadence messages\n  * rsc  - Running Speed and Cadence messages\n  * ftms - Fitness Machine Messages\n  * ble  - Bluetooth low energy messages\n\nExample:\n\n    DEBUG=rsc npm run simulator\n    DEBUG=* npm run simulator\n\nYou'll see something similar to this\n\n```\nrsc [Zwack notifyRSC] {\"speed\":4.4703888888888885,\"cadence\":180} +0ms\nrsc Running Speed: 4.4703888888888885 +2ms\nrsc Running Cadence: 180 +0ms\nrsc [Zwack notifyRSC] {\"speed\":4.4703888888888885,\"cadence\":180} +1s\nrsc Running Speed: 4.4703888888888885 +0ms\n```\n\n# Using the simulator\n\nStart the simulator by executing:\n\n    npm run simulator -- --variable=ftms --variable=rsc --variable=csp --variable=power --variable=cadence --variable=speed\n\nOn a different machine start your fitness app, bike computer or indoor virtual bike simulation software, like Zwift, and pair up the Zwack BLE sensor. The sensor name should be `Zwack`, it may have some numbers added to the name or you may see the host name of the computer running zwack. It all depends on the operating system you're uing to run Zwack.\n\nIf your indoor biking software does not detect the BLE sensor, disable, then enable, the Bluetooth on the machine where Zwack is running and retry to discover and connect to the sensor again.\n\nThe ZwackBLE sensor may show up as `Zwack` or has the host name of the machine running Zwack. This is normal.\n\nUpdating simulation parameters\n\n    List of Available Keys\n      c/C - Decrease/Increase cadence\n      p/P - Decrease/Increase power\n      s/S - Decrease/Increase running/cycling speed\n      d/D - Decrease/Increase running cadence  \n\n      r/R - Decrease/Increase parameter variability\n      i/I - Decrease/Increase parameter increment\n      x/q - Exit\n\nPressing `c` on your keyboard will decrease the cadence, conversly pressing `C` (upper case) will increase simulated cadence. Same thing for power by pressing `p` or `P`.\n \nThe variability parameter will introduce some random variability to the cadence and power values, so they don't remain constant all the time. If you lower the variability to `0` the cadence and power values will remain constant.\n\nPress `x` or `q` to exit Zwack.\n\n# Command Line Arguments\n\n    npm run simulator -- --variable=ftms --variable=rsc --variable=csp --variable=power --variable=cadence --variable=speed\n\n  * ftms - enable broadcasting as FTMS service\n  * rsc  - enable broadcasting as RSC service\n  * csp  - enable broadcasting as CSP service\n  * power - enable broadcasting CSP with Power only data\n  * cadence - enable broadcasting CSP with Cadence data (to be combined with `power`)\n  * speed - enable broadcasting CSP with Speed data (to be combined with `power` and `cadence`)\n    \n# Requirements\n\nRequires NodeJS, and should run in all Bleno (the base BLE module) supported platforms, which are Mac, Windows or Raspberry Pi. \n\nZwack cannot run on the same computer as the fitness or virtual indoor bike app, you'll need to run them on different systems.\n\nIf you have trouble getting BLE to work on MacOS, you can try to install bleno from [abandonware](https://github.com/abandonware/bleno) using the command\n\n\tnpm install bleno@npm:@abandonware/bleno\n\n## Help Needed\n\nCurrently this version of zwack is able to broadcast and simulate a FTMS (indoor bike specifically) profile as well as Cycling Power (which also broadcasts Speed). \nThe current implementation of Cycling Power (with Speed \u0026 Cadence) is NOT ideal. Cadence and Speed changes will be erratic \n  * takes ~2 sec to stabilize and be reflected in output\n  * will be unable to inject randomness into the output\n  * will need help on how to improve it\n\n## Bugs / Feature Enhancement needed\n\nI'm sure there are many bugs but as of now, it works and suits the purpose which is for testing as there are no simulators available for bluetooth (similar in form to simulANT). \n\n\n## Credits\n\nInitial prototype based on [ble-cycling-power](https://github.com/olympum/ble-cycling-power) code from olympum.\n\nCodes for FTMS support is taken from the [FortuisANT project ](https://github.com/WouterJD/FortiusANT) and edited to fit usage as a simulator\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaixaop%2Fzwack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaixaop%2Fzwack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaixaop%2Fzwack/lists"}