Skip to content Skip to sidebar Skip to footer

Pyusb Dev.set_configuration()

I am trying to send data to a usb stick using the python library PyUSB. The code I am using is the following: import usb.core import usb.util # find our devices #dev = usb.core.fi

Solution 1:

I just realized from the tags that you are using Ubuntu. In Ubuntu USB device permissions are tied to the USB device numbers. When Ubuntu ships it comes with global permissions for some standard devices (e.g. flash drives) so that non-root users can use these. However, it does not globally unlock USB devices because some USB devices could be harmful. Please see this post to understand how to modify the Ubuntu configuration (in particular /etc/udev/rules.d/40-basic-permissions.rules) in order to allow your device to be used by non-root users.

Solution 2:

you have to do - on ubuntu:

sudo usermod -a -G uucp YOURUSER
sudo usermod -a -G dialout YOURUSER

and then

sudo echo "SUBSYSTEM==\"usb\", ATTR{idVendor}==\"YOURVENDOR\", ATTR{idProduct}==\"YOURID\", MODE=\"666\"">/etc/udev/rules.d/99-YOURDEVICENAME.rules

in Your example:

 sudo echo "SUBSYSTEM==\"usb\", ATTR{idVendor}==\"090c\", ATTR{idProduct}==\"1000\", MODE=\"666\"">/etc/udev/rules.d/99-YOURDEVICENAME.rules

Post a Comment for "Pyusb Dev.set_configuration()"