This directory contains scripts to log the Ant-Plus sensors and send the data over MQTT
ant_plus_logger.js
is the only way we can communicate to ant+ devices. It serves as the middle-man between the ANT+ sensors and the DAS MQTT broker. It allows the sensors to show up as a virtual wireless sensor module.
Raspberry Pis: install sudo apt install libudev-dev
To install the necessary libraries for node.js you may need to manually install them instead of running npm install
.
Run the script with node ant_plus_logger.js
.
Sometimes, root permissions are required to connect to the USB dongle, so sudo
may be required.
To start this script automatically, follow the instructions in the services README.md.
You will also need to ensure the default pi
user has permissions to access the ANT+ dongle without sudo
. Create the following file in /etc/udev/rules.d/50-antplus.rules
and reboot:
# Allow access to ANT+ USB without sudo
# https://www.xmodulo.com/change-usb-device-permission-linux.html
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0fcf", ATTRS{idProduct}=="1008", GROUP="users", MODE="0666"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0fcf", ATTRS{idProduct}=="1009", GROUP="users", MODE="0666"