Skip to content

Latest commit

 

History

History
302 lines (226 loc) · 9.06 KB

File metadata and controls

302 lines (226 loc) · 9.06 KB

Elliptical Server - Kettler Elliptical Bike Control Server

HTTP server in Rust to control a Kettler elliptical bike via Bluetooth with a modern web interface.

📋 Table of Contents

✨ Features

Backend

  • 🦀 Rust server with Actix-web
  • 🔵 Bluetooth communication with Kettler elliptical bikes (RFCOMM)
  • 📡 REST API for remote control
  • ⚡ Real-time data updates

Web Interface

  • 🎨 Modern dark glassmorphism design with 3-column layout
  • 📱 Optimized for 11" tablet in landscape mode (99vh container)
  • ⏱ Timer with auto-start/pause based on RPM
  • 📊 Visual progress histogram with real-time tracking
  • 🎯 10 modes: Flat (manual), 8 training programs + Game mode
  • 🎮 Space Runner game - RPM-controlled with obstacles and collectibles
  • 🎲 Custom program editor with random generator
  • 🔧 Difficulty control in 5W increments
  • 🖥 Fullscreen mode
  • 📈 Real-time display: RPM, Power, Connection Status
  • 🎯 Enlarged playback controls for better touch interaction

🚀 Installation

Prerequisites

# Rust (latest stable version)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Bluetooth
sudo apt-get install bluez libbluetooth-dev

Compilation

For Production (Raspberry Pi with Bluetooth)

# Clone the project
git clone https://github.com/blackxt600/SkylonRemoteApp.git
cd SkylonRemoteApp

# Build
cargo build --release

# Run
cargo run --release

For Development (macOS/Linux without Bluetooth)

# Build in mock mode (simulates bike data)
cargo build --release --no-default-features --features mock

# Run in mock mode
cargo run --release --no-default-features --features mock

The mock mode simulates realistic bike data (RPM, speed, power) without requiring Bluetooth hardware. Perfect for frontend development! See MOCK_MODE.md for details.

The server will be accessible at http://0.0.0.0:8080

📱 Usage

  1. Bluetooth Connection: Pair your Kettler bike to /dev/rfcomm0
  2. Start the server: cargo run
  3. Open the interface: Navigate to http://localhost:8080
  4. Fullscreen mode: Click the ⛶ button in the top right

Control Modes

Flat Mode (Manual)

  • Direct power control with +/- buttons in center panel
  • Visual histogram with uniform bar heights
  • All bars update simultaneously when power changes
  • Range: 25-400W

Program Mode

  • Select one of the 8 training programs
  • Adjust difficulty: -100W to +100W in 5W increments
  • Timer automatically starts/pauses based on your activity (RPM)
  • Visual histogram shows program progression

Custom Mode

  • Create personalized 30-minute programs
  • Edit individual interval power (25-400W)
  • Random generator with warm-up sequence (25-30-35W)
  • Persistent storage in browser

Game Mode

  • Space Runner: RPM-controlled arcade game
  • Avoid asteroids, collect stars
  • Progressive difficulty
  • Real-time score and distance tracking

🏋️ Training Programs

Each program lasts 30 minutes with power adjustment per minute:

Program Description Intensity
Plat Manual mode with flat histogram
Escalier Stepped power progression ⚡⚡
Vallée Gentle variations ⚡⚡⚡
Collines Two distinct hills ⚡⚡⚡⚡
Montagne Two peaks ⚡⚡⚡⚡
Col Alpin Progressive climb ⚡⚡⚡⚡⚡
Intervalle Intense intervals ⚡⚡⚡⚡⚡
Pyramide Symmetrical climb and descent ⚡⚡⚡⚡
Sur mesure Customizable program with editor Custom
Jeu Space Runner game mode Fun! 🎮

🔌 API

GET /status

Get the current bike status

Response:

{
  "connected": true,
  "rpm": 65,
  "power": 120,
  "speed": 0.0
}

POST /power/{level}

Set the target power (25-400W)

Example:

