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:
JavaScript
x
3
1
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
2
usb.__version__ '1.0.2'
3
Error:
JavaScript
1
21
21
1
Traceback (most recent call last):
2
File "/media/psf/Home/All-Projects-on-femto/LaserLab/Software/usb_4108.py", line 19, in <module>
3
dev.set_configuration()
4
File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 869, in set_configuration
5
self._ctx.managed_set_configuration(self, configuration)
6
File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 102, in wrapper
7
return f(self, *args, **kwargs)
8
File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 147, in managed_set_configuration
9
self.managed_open()
10
File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 102, in wrapper
11
return f(self, *args, **kwargs)
12
File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 120, in managed_open
13
self.handle = self.backend.open_device(self.dev)
14
File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb1.py", line 786, in open_device
15
return _DeviceHandle(dev)
16
File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb1.py", line 643, in __init__
17
_check(_lib.libusb_open(self.devid, byref(self.handle)))
18
File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb1.py", line 595, in _check
19
raise USBError(_strerror(ret), ret, _libusb_errno[ret])
20
USBError: [Errno 13] Access denied (insufficient permissions)
21
Rules. file (location /etc/udev/rules.d/99-usbftdi.rules)
JavaScript
1
5
1
# For FTDI FT232 & FT245 USB devices with Vendor ID = 0x0403, Product ID = 0xabc
2
SYSFS{idProduct}=="4108", SYSFS{idVendor}=="0683", RUN+="/sbin/modprobe -q ftdi-sio product=0x4108 vendor=0x0683"
3
#SYSFS{idProduct}=="2450", SYSFS{idVendor}=="0683", RUN+="/sbin/modprobe -q ftdi-sio product=0x2450 vendor=0x0683"
4
SYSFS{idVendor}=="0683", SYSFS{idProduct}=="4108", MODE="0666"
5
and strip down code:
JavaScript
1
5
1
import usb.core
2
import usb.util
3
dev = usb.core.find(idVendor=0x0683, idProduct=0x4108)
4
dev.reset()
5
However, it doesn’t give me necessary permissions. My stripped down code that still produces the error:
JavaScript
1
5
1
import usb.core
2
import usb.util
3
dev = usb.core.find(idVendor=0x0683, idProduct=0x4108)
4
dev.reset()
5
The strange thing that if I start IDLE from the terminal as superuser I get permissions (terminal: sudo idle
).
Advertisement
Answer
Your rules look a little bit odd. Can you remove all of them and try this instead?
JavaScript
1
2
1
SUBSYSTEM=="usb", ATTRS{idVendor}=="0683", MODE="0666"
2