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.
- Listen to ANT+ heart rate devices
- Send heart rate data via WebSockets
- Monitor heart rate on your PC or in other applications
- Node.js 18.16.0 or higher
- ANT+ Stick (I'm using the official Garmin stick)
- Docker (optional, for containerized deployment)
- Clone the repository:
git clone https://github.com/yourusername/ant-plus-heart-rate-ws.git
cd ant-plus-heart-rate-ws
- Install the dependencies:
npm install
- Start the application:
node heart-rate.js
# if that doesn't work try running with sudo or as root
sudo node heart-rate.js
-
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) -
The application will listen for heart rate data and send it via WebSockets on port 8080.
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
- Build the Docker image:
docker build -t ant-plus-heart-rate-ws: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
.
- The container will start, and the application will listen for heart rate data and send it via WebSockets on port 8080.
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.
The repository features a docker-compose.yml
for an easier deployment.
- 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