I'm using Ubuntu 12.04.

I need to send a command to a device that I have connected on a port of my PC. I can send the command by finding out what the Bus and Device number are.

For example, lsusb will tell me that I have a device connected on Bus 007 and Device 003

"Bus 007 Device 003: ID 045e:00cb Google Inc."

However, the device number will change if I reboot the device.

"Bus 007 Device 004: ID 045e:00cb Google Inc."

Is there a way to make sure that I can send the commands to that PC USB port? By associating the device number to that phyical USB port? Or is there other fixes and workarounds?


A workaround is to check the current bus/device configuration for your device as it'll be portable too and I think the usb host controller allocates these numbers dynamically, here's using awk you can get the current bus and device

    lsusb | grep "045e:00cb" | tr -d ':'| awk '{print "Bus="$2 " Device="$4}' 

You use $2 and $4 in anyway for example : ls -l /dev/bus/usb/$2/$4

  • Is there a way to fix how the usb host controller allocates the numbers? – Michael Huang May 13 '15 at 17:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.