4

Whenever i access sudo nano /etc/network/interfaces the file is essentially empty which is hindering me because i need to disable the power saving feature that automatically disables the wifi after a minute or so

This is what shows in my file

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

Because of this there is no where i can add the wireless-power off text and have it work.I have already tried to add this just at the bottom but it does not work.

il_raffa
  • 5,090
  • 129
  • 31
  • 36

2 Answers2

3

Firstly you should repost this over at https://raspberrypi.stackexchange.com/ Secondly I am just facing the same issue, and solved it by entering this line into the crontab:

@reboot /sbin/iw dev wlan0 set power_save off&
Sherlock70
  • 564
  • 10
  • 24
0

I used the below to PERSISTENTLY kill WiFi Power Management across reboots. It's done as a systemd service so independent of how the network interfaces are configured and "just works".

Should work on any modern Pi which has systemd. Just copy & paste below bash script into a file, set it to executable and sudo ./fileName.sh:

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
  • 3,580
  • 3
  • 25
  • 24