How To Disable WiFi Power Saving On The Raspberry Pi


Recently I set up a Raspberry Model A+ with a Python script to log temperature to the internet. I used an Edimax EW-7811 WiFi dongle to connect to it using SSH. This worked fine but occassionally I would lose the connection for no apparent reason.

After a bit of Googling it appeared that a power saving mode might be responsible. It seems the dongle turns off if no one is typing at a keyboard. Even if the dongle is constantly transferring data via WiFi it just gives up. Not sure why the hardware would be programmed to do that because it’s completely insane. I’m all for power saving but I like WiFi to stay up when I’m actually transferring data over it!

Luckily there is a solution. It involves disabling the power management so the dongle stays connected. The following technique should work for all WiFi dongles that use the Realtek RTL8192 chipset.

Disable Power Management

First you read the power management flag using :

cat /sys/module/8192cu/parameters/rtw_power_mgnt

This will report a value of “1”.

To set it to zero you can use :

sudo nano /etc/modprobe.d/8192cu.conf

and add the following line :

options 8192cu rtw_power_mgnt=0 rtw_enusbss=0

To quit from nano use [CTRL-X], [Y] then [ENTER].

You are now ready to reboot using :

sudo reboot


The two options we set in the configuration are rtw_power_mgnt and rtw_enusbss. If you are interested they take the values defined below :

  • rtw_power_mgnt
    • 0 = disable power saving
    • 1 = power saving on, minPS
    • 2 = power saving on, maxPS
  • rtw_enusbss
    • 0 = disable auto suspend
    • 1 = enable auto suspend

So setting them both to zero disables “power saving” and “auto suspend”.

External References

Here are a couple of sites I used on my quest :



  1. It’s a known problem on the Pi 3. “Makezine” has quoted Eben Upton as saying it will be fixed “eventually”. Make what you will of that. I have experienced the same problem and have, for the moment, abandoned the WiFi interface on the PI 3 and gone back to wired Ethernet. I have put a USB “WiPi” dongle on one of my other Pi’s to free up a port on my router.

Leave A Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.