This is very annoying when you use wireless keyboard or mouse and when you don't use it for few seconds it freezes.
The actual reason for that is laptop-mode or different power management tools which is suspending most wireless devices to save power. To solve that you need to turn off Autosuspend for USB device USB Receiver option in your power management system.
Install powertop if you don't have this program:
sudo apt-get install powertop
Then open (
sudo powertop command in console), select Tunables in menu (using tab button) and find Autosuspend for USB device USB Receiver option (it will also include your device name) and turn it off just by pressing Enter key.
Close app using ESC button. Now you wireless device is working fine, bad news, it will be same after reboot or logout. To prevent this we need to edit rc.local file to execute this script everytime. When you change something in powertop it just executes a command.
You can export that command to html file:
sudo powertop --html
Then get commands from that file (name of html file can be different in different releases) :
grep 'echo ' powertop.html | sed 's/.*\(echo.*\);.*/\1/g'
To be sure which one is for wireless device open powertop again and change that Autosuspend setting, on the top you will see command, now copy that command from the list we got from powertop.html file. Mine was:
echo 'on' > '/sys/bus/usb/devices/1-2/power/control'
Open rc.local file and add this command before exit 0:
sudo nano /etc/rc.local
Save the file (using Ctrl+X if you use nano).
Thats all, now you can use your wireless devices when you need them without such an annoying terrible problem.Share on Twitter Share on Facebook