How to disable auto power off of usb devices like usb mouse?

I don't know how , but somehow automatic power-off of usb devices got accidentally enabled. Now my usb mouse goes off even if it's idle for 2-3 seconds. It's really irritating.

This happened after I installed powertop and powernap. Maybe it has something to do with these two applications.

How can I disable this "feature"?


Solution 1:

Just copy paste the following command in terminal and it will disable auto suspending.

Disabling auto suspending USB

echo 2 | sudo tee /sys/bus/usb/devices/*/power/autosuspend >/dev/null

Disable USB autosuspend

echo on | sudo tee /sys/bus/usb/devices/*/power/level >/dev/null

Solution 2:

It's PowerNap that's doing this.

You can disable just this part of PowerNap's power savings scripts with:

sudo powernap-action --disable usb_autosuspend