Git Product home page Git Product logo

Comments (14)

neilernst avatar neilernst commented on July 28, 2024 1

This is Python 3.6.4, pyusb 1.0.2, Mac 10.14.4

from blynclight.

JnyJny avatar JnyJny commented on July 28, 2024

Dang that's the same problem as the libhidapi solution that I jettisoned for PyUSB. Thank you for report and resolution. I'll update the README with Linux and macOS best practices for install libusb and then think about how to automate getting it installed.

from blynclight.

bkcrisler avatar bkcrisler commented on July 28, 2024

Seems like there also a problem with the permissions. Its more to do with libusb:

`

from blynclight import BlyncLight
light = BlyncLight.first_light()
red, blue, green = (255, 0, 0), (0, 255, 0), (0, 0, 255)
light.color = green
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.7/site-packages/blynclight/blynclight.py", line 190, in setattr
super().setattr(name, value)
File "/usr/local/lib/python3.7/site-packages/blynclight/blynclight.py", line 312, in color
self.update_device()
File "/usr/local/lib/python3.7/site-packages/blynclight/blynclight.py", line 386, in update_device
self._timeout)
File "/usr/local/lib/python3.7/site-packages/usb/core.py", line 1034, in ctrl_transfer
self._ctx.managed_claim_interface(self, interface_number)
File "/usr/local/lib/python3.7/site-packages/usb/core.py", line 102, in wrapper
return f(self, *args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/usb/core.py", line 167, in managed_claim_interface
self.backend.claim_interface(self.handle, i)
File "/usr/local/lib/python3.7/site-packages/usb/backend/libusb1.py", line 811, in claim_interface
_check(self.lib.libusb_claim_interface(dev_handle.handle, intf))
File "/usr/local/lib/python3.7/site-packages/usb/backend/libusb1.py", line 595, in _check
raise USBError(_strerror(ret), ret, _libusb_errno[ret])
usb.core.USBError: [Errno 13] Access denied (insufficient permissions)



This is raised on a different thread here:

https://github.com/braiden/python-ant-downloader/issues/30

from blynclight.

JnyJny avatar JnyJny commented on July 28, 2024

Thanks, that is definitely a permission problem. Can you post the output of the terminal command "groups"? Maybe I can see what group you need to be in to access the light.

from blynclight.

neilernst avatar neilernst commented on July 28, 2024

I have the same issue, here is my groups output:

staff com.apple.sharepoint.group.1 everyone localaccounts _appserverusr admin _appserveradm _lpadmin 
com.apple.access_screensharing access_bpf com.apple.sharepoint.group.2 _appstore _lpoperator _developer _analyticsusers com.apple.access_ftp com.apple.access_ssh

from blynclight.

JnyJny avatar JnyJny commented on July 28, 2024

Just a quick note that I'm working on this but have nothing to show for it yet.

Out of curiosity, what level macOS are you using? I started running into this problem when I updated to Mojave and haven't had time to debug it sufficiently.

from blynclight.

JnyJny avatar JnyJny commented on July 28, 2024

So it looks like I'll need to go back to hidapi since pyusb has no plans to make this work on macOS. To be fair, it's not a PyUSB problem, it's an "Apple not playing well with open source" problem (AFAICT).

from blynclight.

JnyJny avatar JnyJny commented on July 28, 2024

I've just pushed changes to how USB devices are accessed by the blynclight module. For macOS, Linux and Windows you'll need to install the hidapi library. The easiest way to do that for macOS is using brew:

$ brew install hidapi

I've tested specifically with version 0.8.0-rc1 of hidapi.

Give it a try and let me know what trouble you run into.

from blynclight.

JnyJny avatar JnyJny commented on July 28, 2024

Closing this issue as solved... for now.

from blynclight.

neilernst avatar neilernst commented on July 28, 2024

this update worked ... thanks a lot!

from blynclight.

JnyJny avatar JnyJny commented on July 28, 2024

Great news! Thank you for the feedback, that means a lot to me.

from blynclight.

wyojustin avatar wyojustin commented on July 28, 2024

Thanks for all your hard work @JnyJny . I seem to be having the same error

bash-3.2$ python antfs_list.py Driver available: [<class 'ant.base.driver.SerialDriver'>, <class 'ant.base.driver.USB2Driver'>, <class 'ant.base.driver.USB3Driver'>] Aborted Stop Traceback (most recent call last): File "antfs_list.py", line 93, in <module> main() File "antfs_list.py", line 81, in main a = Listener() File "antfs_list.py", line 36, in __init__ Application.__init__(self) File "/Users/justin/anaconda3/lib/python3.6/site-packages/ant/fs/manager.py", line 107, in __init__ self._node = Node() File "/Users/justin/anaconda3/lib/python3.6/site-packages/ant/easy/node.py", line 55, in __init__ self.ant = Ant() File "/Users/justin/anaconda3/lib/python3.6/site-packages/ant/base/ant.py", line 46, in __init__ self._driver = find_driver() File "/Users/justin/anaconda3/lib/python3.6/site-packages/ant/base/driver.py", line 272, in find_driver if driver.find(): File "/Users/justin/anaconda3/lib/python3.6/site-packages/ant/base/driver.py", line 159, in find usb.core.find(idVendor=cls.ID_VENDOR, idProduct=cls.ID_PRODUCT) File "/Users/justin/anaconda3/lib/python3.6/site-packages/usb/core.py", line 1297, in find raise NoBackendError('No backend available') usb.core.NoBackendError: No backend available bash-3.2$

I tried $ brew install hidapi to no avail. Any suggestions? macOS Mojave 10.14.4 macbook pro 2017

from blynclight.

JnyJny avatar JnyJny commented on July 28, 2024

Whoa. First off it appears that antfs_list.py uses PyUSB which is a different method of accessing USB devices than used by HID API, so installing hidapi probably (for sure) isn't going to solve this problem. I develop on a Mac and around the Mojave timeframe I started having trouble with PyUSB and I switched to HID API to communicate with USB devices. I did some searching and I'm guessing that this is from the openant project; I didn't see any issues for MacOS there. A casual inspection of the code seems to indicate the author is mostly developing for a Linux environment, so might not be aware of MacOS related problems with USB devices.

Take a look at the PyUSB FAQ and see if this helps

from blynclight.

wyojustin avatar wyojustin commented on July 28, 2024

Thanks for the quick feedback... will do.

Justin

from blynclight.

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.