9

I'm trying to disable the wireless power save on my RPI3, but can't do it:

$ sudo iwconfig wlan0 power off
Error for wireless request "Set Power Management" (8B2C):
    SET failed on device wlan0 ; Invalid argument.

Is it possible, or simply not supported?

Regardless, if I don't get any problems while using the wifi card as Soft AP, is there any advantage is disabling power management?

Jacobm001
  • 11,904
  • 7
  • 47
  • 58
Marcus
  • 193
  • 1
  • 1
  • 4

4 Answers4

17

I'm running current kernel (4.1.19-v7+ #853), which exhibits the problem. Updating to BRANCH=next didn't help, so I rolled back.

For me, although iwconfig wlan0 power off doesn't work, the alternative iw dev wlan0 set power_save off does work.

So I've commented-out wireless-power off in /etc/network/interfaces, and replaced by:

allow-hotplug wlan0
iface wlan0 inet manual
#   wireless-power off
    post-up iw dev $IFACE set power_save off
Greenonline
  • 2,969
  • 5
  • 27
  • 38
Colin Dean
  • 171
  • 3
6

Try

sudo iw dev wlan0 set power_save off
Aloha
  • 7,176
  • 1
  • 29
  • 52
4

upgrade to "next" firmware branch:

sudo BRANCH=next rpi-update

mine is now kernel 4.4.3 and firmware 41f8b4812ad653abf321b8c54cb4bee57ebdb129 and now accepts the power off command. My connection was constantly dropping, this appears to have sorted it!

Tom
  • 56
  • 1
2

Here's a way I used that should work on any Pi- or any Debian Based distro on a Pi- to PERSISTENTLY disable Power Management as a systemd service.

Just copy the below bash script into a file, chmod 700 it and sudo ./fileName will setup a service that ensures Power Management stays down across reboots. Tested and known to work correctly on Raspbian Buster:

if [ -d /root/scripts ]; then
    mkdir /root/scripts
fi

apt-get -y install iw
apt-get -y install wireless-tools

cat <<EOF> /root/scripts/pwr-mgmnt-wifi-disable.sh
#!/bin/bash
iw dev wlan0 set power_save off
EOF

chmod 700 /root/scripts/pwr-mgmnt-wifi-disable.sh


cat <<EOF> /etc/systemd/system//pwr-mgmnt-wifi-disable.service
[Unit]
Description=Disable WiFi Power Management
Requires=network-online.target
After=hostapd.service

[Service]
User=root
Group=root
Type=oneshot
ExecStart=/root/scripts/pwr-mgmnt-wifi-disable.sh

[Install]
WantedBy=multi-user.target

EOF

chmod 644 /etc/systemd/system/pwr-mgmnt-wifi-disable.service

systemctl enable pwr-mgmnt-wifi-disable.service
systemctl start pwr-mgmnt-wifi-disable.service
F1Linux
  • 1,677
  • 1
  • 15
  • 32