RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    Add how to disable a USB device to the FAQ?

    Scheduled Pinned Locked Moved Ideas and Development
    faqusbdisable
    8 Posts 3 Posters 1.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ClydeC
      Clyde
      last edited by

      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 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.

      ++++++++++++++++++++++++++++++++++++++++++++++++++++++

      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

      cyperghostC 1 Reply Last reply Reply Quote 3
      • cyperghostC
        cyperghost @Clyde
        last edited by

        @Clyde nice Christmas present
        Useful for scripts

        ClydeC 1 Reply Last reply Reply Quote 0
        • ClydeC
          Clyde @cyperghost
          last edited by

          @cyperghost Thanks, and also for the reminder to put it in the FAQ! 😳😊

          1 Reply Last reply Reply Quote 0
          • ClydeC
            Clyde
            last edited by Clyde

            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!

            chipsnblipC 1 Reply Last reply Reply Quote 1
            • chipsnblipC
              chipsnblip @Clyde
              last edited by chipsnblip

              @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 :)

              ClydeC 1 Reply Last reply Reply Quote 0
              • ClydeC
                Clyde @chipsnblip
                last edited by

                @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.

                chipsnblipC 1 Reply Last reply Reply Quote 0
                • chipsnblipC
                  chipsnblip @Clyde
                  last edited by

                  @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

                  ClydeC 1 Reply Last reply Reply Quote 1
                  • ClydeC
                    Clyde @chipsnblip
                    last edited by Clyde

                    @chipsnblip Argh, I thought there was something wrong with the link, but the target was the problem. 😳

                    Again, thanks!

                    edit: typo

                    1 Reply Last reply Reply Quote 1
                    • First post
                      Last post

                    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.