Skip to content

bruhdev1290/sportsomatic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

19 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Sportsomatic

A comprehensive fitness tracking app for Pebble smartwatches that supports both running and swimming activities with GPS tracking and real-time statistics.

Open in GitHub Codespaces

Sportsomatic Logo

Features

πŸƒ Running Mode

  • GPS Tracking: Real-time location tracking with high accuracy
  • Live Statistics:
    • Elapsed time
    • Distance (km/miles)
    • Current pace
    • Lap times and splits
  • Auto Features:
    • Auto-start when movement detected
    • Auto-stop after 15 seconds of inactivity
    • Auto-lap at configurable distances
  • Distance Alerts: Vibration notifications at every kilometer/mile
  • Heart Rate Monitoring: Display current heart rate (on compatible devices)

🏊 Swimming Mode

  • Pool Swimming: Optimized for pool-based swimming
  • Lap Tracking: Manual lap button or automatic lap counting
  • Configurable Pool Length: Support for 25m, 50m, 25yd pools
  • Statistics:
    • Total time
    • Distance (meters/yards)
    • Lap count
    • Pace per 100m/100yd

πŸ“Š Multiple Views

Navigate through different data screens during your workout:

  • Main View: Time, distance, and pace
  • Lap View: Current lap statistics
  • Heart Rate View: Real-time heart rate data
  • Splits View: Historical lap information

βš™οΈ Customizable Settings

  • Units: Switch between metric (km) and imperial (miles)
  • Auto-lap: Enable/disable and configure distance
  • Distance Alerts: Toggle vibration alerts
  • Sport Mode: Easy switching between Run and Swim modes
  • Pool Length: Customize pool length for swimming

Screenshots

Ready Screen Running Sport Selection
Ready Screen Running Mode Sport Selection

Feature Overview

Features

Architecture

Architecture

The app uses a two-part architecture:

  • Watch-side (C): Handles UI, state management, distance calculations, and lap tracking
  • Phone-side (JavaScript): Manages GPS tracking and forwards location data to the watch via Bluetooth

Installation

Quick Start with GitHub Codespaces (Recommended) πŸš€

The fastest way to get started is using GitHub Codespaces with our pre-configured development environment:

  1. Click the "Open in GitHub Codespaces" badge at the top of this README
  2. Wait for the container to build (2-3 minutes on first launch)
  3. The Pebble SDK, emulator, and all dependencies will be automatically installed
  4. Start building: pebble build
  5. Test on emulator: pebble install --emulator basalt

The devcontainer includes:

  • βœ… Pebble SDK (latest version)
  • βœ… Pebble emulator with SDL support
  • βœ… Python and Node.js
  • βœ… VS Code extensions for Pebble development
  • βœ… All required build tools

Prerequisites

  • Pebble SDK 3.0+
  • Python 2.7 (for Pebble SDK)
  • Node.js (for JavaScript components)

Building from Source

  1. Clone the repository

    git clone https://github.com/bruhdev1290/sportsomatic.git
    cd sportsomatic/sportsomatic
  2. Install dependencies

    pebble build
  3. Install to your watch

    pebble install --phone <PHONE_IP>

    Or use CloudPebble to build and install.

Installing Pre-built Package

Download the latest .pbw file from the Releases page and install it using the Pebble mobile app.

Usage

Getting Started

  1. Launch the app on your Pebble watch
  2. Select your sport (Run or Swim) using the menu
  3. Press SELECT to start tracking
  4. During workout:
    • Press UP to manually mark a lap (running mode)
    • Press DOWN to cycle through data views
    • Press SELECT to pause/resume
    • Hold BACK to end the workout

Controls

Button Controls

Button Action Long Press
SELECT Start/Pause/Resume Change sport mode
UP Mark lap (Run mode) -
DOWN Switch view -
BACK Show tip End workout

Running Mode

The app automatically starts tracking when it detects movement (configurable). GPS data is continuously sent to the watch, tracking:

  • Distance traveled using Haversine formula
  • Current speed and pace
  • Automatic lap marking at each km/mile

Swimming Mode

Optimized for pool swimming where GPS is not reliable:

  • Each lap button press increments distance by pool length
  • Automatic lap tracking based on configured pool length
  • Shows total laps, distance, and pace per 100m/yd

Technical Details

Architecture

sportsomatic/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ c/
β”‚   β”‚   └── myfirstproject.c    # Watch-side C code
β”‚   └── pkjs/
β”‚       └── index.js             # Phone-side JavaScript
β”œβ”€β”€ package.json                 # App metadata
└── wscript                      # Build configuration

Platform Support

  • Pebble Aplite (black & white)
  • Pebble Basalt (color)
  • Pebble Chalk (round, color)
  • Pebble Diorite (black & white)
  • Pebble Emery (larger, color)

Communication Protocol

The app uses Pebble's AppMessage API to communicate between the watch and phone:

  • Watch β†’ Phone: Commands (START, PAUSE, RESUME, STOP), settings
  • Phone β†’ Watch: GPS coordinates, speed, accuracy, status messages

GPS Accuracy

  • High accuracy mode enabled
  • Position updates throttled to 1 second intervals
  • Filters positions with accuracy > 50m
  • Uses Haversine formula for distance calculation

Development

Project Structure

  • C Code (src/c/): Watch-side application logic, UI rendering, and state management
  • JavaScript (src/pkjs/): Phone-side GPS tracking and message routing
  • Build System: WAF-based build system via wscript

Key Features Implementation

  • GPS Tracking: Haversine distance calculation between coordinate pairs
  • Auto-start/stop: Movement detection based on speed and position delta
  • Multi-page UI: State machine for different data views
  • Sport Modes: Configurable behavior for running vs swimming
  • Heart Rate: Integration with Pebble Health API (on compatible devices)

Building

pebble build

Testing

Test on emulator:

pebble install --emulator <platform>

Platforms: aplite, basalt, chalk, diorite, emery

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is open source. Please check the repository for license information.

Credits

Author: MakeAwesomeHappen (bruhdev1290)

Support

For issues, questions, or suggestions, please open an issue on the GitHub repository.


Note: This app requires the Pebble mobile app and a compatible Pebble smartwatch. Since Pebble's official services were discontinued, you'll need to use Rebble services to use the app.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors