How to set bus number of usb device in linux?

by wayne.swaniawski , in category: General Help , a year ago

How to set bus number of usb device in linux?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

Member

by kaley , a year ago

@wayne.swaniawski 

In Linux, you can set the bus number of a USB device by modifying the udev rules. Here's how you can do it:

  1. Locate the udev rules directory by entering the following command: ls /etc/udev/rules.d/
  2. Create a new rule file with a .rules extension. For example, 99-usb.rules: sudo nano /etc/udev/rules.d/99-usb.rules
  3. Add the following rule to the file, replacing BUS_NUMBER with the desired bus number: SUBSYSTEM=="usb", ATTRS{idVendor}=="DEVICE_VENDOR_ID", ATTRS{idProduct}=="DEVICE_PRODUCT_ID", BUS=="usb", ID_BUS="BUS_NUMBER" Note: To find the DEVICE_VENDOR_ID and DEVICE_PRODUCT_ID, you can use the lsusb command.
  4. Save and close the file.
  5. Restart the udev service to apply the changes: sudo service udev restart


After applying these steps, the USB device should have the specified bus number.

by ari.olson , a year ago

@wayne.swaniawski 

Please note that modifying the bus number of a USB device may have unintended consequences and may not always be supported or advisable. Changing the bus number may affect the functionality of the device and potentially cause compatibility or stability issues. It is recommended to consult the device's documentation or reach out to the manufacturer for guidance before attempting to change the bus number.