Comments (14)
This is Python 3.6.4, pyusb 1.0.2, Mac 10.14.4
from blynclight.
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.
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.
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.
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.
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.
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.
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.
Closing this issue as solved... for now.
from blynclight.
this update worked ... thanks a lot!
from blynclight.
Great news! Thank you for the feedback, that means a lot to me.
from blynclight.
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.
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.
Thanks for the quick feedback... will do.
Justin
from blynclight.
Related Issues (20)
- Commands to Light Not Processing HOT 17
- Support PyUSB & HIDAPI
- ear HOT 1
- pip3 install in editable mode doesn't work HOT 1
- Flash not working HOT 3
- Installing on a Raspberry Pi HOT 20
- Control from iOS shortcut application HOT 3
- ImportError: failed to locate hidapi shared object on macOS Catalina HOT 4
- "No such device" error with blync CLI HOT 15
- ImportError after Pip update to v0.8.0 HOT 9
- ship a command line interface and driver script HOT 1
- [QUESTION] Source of COMMAND_LENGTH HOT 3
- RFE: add a udev rule to docs HOT 6
- Candle flicker effect command-line interface.
- Light not recognized. HOT 5
- Add an effects package. HOT 1
- Create a simple API server and ship in scripts directory.
- Python version testing with tox
- Relax version requirements for Python from only 3.7 to 3.5 or better HOT 1
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 blynclight.