Comments (6)
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
chrome://device-log/
chrome://usb-internals/
- How usb works
- Get usb ids:
- Building a device for WebUSB
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.
Research Web Serial API
Connects to the ant+ usb device.
from flux.
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.
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.
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()
getsno compatible device found
navigator.usb.getDevice()
gets erroraccess denied
- Zwift works
With the WinUSB driver:
navigator.serial.requestPort()
getsno compatible device found
navigator.usb.getDevice()
works- Zwift does not find the device
With the USB Serial (CDC) driver:
navigator.serial.requestPort()
worksnavigator.usb.getDevice()
does not list the device- Zwift does not find the device
from flux.
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)
- Trimmed Interval Power HOT 5
- add Workout Editor HOT 6
- SteadyState with PowerLow /PowerHigh Attribute HOT 7
- Make iOS/tvOS app HOT 2
- Add backend App
- Customisation of the interface HOT 4
- Elevation Gain in Workout Display? HOT 6
- Make PWA installable and working offline HOT 1
- Support for Moxy sensor HOT 1
- add Guess Watt game
- Feature request: Support of automatic upload to Strava HOT 1
- Intensity scaling during the workout HOT 1
- Feature request HOT 2
- ANT+ HR Connection Status + Incorrect Workout Distance HOT 2
- data tile switch stoped working HOT 1
- Training Effect/Load won't be calculated (Garmin) HOT 12
- Uncaught TypeError: Failed to resolve module specifier "@vercel/analytics" HOT 4
- Support o CycleOps PowerTap G2/G3 over ANT+ HOT 6
- Add calories to FIT file HOT 2
- Constant speed with drastic power differences? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flux.