This problem is old as the world. There are discussions and solutions available. It all boils down to update the rules file and give permissions. So I have followed the recipe. But I still have the same problem. here are screenshots showing I follow instructions.
Versions:
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
usb.__version__ '1.0.2'
Error:
Traceback (most recent call last):
File "/media/psf/Home/All-Projects-on-femto/LaserLab/Software/usb_4108.py", line 19, in <module>
dev.set_configuration()
File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 869, in set_configuration
self._ctx.managed_set_configuration(self, configuration)
File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 102, in wrapper
return f(self, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 147, in managed_set_configuration
self.managed_open()
File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 102, in wrapper
return f(self, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 120, in managed_open
self.handle = self.backend.open_device(self.dev)
File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb1.py", line 786, in open_device
return _DeviceHandle(dev)
File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb1.py", line 643, in __init__
_check(_lib.libusb_open(self.devid, byref(self.handle)))
File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb1.py", line 595, in _check
raise USBError(_strerror(ret), ret, _libusb_errno[ret])
USBError: [Errno 13] Access denied (insufficient permissions)
Rules. file (location /etc/udev/rules.d/99-usbftdi.rules)
# For FTDI FT232 & FT245 USB devices with Vendor ID = 0x0403, Product ID = 0xabc
SYSFS{idProduct}=="4108", SYSFS{idVendor}=="0683", RUN+="/sbin/modprobe -q ftdi-sio product=0x4108 vendor=0x0683"
#SYSFS{idProduct}=="2450", SYSFS{idVendor}=="0683", RUN+="/sbin/modprobe -q ftdi-sio product=0x2450 vendor=0x0683"
SYSFS{idVendor}=="0683", SYSFS{idProduct}=="4108", MODE="0666"
and strip down code:
import usb.core
import usb.util
dev = usb.core.find(idVendor=0x0683, idProduct=0x4108)
dev.reset()
However, it doesn't give me necessary permissions. My stripped down code that still produces the error:
import usb.core
import usb.util
dev = usb.core.find(idVendor=0x0683, idProduct=0x4108)
dev.reset()
The strange thing that if I start IDLE from the terminal as superuser I get permissions (terminal: sudo idle
).
sudo
would solve your permission problems, that's kind of the whole point ofsudo
and the root user. – MilurdSUBSYSTEM=="usb", ATTRS{idVendor}=="0683", MODE="0666"
– Milurdsudo python3 app.py
instead ofpython3 app.py
– Emplacement