Closed dvmarinoff closed 2 years ago
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
chrome://device-log/
chrome://usb-internals/
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
Connects to the ant+ usb device.
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.
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.
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
With the WinUSB driver:
navigator.serial.requestPort()
gets no compatible device found
navigator.usb.getDevice()
worksWith the USB Serial (CDC) driver:
navigator.serial.requestPort()
worksnavigator.usb.getDevice()
does not list the deviceSummary:
This effort is getting way too big and is moving to another project.
Supporting Ant+ on the web.