A TypeScript library to control WalkingPad treadmills via Web Bluetooth API | Try the Demo
Control your WalkingPad treadmill directly from your browser! This library provides a clean, type-safe API to connect, monitor, and control WalkingPad devices using the Web Bluetooth standard.
- π Dual Protocol Support β Works with both legacy (A1/R1/P1) and modern (Z1/R2/C2) WalkingPad models
- π Auto-Detection β Automatically detects the correct protocol for your device
- πΎ Device Memory β Remembers your device for seamless reconnection
- π Real-time Stats β Live speed, distance, time, and step tracking
- π‘οΈ Type-Safe β Full TypeScript support with strict type checking
- π Browser Native β Uses standard Web Bluetooth API, no native dependencies
| Model | Protocol | Status |
|---|---|---|
| WalkingPad A1 | Standard | β Supported |
| WalkingPad R1 | Standard | β Supported |
| WalkingPad P1 | Standard | β Supported |
| WalkingPad Z1 | FTMS | β Supported |
| WalkingPad R2 | FTMS | β Supported |
| WalkingPad C2 | FTMS | β Supported |
| KingSmith models | Both | β Supported |
| Browser | Support | Notes |
|---|---|---|
| Chrome 56+ | β Full | Desktop & Android |
| Edge 79+ | β Full | Chromium-based |
| Opera 43+ | β Full | Desktop |
| Chrome Android | β Full | Requires Android 6+ |
| Samsung Internet | β Full | Android |
| Safari | β None | No Web Bluetooth support |
| Firefox | Experimental flag required |
Enable the experimental flag in Chrome:
- Open
chrome://flags - Search for "Experimental Web Platform features"
- Set to Enabled and relaunch
You may also need Bluetooth permissions:
sudo usermod -a -G bluetooth $USER
sudo systemctl restart bluetooth
# Log out and back inGrant Chrome Bluetooth access:
- System Preferences β Security & Privacy β Privacy
- Select Bluetooth and check Google Chrome
Usually works out of the box. If issues occur:
- Ensure Bluetooth is enabled in Settings
- Try
chrome://flagsβ Enable "Experimental Web Platform features"
- Enable Bluetooth and Location services
- Grant location permission to Chrome when prompted
npm install walkingpad-jsimport { getWalkingPadBLE } from 'walkingpad-js';
const pad = getWalkingPadBLE();
// Listen for state updates
pad.events.on('state', (state) => {
console.log(`Speed: ${state.speed} km/h`);
console.log(`Distance: ${state.distance} km`);
console.log(`Time: ${state.time} seconds`);
console.log(`Steps: ${state.steps}`);
});
// Handle errors
pad.events.on('error', (error) => {
console.error('Error:', error.message);
});
// Connect to device (opens browser device picker)
await pad.connect({ rememberDevice: true });
// Control the treadmill
await pad.start();
await pad.setSpeed(3.5); // km/h
await pad.stop();
// Disconnect when done
await pad.disconnect();For detailed API reference, advanced configuration options, and more examples, see the Technical Documentation.
git clone https://github.com/Mwea/walkingpad-js.git
cd walkingpad-js
npm install
npm test| Script | Description |
|---|---|
npm test |
Run test suite |
npm run typecheck |
TypeScript type checking |
npm run build |
Build all outputs |
This project is licensed under CC BY-NC-SA 4.0.
- Attribution β Give appropriate credit
- NonCommercial β Not for commercial purposes
- ShareAlike β Same license for derivatives
- WalkingPad for making great treadmills