On Tue, Aug 23, 2016 at 8:31 AM, Jay Aurabind wrote: > On 23 August 2016 at 02:18, Tormod Volden wrote: >> I am a bit confused here, did you really want to manipulate the root >> hub with pyusb, or did something go wrong here? >> > > Absolutely not, only reason I wanted to try giving write permission to > that device, which happens to be the root hub was because that's the > only permission error I see in the LIBUSB debug messages, as you can > see from the logs I showed. If I run pyusb as root, I do not see those > permission errors.
OK, I see. > > I suspect that pyusb reads certain data commonly for all available > devices, may to figure out whether that is really the device it needs > to work on ? It usually shouldn't try to retrieve descriptor strings from other devices than the ones targeted. The device descriptor (retrieved and cached by the OS) is usually enough to filter out the right devices (e.g. filtering on vid/pid). How are the devices filtered in your program? >> Some devices can be released from the kernel, and then be available >> for you to manipulate it through the device node (and thus via e.g >> libusb and pyusb). See for instance the libusb_detach_kernel_driver() >> function in libusb. However, in most cases people use libusb and pyusb >> to access devices that have no kernel driver. > > In that case, even the root should not be able to write to those > devices, since its exclusively managed by kernel. Then how come I get > no errors when I run pyocd with root permissions ? You won't be able to claim any of its interfaces, but I suppose some control transfers are still allowed. Tormod ------------------------------------------------------------------------------ _______________________________________________ pyusb-users mailing list pyusb-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pyusb-users