Giter Site home page Giter Site logo

j-antplus's Introduction

j-antplus

Java Library for speaking with ANT / ANT+ devices through a USB dongle.

I set up this project trying to talk to my personal ANT+ devices. Goal is to implement needed ant messages and ANT+ datapages in order to talk to following set of devices:

  • Heart rate monitor:
    • Basic support. Tested with Garmin HRM3SS. Check out HrmTest_Main under src/test
    • No support for legacy format (yet, because I don't own a legacy device). If you need it, check out HrmChannel to sniff the datapage 1st bit alternating every 4 packages.
  • Speed sensor
    • Basic support. Tested with Garmin Speed Sensor.
    • The sensor only measures the number of wheel revolutions, the actual speed has to be calculated by a consumer of this library in conjunction with the wheel's diameter. Check out SpeedTest_Main under src/test
  • Cadence sensor
    • Basic support. Tested with Garmin Cadence Sensor.
    • The sensor only measures the number of crank revolutions, the actual cadence has to be calculated by a consumer of this library from two different measurements. Check out CadenceTest_Main under src/test
  • Combined speed and cadence sensor
    • Basic support. Not tested with a physical device yet. Check out SpeedAndCadenceTest_Main under src/test
  • Power meter
    • Basic support. Tested with Garmin Vector 3. Check out PowerTest_Main under src/test
    • Not all data pages implemented, yet.
  • Ant FE-C trainer
    • Basic support. Tested with Elite Suito and Tacx. Check out FecTest_Main under src/test
    • Not all data pages implemented, yet.
    • TODO: Send command to adjust resistance

Current status:

Codebase still unstable but foundation is shaping up. Expect a few heavy refactors until things stabilize. Check out the Hrm/SpeedTest/Cadence/Fec examples to get started. Many thanks to https://github.com/JohnAZoidberg for help with implementing most of the devices.

Then you can add a maven dependency to be.glever:j-antplus:0.0.1-SNAPSHOT in order to use it.

Compatibility notes

Windows

This project uses usb4java-javax, which underneath uses libusb. There seems to be a mismatch between the default windows10 WHQL driver (libusb 1.2.40.201, provided by dynastream) and libusb. I resolved this by using the "Zadig" tool, select the ant-m usb stick (you may need to go to "Options" -> "list all devices") and downgrade the driver to 1.2.6.0 (which is actually the latest libusb driver I could find on the net).

Linux

Tested on Ubuntu: you need to give access to the usb interface for current user. I followed this approach (which may give too wide permissions to your taste): https://askubuntu.com/a/930338

echo 'SUBSYSTEM=="usb", MODE="0660", GROUP="plugdev"' > /etc/udev/rules.d/00-usb-permissions.rules
udevadm control --reload-rules

update: on manjaro, above didn't work (permission denied on the file), but this works

echo 'ATTRS{idVendor}=="fcf", ATTRS{idProduct}=="1009", MODE="0666"' > /etc/udev/rules.d/99-my-user-permissions.rules
udevadm control --reload-rules

After this, unplug and re-plug the dongle.

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.