Turn off WiFi power saving mode in Raspberry Pi
By default, some wireless adapters enable “Power Saving”. This is a “sleep mode”, or rather an energy-saving feature. This means that the adapter will turn off the network connection when inactive. This is not a problem when using Raspberry Pi as a client. Then the WiFi connection is simply reactivated. But if you want to remotely access Raspberry Pi via SSH for example, it may not be accessible. Then it looks like the WiFi adapter is not working. Only the energy saving function is active.
So it is necessary to turn off the power saving function.

For each wireless adapter, switching off the power saving function looks different. As a rule, the energy-saving function is always active. If you have problems reaching Raspberry Pi via the WiFi adapter you should first locate the manufacturer, if you do not already know that. Often, however, one also has to do with noname products.
In the short term, the problem can be solved by staking out the WiFi adapter and plugging it in again. Then it is reinitialized and Raspberry Pi is again accessible via the WiFi. However, this does not help as a permanent solution. So it’s about switching off the energy saving function permanently.
overview
To turn off the power saving mode of a wireless adapter, there are several options that do not all work. It essentially depends on whether the kernel supports the feature for the wireless adapter, or whether you need to choose a product-specific solution.
- Switch off energy-saving mode via the network settings (variant 1)
- Switch off energy-saving mode via the network settings (variant 2)
- Shut down energy-saving mode of a Wi-Fi adapter from Edimax (Realtek chipset)
If the first two variants do not work for the WiFi adapter used, then you should look for a product-specific solution.
Note: Name of the network interfaces
Since Raspbian Stretch, the Ethernet and WiFi network interfaces have different names. So no longer “eth0” and “wlan0”, but “enx …” and “wlx …”. This concerns USB-connected network adapters whose names differ from the designations mentioned here. This means that one must first determine the individual name or change the naming to the old method.
version 1
If there is no product-specific solution, you can try it via the network settings. To do this, open the file with the network settings:
sudo nano /etc/network/interfaces
Enter the following lines or add missing lines:
allow-hotplug wlan0
iface wlan0 inet manual
wireless-power off
After saving and closing with Ctrl + O, Return, Ctrl + X all you have to do is reboot.
sudo reboot
Note: Unfortunately, this setting does not work with some kernel versions.
version 2
To do this, open the file with the network settings:
sudo nano /etc/network/interfaces
Enter the following lines or add missing lines:
allow-hotplug wlan0
iface wlan0 inet manual
post-up iw dev wlan0 set power_save off
This switches off the energy-saving mode due to the condition.
Save, close the file and restart the system.
Solution: Disable energy-saving mode of a WiFi adapter from Edimax (chipset from Realtek)
For this solution to work, the wireless adapter must have a Realtek chipset. In this example RTL8192CU.
Of course, there is the question of whether you have a wireless adapter with this chipset.
lsmod
If the module “8192cu” is located in one line, then you can create a configuration file for the driver.
sudo nano /etc/modprobe.d/8192cu.conf
Insert the following line into this file:
options 8192cu rtw_power_mgnt = 0 rtw_enusbss = 0
For the shutdown is active, you should restart Raspberry Pi.
sudo reboot
Solution: Check power management status
Whether the energy-saving mode of the WiFi adapter in question is actually switched off can only be checked in practice during runtime. But you can at least check whether the setting was adopted.
We install the wireless tools for this.
sudo apt-get install iw wireless tools
The command “iwconfig” informs about the WiFi interfaces.
iwconfig
Here the option “Power Management” should be set to “off”. But that does not mean it really works. Sometimes a configuration change of the drivers is necessary.
An alternative source of information for power management status:
iw wlan0 get power_save
I tried many solutions – they failed. This is the one that finally worked. Thank you.
I’m glad it worked , you are more than welcome