Add how to disable a USB device to the FAQ?
-
Hi,
I just stumbled upon my own post about how one can disable a USB device. While adding it to my own bookmarks for future reference, I wondered if it would be a useful addition to the FAQ. Here's a slightly polished version:
How can I disable a USB device without disconnecting it?
USB devices can be disabled via usb authorisation in udev. For example, this udev rule will disable a Mayflash Wireless Wii U Adapter:
SUBSYSTEM=="usb", ATTRS{idVendor}=="0079", ATTRS{idProduct}=="1800", ATTR{authorized}="0"
The values for idVendor and idProduct can be determined by the command
lsusb
in the Retropie console. Alternatively, the following command line will show them for a particular joystick device/dev/input/jsX
.udevadm info -q all -n /dev/input/js0 | grep 'VENDOR_ID\|MODEL_ID'
To disable the device, put your vendor and model ids as idVendor and idProduct values in the above udev rule and save it in the text file
/etc/udev/rules.d/60-disabled_devices.rules
(the name between60-
and.rules
is arbitrary). That should disable the usb device on the next reboot or after running the commandsudo udevadm trigger
.To re-enable the device, just delete the file or change the value "autorized" to
1
.++++++++++++++++++++++++++++++++++++++++++++++++++++++
In code:
**How can I disable a USB device without disconnecting it?** USB devices can be disabled via usb authorisation in udev. For example, this udev rule will disable a Mayflash Wireless Wii U Adapter: ``` SUBSYSTEM=="usb", ATTRS{idVendor}=="0079", ATTRS{idProduct}=="1800", ATTR{authorized}="0" ``` The values for idVendor and idProduct can be determined by the command ```lsusb``` in the Retropie console. Alternatively, the following command(s) will show them for a particular joystick device (jsâŠ). ``` udevadm info -q all -n /dev/input/js0 | grep 'VENDOR_ID\|MODEL_ID' ``` To disable the device in question, put your vendor and model ids as idVendor and idProduct values in the above udev rule and save it in the text file `/etc/udev/rules.d/60-disabled_devices.rules` (the name between `60-` and `.rules` is arbitrary). That should disable the usb device on the next reboot or after running the command ```sudo udevadm trigger```. To re-enable the device, just delete the file or change the value "autorized" to `1`.
Please tell me your thoughts about it. With overall approval, I would add it to the FAQ myself.
Cheers
Clyde -
@Clyde nice Christmas present
Useful for scripts -
@cyperghost Thanks, and also for the reminder to put it in the FAQ! ð³ð
-
I added it to https://github.com/RetroPie/RetroPie-Setup/wiki/FAQ, but my link to the entry doesn't work. The page doesn't jump down to the entry.
Could someone with more knowledge of the wiki please fix that? Thanks!
-
@Clyde thanks for your contribution. i did some minor cleanup, hope it's to your liking. i'm not too convinced it's a frequently asked question, but i can definitely see how it would be useful. there should be a tips & tricks article or something, so that cool stuff like this doesn't get buried in the forums :)
-
@chipsnblip Great, thanks! Could you please tell me why my link in the topic list wouldn't lead down to my topic? It does now, so I guess you did something to it.
The FAQ was the best place for it I could find for such information that isn't related to any of the other wiki articles.
-
@Clyde it was missing the triple hash
###
. i cleaned up some other anchor links in that article that were broken as well, you can see my revisions here: https://github.com/RetroPie/RetroPie-Setup/wiki/FAQ/_history -
@chipsnblip Argh, I thought there was something wrong with the link, but the target was the problem. ð³
Again, thanks!
edit: typo
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.