Re: [pyusb-users] dev.set_configuration() not executing

2019-01-22 Thread Jeffrey Nichols
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 > 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
pyusb-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/pyusb-users



___
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users




___
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users


Re: [pyusb-users] dev.set_configuration() not executing

2019-01-22 Thread charles wilson
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  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
> pyusb-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pyusb-users
>
___
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users


Re: [pyusb-users] dev.set_configuration() not executing

2019-01-21 Thread Tormod Volden
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
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users


Re: [pyusb-users] dev.set_configuration() not executing

2019-01-21 Thread charles wilson
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 
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 
> 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 
> 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 
> 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 
>> wrote:
>>

Re: [pyusb-users] dev.set_configuration() not executing

2019-01-20 Thread Jacques-D. Piguet

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 
    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 
    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 
mailto:sergioa.quir...@gmail.com>> 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
mailto:cmf.wil...@gmail.com>> 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 

Re: [pyusb-users] dev.set_configuration() not executing

2019-01-18 Thread Sergio A. Quiroga
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  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   :0x0bmAttributes :   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 
> 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
> pyusb-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pyusb-users
>


-- 
SQ
___
pyusb-users mailing list

[pyusb-users] dev.set_configuration() not executing

2019-01-17 Thread charles wilson
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   :0x0bmAttributes :   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 
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
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users