curl -X POST http://localhost:8080/power/120

🛠 Development

Project Structure

SkylonRemoteApp/
├── src/
│   ├── main.rs              # HTTP server
│   ├── bike_controller.rs   # Bluetooth controller
│   ├── training_program.rs  # Training program structures
│   └── main-example.rs      # CLI example
├── static/
│   ├── index.html           # Web interface
│   └── programs.html        # Program manager
├── autostart/               # Systemd autostart config
├── Cargo.toml               # Rust dependencies
├── CHANGELOG.md             # Version history
└── VERSION                  # Current version

Main Dependencies

  • actix-web - Web framework
  • tokio - Async runtime
  • kdri - Kettler Bluetooth library
  • serde - JSON serialization
  • anyhow - Error handling

📦 Versioning

This project uses Semantic Versioning (MAJOR.MINOR.PATCH).

How to Version

1. Update the version

# Modify the VERSION file
echo "1.1.0" > VERSION

2. Update CHANGELOG.md

## [1.1.0] - 2025-01-27

### Added
- New feature X

### Changed
- Improvement to Y

### Fixed
- Bug Z

3. Commit and tag

# Commit changes
git add -A
git commit -m "Release v1.1.0 - Description of changes"

# Create tag
git tag -a v1.1.0 -m "Version 1.1.0"

# Push (if remote repository)
git push origin main --tags

Versioning Convention

  • MAJOR (1.x.x): Incompatible API changes
  • MINOR (x.1.x): New backward-compatible features
  • PATCH (x.x.1): Backward-compatible bug fixes

Examples

# Bug fix
1.0.0 → 1.0.1

# New feature
1.0.1 → 1.1.0

# Breaking change
1.1.0 → 2.0.0

View History

# List versions
git tag -l

# Version details
git show v1.0.0

# Log with tags
git log --oneline --decorate

# Differences between versions
git diff v1.0.0 v1.1.0

🙏 Credits

This project would not have been possible without the incredible work shared in the kdri repository by @kaegi. The kdri library (Kettler Device Rust Interface) provides the essential Bluetooth communication protocol implementation for Kettler fitness devices.

Thank you for making this library open source! 🎉

📄 License

This project is licensed under the MIT License.

🤝 Contribution & Open Source Philosophy

This repository is shared "as-is" for the community to take, improve, and make their own!

This project was built to solve a specific need and is now released to the world. The original author will not provide bug fixes or ongoing maintenance. Instead, this code is offered as a foundation for you to build upon, learn from, and adapt to your needs.

Open source is about empowerment—taking something that works and making it better, fixing what's broken, and sharing improvements with others who face similar challenges. This project exists because of the incredible work shared by others (like the kdri library), and now it's your turn to carry the torch forward.

This Is YOUR Project Now

  • 🔧 Fix bugs: Found an issue? Fix it and share your solution with others
  • 🚀 Add features: Need something new? Build it and submit a pull request
  • 📚 Improve docs: Make the documentation better, clearer, more complete
  • 🌍 Port to new devices: Make it work with other Kettler models or fitness equipment
  • 🎨 Redesign the UI: Create a better interface that fits your needs
  • 🔬 Experiment freely: Try new approaches, test wild ideas, break things and learn

How to Take Ownership

  • Fork this repository - Make it yours, customize it, improve it
  • Share your improvements - Open pull requests so others can benefit
  • Create your own version - Build something completely different based on this code
  • Help each other - Answer questions, review PRs, collaborate with other contributors
  • Become a maintainer - If you're passionate about this project, consider maintaining your own fork

No Promises, Just Possibilities

⚠️ Important: There is no guarantee of support, bug fixes, or updates from the original author. This is community-driven from now on. If you need something fixed or improved, you have the power to make it happen.

This isn't just an invitation to contribute—it's a transfer of ownership to the community.

The code is here. The tools are available. The possibilities are endless. What will YOU build with it? 🚀

📞 Support

For questions or issues, see:


Current Version: 2.0.0 Date: 2025-11-23