Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I upgraded my Ubuntu machine to 10.10, and I'm having an issue with bluetooth dongle now. The issue is: dongle will not properly load on boot. What I have to do to make it work is unplug, then plug back.

aside from the question "wtfigo, how to fix that?", I would like to learn if there is an easy way to programmatically disable USB port, then enable it back; make it equivalent to "plug out, plug in" action. I made a quick look at ubuntu utilities, couldn't find the one which would let me disable a single USB port

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Find ID of your bluetooth dongle with lsusb

Find which port is assigned to this usb device (mine would be 1-1 in this example) with this command :

for X in /sys/bus/usb/devices/*; do 
    echo "$X"
    cat "$X/idVendor" 2>/dev/null 
    cat "$X/idProduct" 2>/dev/null
    echo
done

Add to your /etc/rc.local these two lines (with correct port instead of 1-1)

sh -c "echo 0 > /sys/bus/usb/devices/1-1/authorized"
sh -c "echo 1 > /sys/bus/usb/devices/1-1/authorized"

With this method, rc.local will reset usb port 1-1 (or the one you will specify) at the end of each boot process

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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