User avatar
timg11
Posts: 91
Joined: Sat May 31, 2014 11:14 pm

Disable Wi-Fi power save mode on Pi Zero W Buster

Tue Jun 22, 2021 12:57 pm

This Pi Zero W with Buster is continually going offline and is unreachable by WI-Fi for extended periods (15 seconds+) It has adequate power and the power save mode causes problems.
Other threads say that power save is disabled by default on recent Pi OS versions, but apparently for the Zero W, that is not true:

Code: Select all

 pi@Pi-ZeroW-1-EIclock:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
...

pi@Pi-ZeroW-1-EIclock:~ $  dmesg | grep power
+[    2.720096] bcm2835-power bcm2835-power: Broadcom BCM2835 power domains driver
[   26.758711] brcmfmac: brcmf_cfg80211_set_power_mgmt: power save enabled
pi@Pi-ZeroW-1-EIclock:~ $
What is the process for permanently changing this default to power save disabled?

epoch1970
Posts: 6705
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Disable Wi-Fi power save mode on Pi Zero W Buster

Tue Jun 22, 2021 4:51 pm

There is no sanctified process, do as you wish.

As they propose in the link you posted, you can create a systemd service and stick "iw dev wlan0 set power_save off" in it, or add that line to /etc/rc.local (simplest and easiest)

You can also create a udev rule that matches your interface MAC address, create a dhcpcd.exit-hook, use an @reboot cron job, etc.
For me, I would go with a udev rule.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

User avatar
thagrol
Posts: 5262
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Disable Wi-Fi power save mode on Pi Zero W Buster

Wed Jun 23, 2021 12:58 am

And if that doesn't work try having a script send a single ping to your router every ten seconds or so. Not the best option but if there's trafiic more often than the power saving interval it should stop things going to sleep.
I'm a volunteer. Take me for granted or abuse my support and I will walk away

All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides

User avatar
timg11
Posts: 91
Joined: Sat May 31, 2014 11:14 pm

Re: Disable Wi-Fi power save mode on Pi Zero W Buster

Thu Jun 24, 2021 12:42 pm

I did it by adding a line to /etc/rc.local

Code: Select all

	/sbin/iwconfig wlan0 power off
That appears to be working, although for unknown reasons the Pi will no longer successfully reboot with "sudo shutdown -r"
I have to physically disconnect the power. Then it will reboot and power save is reported as off.

I'm still confused about this, based on others saying Wi-Fi PS is off by default on recent versions of Pi OS.
Are they just wrong, or does the Pi OS behave differently on the ZeroW compared to the Pi 3 and 4? If the latter, are the differences documented anywhere?

Return to “Beginners”