Skip to content

Mwea/walkingpad-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

WalkingPad JS Logo

WalkingPad JS πŸƒβ€β™‚οΈ

npm version License: CC BY-NC-SA 4.0 TypeScript Demo

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.


✨ Features

  • πŸ”„ 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

πŸ“± Supported Devices

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 Setup

Browser Compatibility

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 ⚠️ Flag Experimental flag required

Platform-Specific Setup

🐧 Linux

Enable the experimental flag in Chrome:

  1. Open chrome://flags
  2. Search for "Experimental Web Platform features"
  3. 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 in

🍎 macOS

Grant Chrome Bluetooth access:

  1. System Preferences β†’ Security & Privacy β†’ Privacy
  2. Select Bluetooth and check Google Chrome

πŸͺŸ Windows

Usually works out of the box. If issues occur:

  1. Ensure Bluetooth is enabled in Settings
  2. Try chrome://flags β†’ Enable "Experimental Web Platform features"

πŸ€– Android

  1. Enable Bluetooth and Location services
  2. Grant location permission to Chrome when prompted

πŸš€ Quick Start

Installation

npm install walkingpad-js

Basic Usage

import { 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();

πŸ“š Documentation

For detailed API reference, advanced configuration options, and more examples, see the Technical Documentation.


πŸ› οΈ Development

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

πŸ“„ License

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

πŸ™ Acknowledgments


Made with ❀️ by Mwea & Claude

About

A TypeScript library to control WalkingPad treadmills via Web Bluetooth API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors