Skip to content

olympum/ant-cycling-power

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ANT+ Bicycle Power Profile

This is a simple implementation of an ANT+ profile for a virtual power meter. It only broadcasts instant power and cadence, with no torque or pedal measurements.

Install

You will need libudev installed. In Debian:

$ sudo apt install libudev-dev

You'll need to have typings and tsc installed:

$ npm install -g typings
$ npm install -g typescript
$ cd ant-cycling-power
$ typings install
$ npm install

When you plug in a USB-m ANT+ stick, the default permissions are for only root to get access to it:

$ node test.js
/home/pi/ant-plus/node_modules/usb/usb.js:33
	this.__open()
	     ^

Error: LIBUSB_ERROR_ACCESS
    at Error (native)
    at Device.usb.Device.open (/home/pi/ant-plus/node_modules/usb/usb.js:33:7)

We can fix this by changing udev settings, for Garmin v1 and v2 sticks:

$ cat /etc/udev/rules.d/51-garmin-usb.rules
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fcf", ATTRS{idProduct}=="1009", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fcf", ATTRS{idProduct}=="1008", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1"

And reload udev rules:

$ sudo udevadm control --reload-rules

Usage

var power_meter = require('./power-meter');
var pm = new power_meter.PowerMeter();
pm.broadcast(320, 95); // 320 watts and 95 rpm

About

ANT+ Bicycle Power Profile

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published