On 20 August 2016 at 21:53, Tormod Volden <lists.tor...@gmail.com> wrote:
> On Sat, Aug 20, 2016 at 3:46 PM, Steven Michalske wrote:
>> Here is a general answer for Linux.
>> http://unix.stackexchange.com/questions/44308/understanding-udev-rules-and-permissions-in-libusb
>
> IMHO that link doesn't have the greatest answer (or question).
> Probably the asking user failed to use group permission because he
> didn't log out and in again after adding the user to the groups. I
> think group permissions are superior to just letting any user (or
> process) full access to the device. I'd recommend something like this:
>
> # Example udev rules (usually placed in /etc/udev/rules.d)
> # Makes given device writeable for the "plugdev" group
> ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0483",
> ATTRS{idProduct}=="df11", MODE="664", GROUP="plugdev"
>
>>> On Aug 20, 2016, at 07:46, Jay Aurabind  wrote:
>>> I am a user of pyOCD, and I am having an issue related to pyusb which
>>> is what the former uses for talking to the USB device. The situation
>>> is that I need to use pyOCD through an eclipse plugin. Eclipse
>>> launches pyocd-gdbserver and normal user. But it will only work if
>>> launched as root.
>
>>> ValueError: The device has no langid
>
> The missing langid here looks like https://github.com/walac/pyusb/issues/139
>
> I don't know if this is something wrong about langid (in the device or
> software) or if it is just that requesting langid is the first
> operation requiring full access to the device. The last comment there
> about specifying langid hints to the former option.
>
> Regards,
> Tormod
>
> ------------------------------------------------------------------------------
> _______________________________________________
> pyusb-users mailing list
> pyusb-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pyusb-users

Hi Tormod and Steve,

Thanks for your responses. I tried running the pyocd-gdbserver with
LIBUSB_DEBUG=9, and got the following[snipped]:

libusb: debug [libusb_open] open 2.1
libusb: error [_get_usbfs_fd] libusb couldn't open USB device
/dev/bus/usb/002/001: Permission denied
libusb: error [_get_usbfs_fd] libusb requires write access to USB device nodes.
libusb: debug [libusb_open] open 2.1 returns -3
uncaught exception: The device has no langid
Traceback (most recent call last):

The device 1 on bus 2, is actually the root hub - the output of lsusb
-v -s2:1 is:

Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0
  bDeviceProtocol         0 Full speed (or root) hub
  bMaxPacketSize0        64
  idVendor           0x1d6b Linux Foundation
  idProduct          0x0002 2.0 root hub
  bcdDevice            4.06
  iManufacturer           3 Linux 4.6.6-300.fc24.x86_64 ehci_hcd
  iProduct                2 EHCI Host Controller
  iSerial                 1 0000:00:1d.0
  bNumConfigurations      1

But even after adding the following rule to udev, I am still getting
the permission error:

ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="1d6b",
ATTRS{idProduct}=="0003", MODE="0666", GROUP="plugdev"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0d28",
ATTRS{idProduct}=="0204", MODE="0666", GROUP="plugdev"

I tried with both with and without GROUP="plugdev" because the group
didnt really exist in my (Fedora 24) distro. Although I created the
group and added myself to it, and rebooted.

-- 

Thanks and Regards,
Aurabindo J

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

Reply via email to