From: charles w. <cmf...@gm...> - 2019-01-18 04:01:37
|
Hi, I usually manage to solve my problems by hitting my head against them until I get a breakthrough. This time nothing. I am new to trying PYUSB. I have the same problem with 2 installations. 1) Ubuntu Mate 16.04 on Kernel Linux 4.15.0-43-generic x86_64running on AMD Ryzen 5 2600X 2) Raspbian (Jessie) on Raspberry Pi 3B+ Also I confirm that libusb-1.0-0 <https://pkgs.org/download/libusb-1.0-0> is there on both. After installation I started the tutorial (why not?) but did not get far: import usb.core import usb.util dev = usb.core.find(idVendor=0x1d6b, idProduct=0x0003) print(dev) *OK so far and I get:* *================== RESTART: /home/wilson/temPY/USBtest01.py ==================DEVICE ID 1d6b:0003 on Bus 004 Address 001 ================= bLength : 0x12 (18 bytes) bDescriptorType : 0x1 Device bcdUSB : 0x300 USB 3.0 bDeviceClass : 0x9 Hub bDeviceSubClass : 0x0 bDeviceProtocol : 0x3 bMaxPacketSize0 : 0x9 (9 bytes) idVendor : 0x1d6b idProduct : 0x0003 bcdDevice : 0x415 Device 4.15 iManufacturer : 0x3 Error Accessing String iProduct : 0x2 Error Accessing String iSerialNumber : 0x1 Error Accessing String bNumConfigurations : 0x1 CONFIGURATION 1: 0 mA ==================================== bLength : 0x9 (9 bytes) bDescriptorType : 0x2 Configuration wTotalLength : 0x1f (31 bytes) bNumInterfaces : 0x1 bConfigurationValue : 0x1 iConfiguration : 0x0 bmAttributes : 0xe0 Self Powered, Remote Wakeup bMaxPower : 0x0 (0 mA) INTERFACE 0: Hub ======================================= bLength : 0x9 (9 bytes) bDescriptorType : 0x4 Interface bInterfaceNumber : 0x0 bAlternateSetting : 0x0 bNumEndpoints : 0x1 bInterfaceClass : 0x9 Hub bInterfaceSubClass : 0x0 bInterfaceProtocol : 0x0 iInterface : 0x0 ENDPOINT 0x81: Interrupt IN ========================== bLength : 0x7 (7 bytes) bDescriptorType : 0x5 Endpoint bEndpointAddress : 0x81 IN bmAttributes : 0x3 Interrupt wMaxPacketSize : 0x4 (4 bytes) bInterval : 0xc* which tells me that pyusb is installed and is finding USB.core and seems to be working. When I take the next step in the tutorial: dev.set_configuration() it all turns to custard and I get: raceback (most recent call last): File "/home/wilson/temPY/USBtest01.py", line 11, in <module> dev.set_configuration() File "/usr/lib/python3/dist-packages/usb/core.py", line 799, in set_configuration self._ctx.managed_set_configuration(self, configuration) File "/usr/lib/python3/dist-packages/usb/core.py", line 127, in managed_set_configuration self.managed_open() File "/usr/lib/python3/dist-packages/usb/core.py", line 105, in managed_open self.handle = self.backend.open_device(self.dev) File "/usr/lib/python3/dist-packages/usb/backend/libusb1.py", line 722, in open_device return _DeviceHandle(dev) File "/usr/lib/python3/dist-packages/usb/backend/libusb1.py", line 600, in __init__ _check(_lib.libusb_open(self.devid, byref(self.handle))) File "/usr/lib/python3/dist-packages/usb/backend/libusb1.py", line 552, in _check raise USBError(_strerror(ret), ret, _libusb_errno[ret]) usb.core.USBError: [Errno 13] Access denied (insufficient permissions) This on the AMD system, the diagnostic on the Raspi is similar but not identical. I have worked through the other similar postings on the mailing list - while similar their problems were at a more complex level --- I am at step 1 with the tutorial ... I have also worked through the occurrences of set_configuration() in the ...usb/core.py module and could see no reason for dev.set_configuration() to bomb-out. I have racked my brains and consulted my local gurus with no joy .... so any help would be appreciated - I have a feeling it is something dumb that I have missed. Cheers Charles |
From: Martin R. <spl...@gm...> - 2019-01-18 07:51:39
|
>usb.core.USBError: [Errno 13] Access denied (insufficient permissions) Run your script with sudo? Or add a udev rule so your regular user also has access. On Fri, Jan 18, 2019 at 5:01 AM charles wilson <cmf...@gm...> wrote: > > Hi, > I usually manage to solve my problems by hitting my head against them until I get a breakthrough. This time nothing. > I am new to trying PYUSB. I have the same problem with 2 installations. > 1) Ubuntu Mate 16.04 on Kernel Linux 4.15.0-43-generic x86_64running on AMD Ryzen 5 2600X > 2) Raspbian (Jessie) on Raspberry Pi 3B+ > > Also I confirm that libusb-1.0-0 is there on both. > > After installation I started the tutorial (why not?) but did not get far: > > import usb.core > import usb.util > > dev = usb.core.find(idVendor=0x1d6b, idProduct=0x0003) > print(dev) > OK so far and I get: > > ================== RESTART: /home/wilson/temPY/USBtest01.py ================== > DEVICE ID 1d6b:0003 on Bus 004 Address 001 ================= > bLength : 0x12 (18 bytes) > bDescriptorType : 0x1 Device > bcdUSB : 0x300 USB 3.0 > bDeviceClass : 0x9 Hub > bDeviceSubClass : 0x0 > bDeviceProtocol : 0x3 > bMaxPacketSize0 : 0x9 (9 bytes) > idVendor : 0x1d6b > idProduct : 0x0003 > bcdDevice : 0x415 Device 4.15 > iManufacturer : 0x3 Error Accessing String > iProduct : 0x2 Error Accessing String > iSerialNumber : 0x1 Error Accessing String > bNumConfigurations : 0x1 > CONFIGURATION 1: 0 mA ==================================== > bLength : 0x9 (9 bytes) > bDescriptorType : 0x2 Configuration > wTotalLength : 0x1f (31 bytes) > bNumInterfaces : 0x1 > bConfigurationValue : 0x1 > iConfiguration : 0x0 > bmAttributes : 0xe0 Self Powered, Remote Wakeup > bMaxPower : 0x0 (0 mA) > INTERFACE 0: Hub ======================================= > bLength : 0x9 (9 bytes) > bDescriptorType : 0x4 Interface > bInterfaceNumber : 0x0 > bAlternateSetting : 0x0 > bNumEndpoints : 0x1 > bInterfaceClass : 0x9 Hub > bInterfaceSubClass : 0x0 > bInterfaceProtocol : 0x0 > iInterface : 0x0 > ENDPOINT 0x81: Interrupt IN ========================== > bLength : 0x7 (7 bytes) > bDescriptorType : 0x5 Endpoint > bEndpointAddress : 0x81 IN > bmAttributes : 0x3 Interrupt > wMaxPacketSize : 0x4 (4 bytes) > bInterval : 0xc > > which tells me that pyusb is installed and is finding USB.core and seems to be working. > When I take the next step in the tutorial: > dev.set_configuration() > > it all turns to custard and I get: > > raceback (most recent call last): > File "/home/wilson/temPY/USBtest01.py", line 11, in <module> > dev.set_configuration() > File "/usr/lib/python3/dist-packages/usb/core.py", line 799, in set_configuration > self._ctx.managed_set_configuration(self, configuration) > File "/usr/lib/python3/dist-packages/usb/core.py", line 127, in managed_set_configuration > self.managed_open() > File "/usr/lib/python3/dist-packages/usb/core.py", line 105, in managed_open > self.handle = self.backend.open_device(self.dev) > File "/usr/lib/python3/dist-packages/usb/backend/libusb1.py", line 722, in open_device > return _DeviceHandle(dev) > File "/usr/lib/python3/dist-packages/usb/backend/libusb1.py", line 600, in __init__ > _check(_lib.libusb_open(self.devid, byref(self.handle))) > File "/usr/lib/python3/dist-packages/usb/backend/libusb1.py", line 552, in _check > raise USBError(_strerror(ret), ret, _libusb_errno[ret]) > usb.core.USBError: [Errno 13] Access denied (insufficient permissions) > > This on the AMD system, the diagnostic on the Raspi is similar but not identical. > > I have worked through the other similar postings on the mailing list - while similar their problems were at a more complex level --- I am at step 1 with the tutorial ... > I have also worked through the occurrences of set_configuration() in the ...usb/core.py module and could see no reason for dev.set_configuration() to bomb-out. > > I have racked my brains and consulted my local gurus with no joy .... so any help would be appreciated - I have a feeling it is something dumb that I have missed. > > Cheers > Charles > > > > _______________________________________________ > pyusb-users mailing list > pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users |
From: Sergio A. Q. <ser...@gm...> - 2019-01-18 20:22:53
|
i saw this message: usb.core.USBError: [Errno 13] Access denied (insufficient permissions) when i was using a wrong driver in Windows 10. I could also see the whole usb device descriptor, just could not interact with it. my suggestion is to try to re install or update the libusb driver On Thu, Jan 17, 2019 at 9:01 PM charles wilson <cmf...@gm...> wrote: > Hi, > I usually manage to solve my problems by hitting my head against them > until I get a breakthrough. This time nothing. > I am new to trying PYUSB. I have the same problem with 2 installations. > 1) Ubuntu Mate 16.04 on Kernel Linux 4.15.0-43-generic x86_64running on > AMD Ryzen 5 2600X > 2) Raspbian (Jessie) on Raspberry Pi 3B+ > > Also I confirm that libusb-1.0-0 <https://pkgs.org/download/libusb-1.0-0> > is there on both. > > After installation I started the tutorial (why not?) but did not get far: > > import usb.core > import usb.util > > dev = usb.core.find(idVendor=0x1d6b, idProduct=0x0003) > print(dev) > *OK so far and I get:* > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > *================== RESTART: /home/wilson/temPY/USBtest01.py > ==================DEVICE ID 1d6b:0003 on Bus 004 Address 001 > ================= bLength : 0x12 (18 > bytes) bDescriptorType : 0x1 Device bcdUSB : > 0x300 USB 3.0 bDeviceClass : 0x9 Hub bDeviceSubClass > : 0x0 bDeviceProtocol : 0x3 bMaxPacketSize0 : 0x9 (9 > bytes) idVendor : 0x1d6b idProduct : > 0x0003 bcdDevice : 0x415 Device 4.15 iManufacturer > : 0x3 Error Accessing String iProduct : 0x2 Error > Accessing String iSerialNumber : 0x1 Error Accessing > String bNumConfigurations : 0x1 CONFIGURATION 1: 0 mA > ==================================== bLength : 0x9 (9 > bytes) bDescriptorType : 0x2 Configuration wTotalLength > : 0x1f (31 bytes) bNumInterfaces : 0x1 bConfigurationValue > : 0x1 iConfiguration : 0x0 bmAttributes : 0xe0 > Self Powered, Remote Wakeup bMaxPower : 0x0 (0 mA) > INTERFACE 0: Hub ======================================= > bLength : 0x9 (9 bytes) bDescriptorType : 0x4 > Interface bInterfaceNumber : 0x0 bAlternateSetting : > 0x0 bNumEndpoints : 0x1 bInterfaceClass : 0x9 Hub > bInterfaceSubClass : 0x0 bInterfaceProtocol : 0x0 > iInterface : 0x0 ENDPOINT 0x81: Interrupt IN > ========================== bLength : 0x7 (7 bytes) > bDescriptorType : 0x5 Endpoint bEndpointAddress : 0x81 IN > bmAttributes : 0x3 Interrupt wMaxPacketSize : 0x4 (4 > bytes) bInterval : 0xc* > > which tells me that pyusb is installed and is finding USB.core and seems > to be working. > When I take the next step in the tutorial: > dev.set_configuration() > > it all turns to custard and I get: > > raceback (most recent call last): > File "/home/wilson/temPY/USBtest01.py", line 11, in <module> > dev.set_configuration() > File "/usr/lib/python3/dist-packages/usb/core.py", line 799, in > set_configuration > self._ctx.managed_set_configuration(self, configuration) > File "/usr/lib/python3/dist-packages/usb/core.py", line 127, in > managed_set_configuration > self.managed_open() > File "/usr/lib/python3/dist-packages/usb/core.py", line 105, in > managed_open > self.handle = self.backend.open_device(self.dev) > File "/usr/lib/python3/dist-packages/usb/backend/libusb1.py", line 722, > in open_device > return _DeviceHandle(dev) > File "/usr/lib/python3/dist-packages/usb/backend/libusb1.py", line 600, > in __init__ > _check(_lib.libusb_open(self.devid, byref(self.handle))) > File "/usr/lib/python3/dist-packages/usb/backend/libusb1.py", line 552, > in _check > raise USBError(_strerror(ret), ret, _libusb_errno[ret]) > usb.core.USBError: [Errno 13] Access denied (insufficient permissions) > > This on the AMD system, the diagnostic on the Raspi is similar but not > identical. > > I have worked through the other similar postings on the mailing list - > while similar their problems were at a more complex level --- I am at step > 1 with the tutorial ... > I have also worked through the occurrences of set_configuration() in the > ...usb/core.py module and could see no reason for dev.set_configuration() > to bomb-out. > > I have racked my brains and consulted my local gurus with no joy .... so > any help would be appreciated - I have a feeling it is something dumb that > I have missed. > > Cheers > Charles > > > > _______________________________________________ > pyusb-users mailing list > pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users > -- SQ |
From: charles w. <cmf...@gm...> - 2019-01-21 04:27:47
|
Hi Guys, Thanks for your time and feedback; it's taken awhile to get back to this. On permissions, I had checked/changed permissions previously but re-checked and found a missed one in /python3.5/site-packages/usb/backend- happened to be libusb1.pywhich was flagged - all fixed now I had also not checked the /dev/*USB* but did and gave necessary permissions pi@raspi3:~/.local/lib/python3.5/site-packages/usb $ ls -l total 132 drwxrwxrwx 3 pi pi 4096 Jan 20 13:31 backend -rwxrwxrwx 1 pi pi 8739 Jan 20 13:31 control.py -rwxrwxrwx 1 pi pi 46704 Jan 20 13:31 core.py -rwxrwxrwx 1 pi pi 3215 Jan 20 13:31 _debug.py -rwxrwxrwx 1 pi pi 3550 Jan 20 13:31 __init__.py -rwxrwxrwx 1 pi pi 3522 Jan 20 13:31 _interop.py -rwxrwxrwx 1 pi pi 12588 Jan 20 13:31 legacy.py -rwxrwxrwx 1 pi pi 6788 Jan 20 13:31 libloader.py -rwxrwxrwx 1 pi pi 3259 Jan 20 13:31 _lookup.py -rwxrwxrwx 1 pi pi 5287 Jan 20 13:31 _objfinalizer.py drwxrwxrwx 2 pi pi 4096 Jan 20 13:31 __pycache__ -rwxrwxrwx 1 pi pi 12291 Jan 20 13:31 util.py pi@raspi3:~/.local/lib/python3.5/site-packages/usb/backend $ ls -l total 108 -rwxrwxrwx 1 pi pi 16048 Jan 20 13:31 __init__.py -rwxrwxrwx 1 pi pi 23783 Jan 20 13:31 libusb0.py -rwxrwxrwx 1 pi pi 35299 Jan 20 13:31 libusb1.py -rwxrwxrwx 1 pi pi 28019 Jan 20 13:31 openusb.py drwxrwxrwx 2 pi pi 4096 Jan 20 13:31 __pycache__ pi@raspi3:~/.local/lib/python3.5/site-packages/usb/backend $ cd __pycache__ pi@raspi3:~/.local/lib/python3.5/site-packages/usb/backend/__pycache__ $ ls -l total 76 -rwxrwxrwx 1 pi pi 16140 Jan 20 13:31 __init__.cpython-35.pyc -rwxrwxrwx 1 pi pi 15006 Jan 20 13:31 libusb0.cpython-35.pyc -rwxrwxrwx 1 pi pi 23713 Jan 20 13:31 libusb1.cpython-35.pyc -rwxrwxrwx 1 pi pi 18216 Jan 20 13:31 openusb.cpython-35.pyc pi@raspi3:~/.local/lib/python3.5/site-packages/usb/backend/__pycache__ $ still get the same error diagnostic which still ends usb.core.USBError: [Errno 13] Access denied (insufficient permissions)" Traceback (most recent call last): File "/home/pi/usb1.py", line 12, in <module> dev.set_configuration() File "/home/pi/.local/lib/python3.5/site-packages/usb/core.py", line 869, in set_configuration self._ctx.managed_set_configuration(self, configuration) File "/home/pi/.local/lib/python3.5/site-packages/usb/core.py", line 102, in wrapper return f(self, *args, **kwargs) File "/home/pi/.local/lib/python3.5/site-packages/usb/core.py", line 147, in managed_set_configuration self.managed_open() File "/home/pi/.local/lib/python3.5/site-packages/usb/core.py", line 102, in wrapper return f(self, *args, **kwargs) File "/home/pi/.local/lib/python3.5/site-packages/usb/core.py", line 120, in managed_open self.handle = self.backend.open_device(self.dev) File "/home/pi/.local/lib/python3.5/site-packages/usb/backend/libusb1.py", line 786, in open_device return _DeviceHandle(dev) File "/home/pi/.local/lib/python3.5/site-packages/usb/backend/libusb1.py", line 643, in __init__ _check(_lib.libusb_open(self.devid, byref(self.handle))) File "/home/pi/.local/lib/python3.5/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) so basically no change. Now the interesting bit. I tried running as root root@raspi3:/home/pi/PyProj# python3.5 pyusb_1.py Traceback (most recent call last): File "pyusb_1.py", line 2, in <module> import usb.core ImportError: No module named 'usb' same result if I simply sudo python3.5 pyusb_1.py when I run python3.5 from the terminal and get the python >>> prompt there is no trouble with 'import' and checking with 'help(usb)' shows the module is there and accessible. Interesting though is that I have the same problem on all linux, so whatever I did wrong I did it each time. I have tried installing pyusb with PIP and sudo apt-get but it makes no difference. The further I go with this the darker the tunnel gets. Cheers Charles On Sat, 19 Jan 2019 at 09:23, Sergio A. Quiroga <ser...@gm...> wrote: > i saw this message: > > usb.core.USBError: [Errno 13] Access denied (insufficient permissions) > > > when i was using a wrong driver in Windows 10. I could also see the whole > usb device descriptor, just could not interact with it. > > my suggestion is to try to re install or update the libusb driver > > On Thu, Jan 17, 2019 at 9:01 PM charles wilson <cmf...@gm...> > wrote: > >> Hi, >> I usually manage to solve my problems by hitting my head against them >> until I get a breakthrough. This time nothing. >> I am new to trying PYUSB. I have the same problem with 2 installations. >> 1) Ubuntu Mate 16.04 on Kernel Linux 4.15.0-43-generic x86_64running on >> AMD Ryzen 5 2600X >> 2) Raspbian (Jessie) on Raspberry Pi 3B+ >> >> Also I confirm that libusb-1.0-0 <https://pkgs.org/download/libusb-1.0-0> >> is there on both. >> >> After installation I started the tutorial (why not?) but did not get far: >> >> import usb.core >> import usb.util >> >> dev = usb.core.find(idVendor=0x1d6b, idProduct=0x0003) >> print(dev) >> *OK so far and I get:* >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> *================== RESTART: /home/wilson/temPY/USBtest01.py >> ==================DEVICE ID 1d6b:0003 on Bus 004 Address 001 >> ================= bLength : 0x12 (18 >> bytes) bDescriptorType : 0x1 Device bcdUSB : >> 0x300 USB 3.0 bDeviceClass : 0x9 Hub bDeviceSubClass >> : 0x0 bDeviceProtocol : 0x3 bMaxPacketSize0 : 0x9 (9 >> bytes) idVendor : 0x1d6b idProduct : >> 0x0003 bcdDevice : 0x415 Device 4.15 iManufacturer >> : 0x3 Error Accessing String iProduct : 0x2 Error >> Accessing String iSerialNumber : 0x1 Error Accessing >> String bNumConfigurations : 0x1 CONFIGURATION 1: 0 mA >> ==================================== bLength : 0x9 (9 >> bytes) bDescriptorType : 0x2 Configuration wTotalLength >> : 0x1f (31 bytes) bNumInterfaces : 0x1 bConfigurationValue >> : 0x1 iConfiguration : 0x0 bmAttributes : 0xe0 >> Self Powered, Remote Wakeup bMaxPower : 0x0 (0 mA) >> INTERFACE 0: Hub ======================================= >> bLength : 0x9 (9 bytes) bDescriptorType : 0x4 >> Interface bInterfaceNumber : 0x0 bAlternateSetting : >> 0x0 bNumEndpoints : 0x1 bInterfaceClass : 0x9 Hub >> bInterfaceSubClass : 0x0 bInterfaceProtocol : 0x0 >> iInterface : 0x0 ENDPOINT 0x81: Interrupt IN >> ========================== bLength : 0x7 (7 bytes) >> bDescriptorType : 0x5 Endpoint bEndpointAddress : 0x81 IN >> bmAttributes : 0x3 Interrupt wMaxPacketSize : 0x4 (4 >> bytes) bInterval : 0xc* >> >> which tells me that pyusb is installed and is finding USB.core and seems >> to be working. >> When I take the next step in the tutorial: >> dev.set_configuration() >> >> it all turns to custard and I get: >> >> raceback (most recent call last): >> File "/home/wilson/temPY/USBtest01.py", line 11, in <module> >> dev.set_configuration() >> File "/usr/lib/python3/dist-packages/usb/core.py", line 799, in >> set_configuration >> self._ctx.managed_set_configuration(self, configuration) >> File "/usr/lib/python3/dist-packages/usb/core.py", line 127, in >> managed_set_configuration >> self.managed_open() >> File "/usr/lib/python3/dist-packages/usb/core.py", line 105, in >> managed_open >> self.handle = self.backend.open_device(self.dev) >> File "/usr/lib/python3/dist-packages/usb/backend/libusb1.py", line 722, >> in open_device >> return _DeviceHandle(dev) >> File "/usr/lib/python3/dist-packages/usb/backend/libusb1.py", line 600, >> in __init__ >> _check(_lib.libusb_open(self.devid, byref(self.handle))) >> File "/usr/lib/python3/dist-packages/usb/backend/libusb1.py", line 552, >> in _check >> raise USBError(_strerror(ret), ret, _libusb_errno[ret]) >> usb.core.USBError: [Errno 13] Access denied (insufficient permissions) >> >> This on the AMD system, the diagnostic on the Raspi is similar but not >> identical. >> >> I have worked through the other similar postings on the mailing list - >> while similar their problems were at a more complex level --- I am at step >> 1 with the tutorial ... >> I have also worked through the occurrences of set_configuration() in the >> ...usb/core.py module and could see no reason for dev.set_configuration() >> to bomb-out. >> >> I have racked my brains and consulted my local gurus with no joy .... so >> any help would be appreciated - I have a feeling it is something dumb that >> I have missed. >> >> Cheers >> Charles >> >> >> >> _______________________________________________ >> pyusb-users mailing list >> pyu...@li... >> https://lists.sourceforge.net/lists/listinfo/pyusb-users >> > > > -- > SQ > _______________________________________________ > pyusb-users mailing list > pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users > |
From: Jacques-D. P. <jac...@bl...> - 2019-01-21 06:34:42
|
Hi Charles, What kind of device are you trying to communicate with? Regards, Jacques-D. On 21.01.19 05:23, charles wilson wrote: > Hi Guys, > Thanks for your time and feedback; it's taken awhile to get back to this. > On permissions, I had checked/changed permissions previously but > re-checked and found a missed one in > /python3.5/site-packages/usb/backend- happened to be libusb1.pywhich > was flagged - all fixed now > I had also not checked the /dev/*USB* but did and gave necessary > permissions > > pi@raspi3:~/.local/lib/python3.5/site-packages/usb $ ls -l > total 132 > drwxrwxrwx 3 pi pi 4096 Jan 20 13:31 backend > -rwxrwxrwx 1 pi pi 8739 Jan 20 13:31 control.py > -rwxrwxrwx 1 pi pi 46704 Jan 20 13:31 core.py > -rwxrwxrwx 1 pi pi 3215 Jan 20 13:31 _debug.py > -rwxrwxrwx 1 pi pi 3550 Jan 20 13:31 __init__.py > -rwxrwxrwx 1 pi pi 3522 Jan 20 13:31 _interop.py > -rwxrwxrwx 1 pi pi 12588 Jan 20 13:31 legacy.py > -rwxrwxrwx 1 pi pi 6788 Jan 20 13:31 libloader.py > -rwxrwxrwx 1 pi pi 3259 Jan 20 13:31 _lookup.py > -rwxrwxrwx 1 pi pi 5287 Jan 20 13:31 _objfinalizer.py > drwxrwxrwx 2 pi pi 4096 Jan 20 13:31 __pycache__ > -rwxrwxrwx 1 pi pi 12291 Jan 20 13:31 util.py > > pi@raspi3:~/.local/lib/python3.5/site-packages/usb/backend $ ls -l > total 108 > -rwxrwxrwx 1 pi pi 16048 Jan 20 13:31 __init__.py > -rwxrwxrwx 1 pi pi 23783 Jan 20 13:31 libusb0.py > -rwxrwxrwx 1 pi pi 35299 Jan 20 13:31 libusb1.py > -rwxrwxrwx 1 pi pi 28019 Jan 20 13:31 openusb.py > drwxrwxrwx 2 pi pi 4096 Jan 20 13:31 __pycache__ > pi@raspi3:~/.local/lib/python3.5/site-packages/usb/backend $ cd > __pycache__ > pi@raspi3:~/.local/lib/python3.5/site-packages/usb/backend/__pycache__ > $ ls -l > total 76 > -rwxrwxrwx 1 pi pi 16140 Jan 20 13:31 __init__.cpython-35.pyc > -rwxrwxrwx 1 pi pi 15006 Jan 20 13:31 libusb0.cpython-35.pyc > -rwxrwxrwx 1 pi pi 23713 Jan 20 13:31 libusb1.cpython-35.pyc > -rwxrwxrwx 1 pi pi 18216 Jan 20 13:31 openusb.cpython-35.pyc > pi@raspi3:~/.local/lib/python3.5/site-packages/usb/backend/__pycache__ $ > > still get the same error diagnostic which still ends > usb.core.USBError: [Errno 13] Access denied (insufficient permissions)" > Traceback (most recent call last): > File "/home/pi/usb1.py", line 12, in <module> > dev.set_configuration() > File "/home/pi/.local/lib/python3.5/site-packages/usb/core.py", line > 869, in set_configuration > self._ctx.managed_set_configuration(self, configuration) > File "/home/pi/.local/lib/python3.5/site-packages/usb/core.py", line > 102, in wrapper > return f(self, *args, **kwargs) > File "/home/pi/.local/lib/python3.5/site-packages/usb/core.py", line > 147, in managed_set_configuration > self.managed_open() > File "/home/pi/.local/lib/python3.5/site-packages/usb/core.py", line > 102, in wrapper > return f(self, *args, **kwargs) > File "/home/pi/.local/lib/python3.5/site-packages/usb/core.py", line > 120, in managed_open > self.handle = self.backend.open_device(self.dev) > File > "/home/pi/.local/lib/python3.5/site-packages/usb/backend/libusb1.py", > line 786, in open_device > return _DeviceHandle(dev) > File > "/home/pi/.local/lib/python3.5/site-packages/usb/backend/libusb1.py", > line 643, in __init__ > _check(_lib.libusb_open(self.devid, byref(self.handle))) > File > "/home/pi/.local/lib/python3.5/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) > so basically no change. > > Now the interesting bit. I tried running as root > root@raspi3:/home/pi/PyProj# python3.5 pyusb_1.py > Traceback (most recent call last): > File "pyusb_1.py", line 2, in <module> > import usb.core > ImportError: No module named 'usb' > > same result if I simply sudo python3.5 pyusb_1.py > > when I run python3.5 from the terminal and get the python >>> prompt > there is no trouble with 'import' and checking with 'help(usb)' shows > the module is there and accessible. > > Interesting though is that I have the same problem on all linux, so > whatever I did wrong I did it each time. I have tried installing pyusb > with PIP and sudo apt-get but it makes no difference. > > The further I go with this the darker the tunnel gets. > > Cheers > Charles > > On Sat, 19 Jan 2019 at 09:23, Sergio A. Quiroga > <ser...@gm... <mailto:ser...@gm...>> wrote: > > i saw this message: > > usb.core.USBError: [Errno 13] Access denied (insufficient > permissions) > > > when i was using a wrong driver in Windows 10. I could also see > the whole usb device descriptor, just could not interact with it. > > my suggestion is to try to re install or update the libusb driver > > On Thu, Jan 17, 2019 at 9:01 PM charles wilson > <cmf...@gm... <mailto:cmf...@gm...>> wrote: > > Hi, > I usually manage to solve my problems by hitting my head > against them until I get a breakthrough. This time nothing. > I am new to trying PYUSB. I have the same problem with 2 > installations. > 1) Ubuntu Mate 16.04 on Kernel Linux 4.15.0-43-generic > x86_64running on AMD Ryzen 5 2600X > 2) Raspbian (Jessie) on Raspberry Pi 3B+ > > Also I confirm that libusb-1.0-0 > <https://pkgs.org/download/libusb-1.0-0> is there on both. > > After installation I started the tutorial (why not?) but did > not get far: > > import usb.core > import usb.util > > dev = usb.core.find(idVendor=0x1d6b, idProduct=0x0003) > print(dev) > /OK so far and I get:/ > / > ================== RESTART: /home/wilson/temPY/USBtest01.py > ================== > DEVICE ID 1d6b:0003 on Bus 004 Address 001 ================= > bLength : 0x12 (18 bytes) > bDescriptorType : 0x1 Device > bcdUSB : 0x300 USB 3.0 > bDeviceClass : 0x9 Hub > bDeviceSubClass : 0x0 > bDeviceProtocol : 0x3 > bMaxPacketSize0 : 0x9 (9 bytes) > idVendor : 0x1d6b > idProduct : 0x0003 > bcdDevice : 0x415 Device 4.15 > iManufacturer : 0x3 Error Accessing String > iProduct : 0x2 Error Accessing String > iSerialNumber : 0x1 Error Accessing String > bNumConfigurations : 0x1 > CONFIGURATION 1: 0 mA ==================================== > bLength : 0x9 (9 bytes) > bDescriptorType : 0x2 Configuration > wTotalLength : 0x1f (31 bytes) > bNumInterfaces : 0x1 > bConfigurationValue : 0x1 > iConfiguration : 0x0 > bmAttributes : 0xe0 Self Powered, Remote Wakeup > bMaxPower : 0x0 (0 mA) > INTERFACE 0: Hub ======================================= > bLength : 0x9 (9 bytes) > bDescriptorType : 0x4 Interface > bInterfaceNumber : 0x0 > bAlternateSetting : 0x0 > bNumEndpoints : 0x1 > bInterfaceClass : 0x9 Hub > bInterfaceSubClass : 0x0 > bInterfaceProtocol : 0x0 > iInterface : 0x0 > ENDPOINT 0x81: Interrupt IN ========================== > bLength : 0x7 (7 bytes) > bDescriptorType : 0x5 Endpoint > bEndpointAddress : 0x81 IN > bmAttributes : 0x3 Interrupt > wMaxPacketSize : 0x4 (4 bytes) > bInterval : 0xc > / > / > / > which tells me that pyusb is installed and is finding USB.core > and seems to be working. > When I take the next step in the tutorial: > dev.set_configuration() > > it all turns to custard and I get: > > raceback (most recent call last): > File "/home/wilson/temPY/USBtest01.py", line 11, in <module> > dev.set_configuration() > File "/usr/lib/python3/dist-packages/usb/core.py", line 799, > in set_configuration > self._ctx.managed_set_configuration(self, configuration) > File "/usr/lib/python3/dist-packages/usb/core.py", line 127, > in managed_set_configuration > self.managed_open() > File "/usr/lib/python3/dist-packages/usb/core.py", line 105, > in managed_open > self.handle = self.backend.open_device(self.dev) > File > "/usr/lib/python3/dist-packages/usb/backend/libusb1.py", line > 722, in open_device > return _DeviceHandle(dev) > File > "/usr/lib/python3/dist-packages/usb/backend/libusb1.py", line > 600, in __init__ > _check(_lib.libusb_open(self.devid, byref(self.handle))) > File > "/usr/lib/python3/dist-packages/usb/backend/libusb1.py", line > 552, in _check > raise USBError(_strerror(ret), ret, _libusb_errno[ret]) > usb.core.USBError: [Errno 13] Access denied (insufficient > permissions) > > This on the AMD system, the diagnostic on the Raspi is similar > but not identical. > > I have worked through the other similar postings on the > mailing list - while similar their problems were at a more > complex level --- I am at step 1 with the tutorial ... > I have also worked through the occurrences of > set_configuration() in the ...usb/core.py module and could see > no reason for dev.set_configuration() to bomb-out. > > I have racked my brains and consulted my local gurus with no > joy .... so any help would be appreciated - I have a feeling > it is something dumb that I have missed. > > Cheers > Charles > > > > _______________________________________________ > pyusb-users mailing list > pyu...@li... > <mailto:pyu...@li...> > https://lists.sourceforge.net/lists/listinfo/pyusb-users > > > > -- > SQ > _______________________________________________ > pyusb-users mailing list > pyu...@li... > <mailto:pyu...@li...> > https://lists.sourceforge.net/lists/listinfo/pyusb-users > > > > _______________________________________________ > pyusb-users mailing list > pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users |
From: charles w. <cmf...@gm...> - 2019-01-21 21:32:48
|
Hi Jacques, the type of device makes no difference I have tried with range of devices, keyboard, usb HDD, robotic interface .... all with the same results Cheers Charles On Mon, 21 Jan 2019 at 19:34, Jacques-D. Piguet <jac...@bl...> wrote: > Hi Charles, > > What kind of device are you trying to communicate with? > > Regards, Jacques-D. > > > On 21.01.19 05:23, charles wilson wrote: > > Hi Guys, > Thanks for your time and feedback; it's taken awhile to get back to this. > On permissions, I had checked/changed permissions previously but > re-checked and found a missed one in /python3.5/site-packages/usb/backend- > happened to be libusb1.pywhich was flagged - all fixed now > I had also not checked the /dev/*USB* but did and gave necessary > permissions > > pi@raspi3:~/.local/lib/python3.5/site-packages/usb $ ls -l > total 132 > drwxrwxrwx 3 pi pi 4096 Jan 20 13:31 backend > -rwxrwxrwx 1 pi pi 8739 Jan 20 13:31 control.py > -rwxrwxrwx 1 pi pi 46704 Jan 20 13:31 core.py > -rwxrwxrwx 1 pi pi 3215 Jan 20 13:31 _debug.py > -rwxrwxrwx 1 pi pi 3550 Jan 20 13:31 __init__.py > -rwxrwxrwx 1 pi pi 3522 Jan 20 13:31 _interop.py > -rwxrwxrwx 1 pi pi 12588 Jan 20 13:31 legacy.py > -rwxrwxrwx 1 pi pi 6788 Jan 20 13:31 libloader.py > -rwxrwxrwx 1 pi pi 3259 Jan 20 13:31 _lookup.py > -rwxrwxrwx 1 pi pi 5287 Jan 20 13:31 _objfinalizer.py > drwxrwxrwx 2 pi pi 4096 Jan 20 13:31 __pycache__ > -rwxrwxrwx 1 pi pi 12291 Jan 20 13:31 util.py > > pi@raspi3:~/.local/lib/python3.5/site-packages/usb/backend $ ls -l > total 108 > -rwxrwxrwx 1 pi pi 16048 Jan 20 13:31 __init__.py > -rwxrwxrwx 1 pi pi 23783 Jan 20 13:31 libusb0.py > -rwxrwxrwx 1 pi pi 35299 Jan 20 13:31 libusb1.py > -rwxrwxrwx 1 pi pi 28019 Jan 20 13:31 openusb.py > drwxrwxrwx 2 pi pi 4096 Jan 20 13:31 __pycache__ > pi@raspi3:~/.local/lib/python3.5/site-packages/usb/backend $ cd > __pycache__ > pi@raspi3:~/.local/lib/python3.5/site-packages/usb/backend/__pycache__ $ > ls -l > total 76 > -rwxrwxrwx 1 pi pi 16140 Jan 20 13:31 __init__.cpython-35.pyc > -rwxrwxrwx 1 pi pi 15006 Jan 20 13:31 libusb0.cpython-35.pyc > -rwxrwxrwx 1 pi pi 23713 Jan 20 13:31 libusb1.cpython-35.pyc > -rwxrwxrwx 1 pi pi 18216 Jan 20 13:31 openusb.cpython-35.pyc > pi@raspi3:~/.local/lib/python3.5/site-packages/usb/backend/__pycache__ $ > > still get the same error diagnostic which still ends usb.core.USBError: > [Errno 13] Access denied (insufficient permissions)" > Traceback (most recent call last): > File "/home/pi/usb1.py", line 12, in <module> > dev.set_configuration() > File "/home/pi/.local/lib/python3.5/site-packages/usb/core.py", line > 869, in set_configuration > self._ctx.managed_set_configuration(self, configuration) > File "/home/pi/.local/lib/python3.5/site-packages/usb/core.py", line > 102, in wrapper > return f(self, *args, **kwargs) > File "/home/pi/.local/lib/python3.5/site-packages/usb/core.py", line > 147, in managed_set_configuration > self.managed_open() > File "/home/pi/.local/lib/python3.5/site-packages/usb/core.py", line > 102, in wrapper > return f(self, *args, **kwargs) > File "/home/pi/.local/lib/python3.5/site-packages/usb/core.py", line > 120, in managed_open > self.handle = self.backend.open_device(self.dev) > File > "/home/pi/.local/lib/python3.5/site-packages/usb/backend/libusb1.py", line > 786, in open_device > return _DeviceHandle(dev) > File > "/home/pi/.local/lib/python3.5/site-packages/usb/backend/libusb1.py", line > 643, in __init__ > _check(_lib.libusb_open(self.devid, byref(self.handle))) > File > "/home/pi/.local/lib/python3.5/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) > > so basically no change. > > Now the interesting bit. I tried running as root > root@raspi3:/home/pi/PyProj# python3.5 pyusb_1.py > Traceback (most recent call last): > File "pyusb_1.py", line 2, in <module> > import usb.core > ImportError: No module named 'usb' > > same result if I simply sudo python3.5 pyusb_1.py > > when I run python3.5 from the terminal and get the python >>> prompt there > is no trouble with 'import' and checking with 'help(usb)' shows the module > is there and accessible. > > Interesting though is that I have the same problem on all linux, so > whatever I did wrong I did it each time. I have tried installing pyusb with > PIP and sudo apt-get but it makes no difference. > > The further I go with this the darker the tunnel gets. > > Cheers > Charles > > On Sat, 19 Jan 2019 at 09:23, Sergio A. Quiroga <ser...@gm...> > wrote: > >> i saw this message: >> >> usb.core.USBError: [Errno 13] Access denied (insufficient permissions) >> >> >> when i was using a wrong driver in Windows 10. I could also see the whole >> usb device descriptor, just could not interact with it. >> >> my suggestion is to try to re install or update the libusb driver >> >> On Thu, Jan 17, 2019 at 9:01 PM charles wilson <cmf...@gm...> >> wrote: >> >>> Hi, >>> I usually manage to solve my problems by hitting my head against them >>> until I get a breakthrough. This time nothing. >>> I am new to trying PYUSB. I have the same problem with 2 installations. >>> 1) Ubuntu Mate 16.04 on Kernel Linux 4.15.0-43-generic x86_64running on >>> AMD Ryzen 5 2600X >>> 2) Raspbian (Jessie) on Raspberry Pi 3B+ >>> >>> Also I confirm that libusb-1.0-0 >>> <https://pkgs.org/download/libusb-1.0-0> is there on both. >>> >>> After installation I started the tutorial (why not?) but did not get far: >>> >>> import usb.core >>> import usb.util >>> >>> dev = usb.core.find(idVendor=0x1d6b, idProduct=0x0003) >>> print(dev) >>> *OK so far and I get:* >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> * ================== RESTART: /home/wilson/temPY/USBtest01.py >>> ================== DEVICE ID 1d6b:0003 on Bus 004 Address 001 >>> ================= bLength : 0x12 (18 bytes) >>> bDescriptorType : 0x1 Device bcdUSB : 0x300 >>> USB 3.0 bDeviceClass : 0x9 Hub bDeviceSubClass : >>> 0x0 bDeviceProtocol : 0x3 bMaxPacketSize0 : 0x9 (9 >>> bytes) idVendor : 0x1d6b idProduct : 0x0003 >>> bcdDevice : 0x415 Device 4.15 iManufacturer : >>> 0x3 Error Accessing String iProduct : 0x2 Error Accessing >>> String iSerialNumber : 0x1 Error Accessing String >>> bNumConfigurations : 0x1 CONFIGURATION 1: 0 mA >>> ==================================== bLength : 0x9 (9 >>> bytes) bDescriptorType : 0x2 Configuration >>> wTotalLength : 0x1f (31 bytes) bNumInterfaces : 0x1 >>> bConfigurationValue : 0x1 iConfiguration : 0x0 >>> bmAttributes : 0xe0 Self Powered, Remote Wakeup >>> bMaxPower : 0x0 (0 mA) INTERFACE 0: Hub >>> ======================================= bLength : 0x9 (9 >>> bytes) bDescriptorType : 0x4 Interface bInterfaceNumber >>> : 0x0 bAlternateSetting : 0x0 bNumEndpoints : 0x1 >>> bInterfaceClass : 0x9 Hub bInterfaceSubClass : 0x0 >>> bInterfaceProtocol : 0x0 iInterface : 0x0 ENDPOINT >>> 0x81: Interrupt IN ========================== bLength : >>> 0x7 (7 bytes) bDescriptorType : 0x5 Endpoint >>> bEndpointAddress : 0x81 IN bmAttributes : 0x3 Interrupt >>> wMaxPacketSize : 0x4 (4 bytes) bInterval : 0xc >>> * >>> >>> which tells me that pyusb is installed and is finding USB.core and seems >>> to be working. >>> When I take the next step in the tutorial: >>> dev.set_configuration() >>> >>> it all turns to custard and I get: >>> >>> raceback (most recent call last): >>> File "/home/wilson/temPY/USBtest01.py", line 11, in <module> >>> dev.set_configuration() >>> File "/usr/lib/python3/dist-packages/usb/core.py", line 799, in >>> set_configuration >>> self._ctx.managed_set_configuration(self, configuration) >>> File "/usr/lib/python3/dist-packages/usb/core.py", line 127, in >>> managed_set_configuration >>> self.managed_open() >>> File "/usr/lib/python3/dist-packages/usb/core.py", line 105, in >>> managed_open >>> self.handle = self.backend.open_device(self.dev) >>> File "/usr/lib/python3/dist-packages/usb/backend/libusb1.py", line >>> 722, in open_device >>> return _DeviceHandle(dev) >>> File "/usr/lib/python3/dist-packages/usb/backend/libusb1.py", line >>> 600, in __init__ >>> _check(_lib.libusb_open(self.devid, byref(self.handle))) >>> File "/usr/lib/python3/dist-packages/usb/backend/libusb1.py", line >>> 552, in _check >>> raise USBError(_strerror(ret), ret, _libusb_errno[ret]) >>> usb.core.USBError: [Errno 13] Access denied (insufficient permissions) >>> >>> This on the AMD system, the diagnostic on the Raspi is similar but not >>> identical. >>> >>> I have worked through the other similar postings on the mailing list - >>> while similar their problems were at a more complex level --- I am at step >>> 1 with the tutorial ... >>> I have also worked through the occurrences of set_configuration() in the >>> ...usb/core.py module and could see no reason for dev.set_configuration() >>> to bomb-out. >>> >>> I have racked my brains and consulted my local gurus with no joy .... so >>> any help would be appreciated - I have a feeling it is something dumb that >>> I have missed. >>> >>> Cheers >>> Charles >>> >>> >>> >>> _______________________________________________ >>> pyusb-users mailing list >>> pyu...@li... >>> https://lists.sourceforge.net/lists/listinfo/pyusb-users >>> >> >> >> -- >> SQ >> _______________________________________________ >> pyusb-users mailing list >> pyu...@li... >> https://lists.sourceforge.net/lists/listinfo/pyusb-users >> > > > _______________________________________________ > pyusb-users mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/pyusb-users > > > _______________________________________________ > pyusb-users mailing list > pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users > |
From: Jeffrey N. <jsn...@su...> - 2019-01-21 22:21:53
|
Looks to me like a device permission issue. I suspect that chmod on /dev/usb won't do what you want. Some distros have a usb group that you can add your user to. I usually end up setting up a udev rule, though. My best guess on the root/sudo thing is your user's site-packages aren't being read while running as root, so it doesn't think you have pyusb installed at all. Could run pip as root to install pyusb. Best, Jeff On 1/21/2019 4:28 PM, charles wilson wrote: > Hi Jacques, the type of device makes no difference I have tried with > range of devices, keyboard, usb HDD, robotic interface .... all with > the same results > > Cheers > Charles > > On Mon, 21 Jan 2019 at 19:34, Jacques-D. Piguet > <jac...@bl... <mailto:jac...@bl...>> wrote: > > Hi Charles, > > What kind of device are you trying to communicate with? > > Regards, Jacques-D. > > > On 21.01.19 05:23, charles wilson wrote: >> Hi Guys, >> Thanks for your time and feedback; it's taken awhile to get back >> to this. >> On permissions, I had checked/changed permissions previously but >> re-checked and found a missed one in >> /python3.5/site-packages/usb/backend- happened to be >> libusb1.pywhich was flagged - all fixed now >> I had also not checked the /dev/*USB* but did and gave necessary >> permissions >> >> pi@raspi3:~/.local/lib/python3.5/site-packages/usb >> <mailto:pi@raspi3:~/.local/lib/python3.5/site-packages/usb> $ ls -l >> total 132 >> drwxrwxrwx 3 pi pi 4096 Jan 20 13:31 backend >> -rwxrwxrwx 1 pi pi 8739 Jan 20 13:31 control.py >> -rwxrwxrwx 1 pi pi 46704 Jan 20 13:31 core.py >> -rwxrwxrwx 1 pi pi 3215 Jan 20 13:31 _debug.py >> -rwxrwxrwx 1 pi pi 3550 Jan 20 13:31 __init__.py >> -rwxrwxrwx 1 pi pi 3522 Jan 20 13:31 _interop.py >> -rwxrwxrwx 1 pi pi 12588 Jan 20 13:31 legacy.py >> -rwxrwxrwx 1 pi pi 6788 Jan 20 13:31 libloader.py >> -rwxrwxrwx 1 pi pi 3259 Jan 20 13:31 _lookup.py >> -rwxrwxrwx 1 pi pi 5287 Jan 20 13:31 _objfinalizer.py >> drwxrwxrwx 2 pi pi 4096 Jan 20 13:31 __pycache__ >> -rwxrwxrwx 1 pi pi 12291 Jan 20 13:31 util.py >> >> pi@raspi3:~/.local/lib/python3.5/site-packages/usb/backend >> <mailto:pi@raspi3:~/.local/lib/python3.5/site-packages/usb/backend> >> $ ls -l >> total 108 >> -rwxrwxrwx 1 pi pi 16048 Jan 20 13:31 __init__.py >> -rwxrwxrwx 1 pi pi 23783 Jan 20 13:31 libusb0.py >> -rwxrwxrwx 1 pi pi 35299 Jan 20 13:31 libusb1.py >> -rwxrwxrwx 1 pi pi 28019 Jan 20 13:31 openusb.py >> drwxrwxrwx 2 pi pi 4096 Jan 20 13:31 __pycache__ >> pi@raspi3:~/.local/lib/python3.5/site-packages/usb/backend >> <mailto:pi@raspi3:~/.local/lib/python3.5/site-packages/usb/backend> >> $ cd __pycache__ >> pi@raspi3:~/.local/lib/python3.5/site-packages/usb/backend/__pycache__ >> <mailto:pi@raspi3:~/.local/lib/python3.5/site-packages/usb/backend/__pycache__> >> $ ls -l >> total 76 >> -rwxrwxrwx 1 pi pi 16140 Jan 20 13:31 __init__.cpython-35.pyc >> -rwxrwxrwx 1 pi pi 15006 Jan 20 13:31 libusb0.cpython-35.pyc >> -rwxrwxrwx 1 pi pi 23713 Jan 20 13:31 libusb1.cpython-35.pyc >> -rwxrwxrwx 1 pi pi 18216 Jan 20 13:31 openusb.cpython-35.pyc >> pi@raspi3:~/.local/lib/python3.5/site-packages/usb/backend/__pycache__ >> <mailto:pi@raspi3:~/.local/lib/python3.5/site-packages/usb/backend/__pycache__> >> $ >> >> still get the same error diagnostic which still ends >> usb.core.USBError: [Errno 13] Access denied (insufficient >> permissions)" >> Traceback (most recent call last): >> File "/home/pi/usb1.py", line 12, in <module> >> dev.set_configuration() >> File "/home/pi/.local/lib/python3.5/site-packages/usb/core.py", >> line 869, in set_configuration >> self._ctx.managed_set_configuration(self, configuration) >> File "/home/pi/.local/lib/python3.5/site-packages/usb/core.py", >> line 102, in wrapper >> return f(self, *args, **kwargs) >> File "/home/pi/.local/lib/python3.5/site-packages/usb/core.py", >> line 147, in managed_set_configuration >> self.managed_open() >> File "/home/pi/.local/lib/python3.5/site-packages/usb/core.py", >> line 102, in wrapper >> return f(self, *args, **kwargs) >> File "/home/pi/.local/lib/python3.5/site-packages/usb/core.py", >> line 120, in managed_open >> self.handle = self.backend.open_device(self.dev) >> File >> "/home/pi/.local/lib/python3.5/site-packages/usb/backend/libusb1.py", >> line 786, in open_device >> return _DeviceHandle(dev) >> File >> "/home/pi/.local/lib/python3.5/site-packages/usb/backend/libusb1.py", >> line 643, in __init__ >> _check(_lib.libusb_open(self.devid, byref(self.handle))) >> File >> "/home/pi/.local/lib/python3.5/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) >> so basically no change. >> >> Now the interesting bit. I tried running as root >> root@raspi3:/home/pi/PyProj# python3.5 pyusb_1.py >> Traceback (most recent call last): >> File "pyusb_1.py", line 2, in <module> >> import usb.core >> ImportError: No module named 'usb' >> >> same result if I simply sudo python3.5 pyusb_1.py >> >> when I run python3.5 from the terminal and get the python >>> >> prompt there is no trouble with 'import' and checking with >> 'help(usb)' shows the module is there and accessible. >> >> Interesting though is that I have the same problem on all linux, >> so whatever I did wrong I did it each time. I have tried >> installing pyusb with PIP and sudo apt-get but it makes no >> difference. >> >> The further I go with this the darker the tunnel gets. >> >> Cheers >> Charles >> >> On Sat, 19 Jan 2019 at 09:23, Sergio A. Quiroga >> <ser...@gm... <mailto:ser...@gm...>> wrote: >> >> i saw this message: >> >> usb.core.USBError: [Errno 13] Access denied (insufficient >> permissions) >> >> >> when i was using a wrong driver in Windows 10. I could also >> see the whole usb device descriptor, just could not interact >> with it. >> >> my suggestion is to try to re install or update the libusb driver >> >> On Thu, Jan 17, 2019 at 9:01 PM charles wilson >> <cmf...@gm... <mailto:cmf...@gm...>> wrote: >> >> Hi, >> I usually manage to solve my problems by hitting my head >> against them until I get a breakthrough. This time nothing. >> I am new to trying PYUSB. I have the same problem with 2 >> installations. >> 1) Ubuntu Mate 16.04 on Kernel Linux 4.15.0-43-generic >> x86_64running on AMD Ryzen 5 2600X >> 2) Raspbian (Jessie) on Raspberry Pi 3B+ >> >> Also I confirm that libusb-1.0-0 >> <https://pkgs.org/download/libusb-1.0-0> is there on both. >> >> After installation I started the tutorial (why not?) but >> did not get far: >> >> import usb.core >> import usb.util >> >> dev = usb.core.find(idVendor=0x1d6b, idProduct=0x0003) >> print(dev) >> /OK so far and I get:/ >> / >> ================== RESTART: >> /home/wilson/temPY/USBtest01.py ================== >> DEVICE ID 1d6b:0003 on Bus 004 Address 001 ================= >> bLength : 0x12 (18 bytes) >> bDescriptorType : 0x1 Device >> bcdUSB : 0x300 USB 3.0 >> bDeviceClass : 0x9 Hub >> bDeviceSubClass : 0x0 >> bDeviceProtocol : 0x3 >> bMaxPacketSize0 : 0x9 (9 bytes) >> idVendor : 0x1d6b >> idProduct : 0x0003 >> bcdDevice : 0x415 Device 4.15 >> iManufacturer : 0x3 Error Accessing String >> iProduct : 0x2 Error Accessing String >> iSerialNumber : 0x1 Error Accessing String >> bNumConfigurations : 0x1 >> CONFIGURATION 1: 0 mA ==================================== >> bLength : 0x9 (9 bytes) >> bDescriptorType : 0x2 Configuration >> wTotalLength : 0x1f (31 bytes) >> bNumInterfaces : 0x1 >> bConfigurationValue : 0x1 >> iConfiguration : 0x0 >> bmAttributes : 0xe0 Self Powered, Remote Wakeup >> bMaxPower : 0x0 (0 mA) >> INTERFACE 0: Hub ======================================= >> bLength : 0x9 (9 bytes) >> bDescriptorType : 0x4 Interface >> bInterfaceNumber : 0x0 >> bAlternateSetting : 0x0 >> bNumEndpoints : 0x1 >> bInterfaceClass : 0x9 Hub >> bInterfaceSubClass : 0x0 >> bInterfaceProtocol : 0x0 >> iInterface : 0x0 >> ENDPOINT 0x81: Interrupt IN ========================== >> bLength : 0x7 (7 bytes) >> bDescriptorType : 0x5 Endpoint >> bEndpointAddress : 0x81 IN >> bmAttributes : 0x3 Interrupt >> wMaxPacketSize : 0x4 (4 bytes) >> bInterval : 0xc >> / >> / >> / >> which tells me that pyusb is installed and is finding >> USB.core and seems to be working. >> When I take the next step in the tutorial: >> dev.set_configuration() >> >> it all turns to custard and I get: >> >> raceback (most recent call last): >> File "/home/wilson/temPY/USBtest01.py", line 11, in >> <module> >> dev.set_configuration() >> File "/usr/lib/python3/dist-packages/usb/core.py", line >> 799, in set_configuration >> self._ctx.managed_set_configuration(self, configuration) >> File "/usr/lib/python3/dist-packages/usb/core.py", line >> 127, in managed_set_configuration >> self.managed_open() >> File "/usr/lib/python3/dist-packages/usb/core.py", line >> 105, in managed_open >> self.handle = self.backend.open_device(self.dev) >> File >> "/usr/lib/python3/dist-packages/usb/backend/libusb1.py", >> line 722, in open_device >> return _DeviceHandle(dev) >> File >> "/usr/lib/python3/dist-packages/usb/backend/libusb1.py", >> line 600, in __init__ >> _check(_lib.libusb_open(self.devid, byref(self.handle))) >> File >> "/usr/lib/python3/dist-packages/usb/backend/libusb1.py", >> line 552, in _check >> raise USBError(_strerror(ret), ret, _libusb_errno[ret]) >> usb.core.USBError: [Errno 13] Access denied (insufficient >> permissions) >> >> This on the AMD system, the diagnostic on the Raspi is >> similar but not identical. >> >> I have worked through the other similar postings on the >> mailing list - while similar their problems were at a >> more complex level --- I am at step 1 with the tutorial ... >> I have also worked through the occurrences of >> set_configuration() in the ...usb/core.py module and >> could see no reason for dev.set_configuration() to bomb-out. >> >> I have racked my brains and consulted my local gurus with >> no joy .... so any help would be appreciated - I have a >> feeling it is something dumb that I have missed. >> >> Cheers >> Charles >> >> >> >> _______________________________________________ >> pyusb-users mailing list >> pyu...@li... >> <mailto:pyu...@li...> >> https://lists.sourceforge.net/lists/listinfo/pyusb-users >> >> >> >> -- >> SQ >> _______________________________________________ >> pyusb-users mailing list >> pyu...@li... >> <mailto:pyu...@li...> >> https://lists.sourceforge.net/lists/listinfo/pyusb-users >> >> >> >> >> _______________________________________________ pyusb-users >> mailing list pyu...@li... >> <mailto:pyu...@li...> >> https://lists.sourceforge.net/lists/listinfo/pyusb-users > > _______________________________________________ > pyusb-users mailing list > pyu...@li... > <mailto:pyu...@li...> > https://lists.sourceforge.net/lists/listinfo/pyusb-users > > > > > _______________________________________________ pyusb-users mailing > list pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users |
From: Tormod V. <lis...@gm...> - 2019-01-21 22:16:29
|
On Mon, Jan 21, 2019 at 5:28 AM charles wilson wrote: > On permissions, I had checked/changed permissions previously but re-checked and found a missed one in /python3.5/site-packages/usb/backend- happened to be libusb1.pywhich was flagged - all fixed now > I had also not checked the /dev/*USB* but did and gave necessary permissions > drwxrwxrwx 3 pi pi 4096 Jan 20 13:31 backend > -rwxrwxrwx 1 pi pi 8739 Jan 20 13:31 control.py > still get the same error diagnostic which still ends usb.core.USBError: [Errno 13] Access denied (insufficient permissions)" > so basically no change. Charles, The permission issue is with the USB device node under /dev/bus/usb/*/* and not the python library files. It looks like you have messed up all library files permissions now - they need not and should not be writeable for everybody. You'd better reinstall the packages to tidy up. > > Now the interesting bit. I tried running as root > root@raspi3:/home/pi/PyProj# python3.5 pyusb_1.py > Traceback (most recent call last): > File "pyusb_1.py", line 2, in <module> > import usb.core > ImportError: No module named 'usb' > > same result if I simply sudo python3.5 pyusb_1.py > > when I run python3.5 from the terminal and get the python >>> prompt there is no trouble with 'import' and checking with 'help(usb)' shows the module is there and accessible. > > Interesting though is that I have the same problem on all linux, so whatever I did wrong I did it each time. I have tried installing pyusb with PIP and sudo apt-get but it makes no difference. Note that your Raspberry Pi has both python 2 and python 3 installed. The Debian package "python-usb" is for Python 2 and the package "python3-usb" is for Python 3. Regards, Tormod |
From: charles w. <cmf...@gm...> - 2019-01-21 23:11:06
|
Hi Tormod & others Looks we are the same page ... yes I will tidy up permissions later ... and the issue relates to the python version. I downloaded pyusb not python-usb"or "python3-usb. But I am winning!!!!! yes although still need help. My process has been as follows (bear in mind I have the same problem with my raspbian & ubuntu 16.04 systems - I am working on the Raspberry Pi because it is way easier to reinstall the OS than on my desktop :) Script: 1 2 import usb.core 3 import usb.util 4 help()usb) 5 dev = usb.core.find() 6 print(dev) 7 8 dev.set_configuration() lines 4,5 and 6 execute fine = I get the expected outcome Diagnostic: AS it only the last line that really matters: File "/home/pi/.local/lib/python3.5/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) Check permissions: pi@raspi3:~/.local/lib/python3.5/site-packages/usb/backend $ ls -l total 108 ... the relevant one is: -rwxrwxrwx 1 pi pi 35299 Jan 20 13:31 libusb1.py ... so anyone can execute ???? ... so if I run libusb1.py in idle I get: File "/home/pi/.local/lib/python3.5/site-packages/usb/backend/libusb1.py", line 702, in <module> class _LibUSB(usb.backend.IBackend): AttributeError: module 'usb' has no attribute 'backend' ... so it looks like the permission problem = no backend ... but if I root@raspi3:/home/pi/.local/lib/python3.5/site-packages/usb/backend# python3.5 libusb1.py Traceback (most recent call last): File "libusb1.py", line 30, in <module> import usb.util ImportError: No module named 'usb' in module libusb1.py: 29 from ctypes import * 30 import usb.util so it seems the permission that is failing is the ability of backend to import usb.util which my script does not seem to have a problem with. Now checking ctypes there are three copies at: i) /usr/lib/python2.7/ctypes ii) /usr/lib/pypy/lib-python/2.7/ctypes iii) /usr/lib/python3.5/ctypes permissions on the above are all ok ... now it gets interesting ... if I run (in idle) the script copied from libusb1.py: from ctypes import * import usb.util .... and add help(usb.util) I get expected 'help' output. so there is a difference. BUT .. idle is python3.5 and pyusb is only installed in python3.5 ... which usb.util does libsub1.py call? Am I on the right track here? I have now installed pyusb via pip to python2.7 ... my script now runs iin terminal as user!!! looks like a win! checking with ~$ python --version it seems the system defaults to 2.7 I have installed pyusb to 2.7 ... and checked it is there permissions are ok plus IDLE for 2.7 Now I need more help. While I can run the script from the terminal I can't from my IDEs I still get File "/home/pi/.local/lib/python2.7/site-packages/usb/backend/libusb1.py", line 595, in _check raise USBError(_strerror(ret), ret, _libusb_errno[ret]) USBError: [Errno 13] Access denied (insufficient permissions) which I would understand if it is run from 3.5,but this is from 2.7???? cheers Charles On Tue, 22 Jan 2019 at 11:16, Tormod Volden <lis...@gm...> wrote: > On Mon, Jan 21, 2019 at 5:28 AM charles wilson wrote: > > On permissions, I had checked/changed permissions previously but > re-checked and found a missed one in /python3.5/site-packages/usb/backend- > happened to be libusb1.pywhich was flagged - all fixed now > > > I had also not checked the /dev/*USB* but did and gave necessary > permissions > > > drwxrwxrwx 3 pi pi 4096 Jan 20 13:31 backend > > -rwxrwxrwx 1 pi pi 8739 Jan 20 13:31 control.py > > still get the same error diagnostic which still ends usb.core.USBError: > [Errno 13] Access denied (insufficient permissions)" > > > so basically no change. > > Charles, > > The permission issue is with the USB device node under > /dev/bus/usb/*/* and not the python library files. It looks like you > have messed up all library files permissions now - they need not and > should not be writeable for everybody. You'd better reinstall the > packages to tidy up. > > > > > Now the interesting bit. I tried running as root > > root@raspi3:/home/pi/PyProj# python3.5 pyusb_1.py > > Traceback (most recent call last): > > File "pyusb_1.py", line 2, in <module> > > import usb.core > > ImportError: No module named 'usb' > > > > same result if I simply sudo python3.5 pyusb_1.py > > > > when I run python3.5 from the terminal and get the python >>> prompt > there is no trouble with 'import' and checking with 'help(usb)' shows the > module is there and accessible. > > > > Interesting though is that I have the same problem on all linux, so > whatever I did wrong I did it each time. I have tried installing pyusb with > PIP and sudo apt-get but it makes no difference. > > Note that your Raspberry Pi has both python 2 and python 3 installed. > The Debian package "python-usb" is for Python 2 and the package > "python3-usb" is for Python 3. > > Regards, > Tormod > > > _______________________________________________ > pyusb-users mailing list > pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users > |
From: Tormod V. <lis...@gm...> - 2019-01-22 00:14:34
|
On Tue, Jan 22, 2019 at 12:11 AM charles wilson wrote: > Looks we are the same page ... yes I will tidy up permissions later ... and the issue relates to the python version. I downloaded pyusb not python-usb"or "python3-usb. > Unless you know exactly what you are doing, or really need a newer version than what your Debian distribution offers, I would heartily recommended that you as much as possible only install the Debian packages from the system repository, "python-usb" and "python3-usb". These are not "pip" module names! Then remove the modules that you installed with pip (pyusb). The mix of system-provided modules and pip-installed modules can quickly get out of control. The Debian packaging system is much more robust than pip, whereas the pip packages can be much more up to date (and thus unstable). Tormod |
From: charles w. <cmf...@gm...> - 2019-01-22 22:19:09
|
ok, I took on board your comment about install python3-usb which includes pyusb. I reinstalled the raspbian OS and installed python3-usb ... it puts the files in quite different places, but the same files. Issue 1) again a number of files (e.g. 'usr/lib/python3.5/dist-packages/usb/backend/libusb1.py = the 'insufficient permissions' problem installed with permission "Execute = Nobody" .... again this did not seem right so I changed it and the other permissions Issue 2) same error, just a different file location File "/usr/lib/python3/dist-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) I can't see what I have done wrong in repeated installations and attempts to fix on different OS and hardware. BTW Tormod & Jeffery I had not ignored your comments re /dev/bus/usb/*/* but there was little in there and I fixed the permissions with no change. With the re-install the files again loaded with 'execute = nobody' & I changed that. This time there was a change when running the script File "/usr/lib/python3/dist-packages/usb/backend/libusb1.py", line 595, in _check raise USBError(_strerror(ret), ret, _libusb_errno[ret]) usb.core.USBError: [Errno 16] Resource busy which is an error beyond my experience also BTW I installed python2.7-usb after I had no joy with v3 .... same result Cheers Charles On Tue, 22 Jan 2019 at 13:14, Tormod Volden <lis...@gm...> wrote: > On Tue, Jan 22, 2019 at 12:11 AM charles wilson wrote: > > Looks we are the same page ... yes I will tidy up permissions later ... > and the issue relates to the python version. I downloaded pyusb not > python-usb"or "python3-usb. > > > > Unless you know exactly what you are doing, or really need a newer > version than what your Debian distribution offers, I would heartily > recommended that you as much as possible only install the Debian > packages from the system repository, "python-usb" and "python3-usb". > These are not "pip" module names! Then remove the modules that you > installed with pip (pyusb). > > The mix of system-provided modules and pip-installed modules can > quickly get out of control. The Debian packaging system is much more > robust than pip, whereas the pip packages can be much more up to date > (and thus unstable). > > Tormod > > > _______________________________________________ > pyusb-users mailing list > pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users > |
From: Jeffrey N. <jsn...@su...> - 2019-01-22 23:00:56
|
Isuue 1: This is normal for python scripts. You can easily uninstall and reinstall the package to revert your changes. Issue 2: The permission errors have nothing to with the script or library permissions, only the USB device. You cannot fix the /dev/ permissions through chmod, so don't try. With pyusb properly installed, you should be able to run via sudo and have everything work. This will prove that everything is working, then you just need to figure out how to grant your user USB device access. The usual way is to add the user to the 'usb' group, but I've had a lot of success with targeted udev rules for specific devices. Best, Jeff On 1/22/2019 5:15 PM, charles wilson wrote: > ok, I took on board your comment about install python3-usb which > includes pyusb. > I reinstalled the raspbian OS and installed python3-usb ... it puts > the files in quite different places, but the same files. > > Issue 1) again a number of files (e.g. > 'usr/lib/python3.5/dist-packages/usb/backend/libusb1.py = the > 'insufficient permissions' problem installed with permission "Execute > = Nobody" .... again this did not seem right so I changed it and the > other permissions > > Issue 2) same error, just a different file location > File "/usr/lib/python3/dist-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) > > I can't see what I have done wrong in repeated installations and > attempts to fix on different OS and hardware. > > BTW Tormod & Jeffery I had not ignored your comments re > /dev/bus/usb/*/* but there was little in there and I fixed the > permissions with no change. > With the re-install the files again loaded with 'execute = nobody' & I > changed that. > This time there was a change when running the script > > File "/usr/lib/python3/dist-packages/usb/backend/libusb1.py", line > 595, in _check > raise USBError(_strerror(ret), ret, _libusb_errno[ret]) > usb.core.USBError: [Errno 16] Resource busy > > which is an error beyond my experience > > also BTW I installed python2.7-usb after I had no joy with v3 .... > same result > > Cheers > Charles > > > On Tue, 22 Jan 2019 at 13:14, Tormod Volden <lis...@gm... > <mailto:lis...@gm...>> wrote: > > On Tue, Jan 22, 2019 at 12:11 AM charles wilson wrote: > > Looks we are the same page ... yes I will tidy up permissions > later ... and the issue relates to the python version. I > downloaded pyusb not python-usb"or "python3-usb. > > > > Unless you know exactly what you are doing, or really need a newer > version than what your Debian distribution offers, I would heartily > recommended that you as much as possible only install the Debian > packages from the system repository, "python-usb" and "python3-usb". > These are not "pip" module names! Then remove the modules that you > installed with pip (pyusb). > > The mix of system-provided modules and pip-installed modules can > quickly get out of control. The Debian packaging system is much more > robust than pip, whereas the pip packages can be much more up to date > (and thus unstable). > > Tormod > > > _______________________________________________ > pyusb-users mailing list > pyu...@li... > <mailto:pyu...@li...> > https://lists.sourceforge.net/lists/listinfo/pyusb-users > > > > _______________________________________________ > pyusb-users mailing list > pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users |
From: Tormod V. <lis...@gm...> - 2019-01-22 23:58:04
|
On Wed, Jan 23, 2019 at 12:01 AM Jeffrey Nichols wrote: > > Isuue 1: This is normal for python scripts. You can easily uninstall and > reinstall the package to revert your changes. Just to add to what Jeff wrote: The library files can be -rw-r--r-- which means they are writeable for owner (root in this case), and readable for everybody. They don't need any executable bit. They are very likely correct in the Debian package. > Issue 2: The permission errors have nothing to with the script or > library permissions, only the USB device. You cannot fix the /dev/ > permissions through chmod, so don't try. > > With pyusb properly installed, you should be able to run via sudo and > have everything work. This will prove that everything is working, then > you just need to figure out how to grant your user USB device access. > The usual way is to add the user to the 'usb' group, but I've had a lot > of success with targeted udev rules for specific devices. In general, use lsusb to list your devices, and identify the vendor and product IDs (4+4 hex digits, like 1a2b:3c4e). Then make a rule like this (filename must end in .rules), replacing 1a2b and 3c4e with your device IDs: # Example udev rules (usually placed in /etc/udev/rules.d) # Makes USB device writeable for the "plugdev" group and the console user ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="1a2b", ATTRS{idProduct}=="3c4e", MODE="664", GROUP="plugdev", TAG+="uaccess" If your system doesn't have a "plugdev" group you can remove the GROUP="plugdev" element. All modern distros will work fine with just the uaccess tag. The mode 644 will make the device node under /dev/bus/usb/*/* be -rw-r--r--. However, only now did I take a closer look at the USB descriptor dump in your original e-mail: You are trying to access a USB hub. The hub is already claimed by the operating system, the USB drivers in the kernel. It is the same for USB keyboards, USB drives etc. It is normal that you get permission problems or busy errors. There are ways to release a device from the kernel but that is probably not what you want to do. Only for devices without any kernel driver you can expect to be able get access using libusb and pyusb. Tormod > On 1/22/2019 5:15 PM, charles wilson wrote: > > ok, I took on board your comment about install python3-usb which > > includes pyusb. > > I reinstalled the raspbian OS and installed python3-usb ... it puts > > the files in quite different places, but the same files. > > > > Issue 1) again a number of files (e.g. > > 'usr/lib/python3.5/dist-packages/usb/backend/libusb1.py = the > > 'insufficient permissions' problem installed with permission "Execute > > = Nobody" .... again this did not seem right so I changed it and the > > other permissions > > > > Issue 2) same error, just a different file location > > File "/usr/lib/python3/dist-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) > > > > I can't see what I have done wrong in repeated installations and > > attempts to fix on different OS and hardware. > > > > BTW Tormod & Jeffery I had not ignored your comments re > > /dev/bus/usb/*/* but there was little in there and I fixed the > > permissions with no change. > > With the re-install the files again loaded with 'execute = nobody' & I > > changed that. > > This time there was a change when running the script > > > > File "/usr/lib/python3/dist-packages/usb/backend/libusb1.py", line > > 595, in _check > > raise USBError(_strerror(ret), ret, _libusb_errno[ret]) > > usb.core.USBError: [Errno 16] Resource busy > > > > which is an error beyond my experience > > > > also BTW I installed python2.7-usb after I had no joy with v3 .... > > same result |