Code Monkey home page Code Monkey logo

ant-plus-heart-rate-ws's Introduction

ANT+ Heart Rate Monitor to WebSocket ❤️

This application listens to ANT+ heart rate devices like Garmin smartwatches and sends the heart rate data via WebSockets. It can be used to monitor your heart rate on your PC or for other applications, such as syncing your heart rate with your avatar in VRChat using OSC.

This project is based on the incyclist/ant-plus repository.

Skip to Step 9 if you only care about running it.

Features 🌟

  • Listen to ANT+ heart rate devices
  • Send heart rate data via WebSockets
  • Monitor heart rate on your PC or in other applications

Prerequisites 📋

  • Node.js 18.16.0 or higher
  • ANT+ Stick (I'm using the official Garmin stick)
  • Docker (optional, for containerized deployment)

Installation 💻

  1. Clone the repository:
git clone https://github.com/yourusername/ant-plus-heart-rate-ws.git
cd ant-plus-heart-rate-ws
  1. Install the dependencies:
npm install

Running the application 🏃

  1. Start the application:
node heart-rate.js

# if that doesn't work try running with sudo or as root
sudo node heart-rate.js
  1. Connect your ANT+ heart rate device (e.g., Garmin smartwatch) and ensure it's within range. (On Garmin devices select HF send in the HF display)

  2. The application will listen for heart rate data and send it via WebSockets on port 8080.

Official Docker Image 🐳

An official Docker image is available at unrea1/ant-plus-heart-rate-ws. You can pull the image using the following command:

docker pull unrea1/ant-plus-heart-rate-ws:1

Building the Docker container 🛠️

  1. Build the Docker image:
docker build -t ant-plus-heart-rate-ws:1 .

Running the Docker container 🚀

  1. Run the Docker container, passing through the Garmin USB device and mapping the WebSocket port:
docker run -p 8080:8080 --name ant-plus-heart-rate-ws --device /dev/bus/usb/001/002 unrea1/ant-plus-heart-rate-ws:1

Replace /dev/bus/usb/001/002 with the path to your Garmin USB device. This can be found out with lsusb.

  1. The container will start, and the application will listen for heart rate data and send it via WebSockets on port 8080.

Configuration 🔧

The WebSocket server listens on port 8080 by default. You can change this by updating the port value in the WebSocket.Server configuration within the heart-rate.js script.

Alternative (Docker-Compose)

The repository features a docker-compose.yml for an easier deployment.

  1. To start the container this way, run the following command:
docker-compose up

# if that doesn't work try running with sudo or as root
sudo docker-compose up

ant-plus-heart-rate-ws's People

Contributors

ghostjumper avatar dependabot[bot] avatar

Stargazers

Bernard Toplak avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.