Coder Social home page Coder Social logo

Comments (6)

dvmarinoff avatar dvmarinoff commented on May 29, 2024

Research WebUSB as possible way to implement.

The native driver is taking over the ant+ usb device, and it requires a manual unbind. Does not appear to be a long term solution.

Useful links and tools

0fcf  Dynastream Innovations, Inc.
	1003  ANT Development Board
	1004  ANTUSB Stick
	1006  ANT Development Board
	1008  ANTUSB2 Stick
	1009  ANTUSB-m Stick
$ lsusb
Bus 002 Device 016: ID 0fcf:1008 Dynastream Innovations, Inc. ANTUSB2 Stick
$ lsusb -t
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/9p, 480M
    |__ Port 1: Dev 16, If 0, Class=Vendor Specific Class, Driver=usb_serial_simple, 12M
$ grep 0fcf /sys/bus/usb/devices/*/idVendor
/sys/bus/usb/devices/2-1/idVendor:0fcf

In Logs:

usb 2-1: suunto converter now attached to ttyUSB0
usb_serial_simple 2-1:1.0: suunto converter detected

Something of the sort is needed to unbind the ant+ usb device:

$ echo -n "2-1:1.0" | tee -a /sys/bus/usb/drivers/usb_serial_simple/unbind

from flux.

dvmarinoff avatar dvmarinoff commented on May 29, 2024

Research Web Serial API

Connects to the ant+ usb device.

from flux.

dvmarinoff avatar dvmarinoff commented on May 29, 2024

How to give permission to ANT+ USB stick on Ubuntu:

Create a rule file:

$ touch 50-move-stick-mini.rules

$ vim 50-move-stick-mini.rules
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fcf", ATTRS{idProduct}=="1008", MODE="0664", GROUP="plugdev"

$ mv 50-move-stick-mini.rules /etc/udev/rules.d/

unplug and plug device for the rule to take effect

Check permissions and groups:

$ ls -l /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 0 Jan 25 17:00 /dev/ttyUSB0

Check user membership:

$ groups <username>
$ id -Gn <username>

Add user to a group if needed:
$ sudo usermod -a -G <groupname> <username>

Logout and Login for changes to take effect.

from flux.

dvmarinoff avatar dvmarinoff commented on May 29, 2024

WebSerial is not available on Mobile devices, but WebUSB is and it appears to be usable.

Moreover it is possible to connect the device to a USB-C monitor, switch to desktop mode (marketed as DeX on Samsung) and gain access to the USB ports on the monitor. This way ANT+ usb stick can be used from a web page on a mobile device.

A simpler way is to use USB-A to to USB-C adapter and plug it in the charging port of the phone, but that would make using the port for charging, screen mirroring, or desktop mode not possible.

Prereq. is to have ANT+ USB Service plugin installed from Play Store.

  • make a PoC with Serial polyfill
  • implement custom driver, or only the necessary parts of the polyfill in pure js, as a fallback on mobile

from flux.

dvmarinoff avatar dvmarinoff commented on May 29, 2024

On Windows 10 WebUSB and WebSerial are available, but WebSerial does not recognize the device and WebUSB can't open it.
Here and on Ubuntu device.open() on WebUSB throws the error: 'Uncaught DOMException: Access denied.' WebUSB issue

On Windows 10 the default driver needs to be replaced with another one with the Zadig utillity tool (download, docs).

On Windows 10 with the libusb-win32 (default) driver:

  • navigator.serial.requestPort() gets no compatible device found
  • navigator.usb.getDevice() gets error access denied
  • Zwift works

With the WinUSB driver:

  • navigator.serial.requestPort() gets no compatible device found
  • navigator.usb.getDevice() works
  • Zwift does not find the device

With the USB Serial (CDC) driver:

  • navigator.serial.requestPort() works
  • navigator.usb.getDevice() does not list the device
  • Zwift does not find the device

from flux.

dvmarinoff avatar dvmarinoff commented on May 29, 2024

Summary:

  • WebSerial works on Linux,
  • WebUSB + web-serial-polyfill works on Android and MacOS
  • WebSerial and WebUSB are present on Windows 10, but nothing works there

This effort is getting way too big and is moving to another project.

from flux.

Related Issues (20)

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.