Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No permission to access Polar USB device #29

Open
loukad opened this issue Jan 7, 2021 · 1 comment
Open

No permission to access Polar USB device #29

loukad opened this issue Jan 7, 2021 · 1 comment

Comments

@loukad
Copy link

loukad commented Jan 7, 2021

Hi Cédric,

Thank you for putting together this software. I am trying to view the file system of a Polar OH1 HRM on a Mac, and am getting the following error coming from libusb:

❯ ./polar_ftp
Traceback (most recent call last):
	7: from ./polar_ftp:30:in `<main>'
	6: from ./polar_ftp:30:in `new'
	5: from /Users/louka/code/polar/lib/polar_ftp.rb:13:in `initialize'
	4: from /Users/louka/code/polar/lib/polar_usb.rb:24:in `detect'
	3: from /Users/louka/code/polar/lib/polar_usb.rb:24:in `new'
	2: from /Users/louka/code/polar/lib/polar_usb_hid.rb:14:in `initialize'
	1: from /usr/local/lib/ruby/gems/2.7.0/gems/libusb-0.6.4/lib/libusb/dev_handle.rb:79:in `claim_interface'
/usr/local/lib/ruby/gems/2.7.0/gems/libusb-0.6.4/lib/libusb/constants.rb:68:in `raise_error': LIBUSB::ERROR_ACCESS in libusb_claim_interface (LIBUSB::ERROR_ACCESS)
	6: from ./polar_ftp:30:in `<main>'
	5: from ./polar_ftp:30:in `new'
	4: from /Users/louka/code/polar/lib/polar_ftp.rb:13:in `initialize'
	3: from /Users/louka/code/polar/lib/polar_usb.rb:24:in `detect'
	2: from /Users/louka/code/polar/lib/polar_usb.rb:24:in `new'
	1: from /Users/louka/code/polar/lib/polar_usb_hid.rb:5:in `initialize'
/Users/louka/code/polar/lib/polar_usb_hid.rb:21:in `rescue in initialize': No permission to access Polar USB device (PolarUsb::PolarUsbDeviceError)

My understanding is that libusb cannot claim the device because a kernel driver has already attached to it. But even after running:

sudo kextunload -b com.apple.driver.usb.IOUSBHostHIDDevice

and reconnecting the device, the error persists.

Any idea what the problem is?

Thanks,
Louka

@cmaion
Copy link
Owner

cmaion commented Jan 11, 2021

Hi,

I don't use a Mac so can't really help here.

I believe Apple did made a change a while back that results in this error, but didn't investigate further... It may require replacing libusb with some native macos-only USB interface library to solve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants