I was having wi-fi issues with a new Raspberry Pi 3 (with latest Raspbian, just downloaded yesterday). It'd be fine initially, but after a few minutes sitting idle, the Pi often wasn't reachable from other machines on the local network (for ping, ssh, vnc, etc). It seems that the wi-fi module has quite aggressive power-saving enabled.
I looked around on the web and found a series of steps that fixed the issue for me. It might be that some of these are redundant, but they worked here, and should only take a couple of minutes (just once). You're welcome to try them.
You'll need to be logged into the Pi on the command line to proceed, either directly or via ssh from another machine. (You can get into your Pi via ssh on your local network by doing ssh [email protected] and entering the usual password.)
Also, I use the nano editor in these steps. Feel free to substitute whatever you prefer.
Assumption: your wi-fi interface is wlan0. Check first by doing
Code: Select all
iwconfig
As a temporary fix while you're following these steps, do this:
Code: Select all
sudo iwconfig wlan0 power off
Step 1
Do:
Code: Select all
sudo nano /etc/modprobe.d/8192cu.conf
Code: Select all
options 8192cu rtw_power_mgnt=0 rtw_enusbss=0 rtw_ips_mode=1
Step 2
Do:
Code: Select all
sudo nano /etc/rc.local
Code: Select all
sleep 10
iwconfig wlan0 power off
Do:
Code: Select all
sudo nano /etc/systemd/system/root-resume.service
Code: Select all
[Unit]
Description=Turn of wlan power management
After=suspend.target
[Service]
Type=simple
ExecStartPre= /bin/sleep 10
ExecStart= /sbin/iwconfig wlan0 power off
[Install]
WantedBy=suspend.target
Code: Select all
sudo systemctl enable root-resume
Finally, reboot the Pi (sudo reboot). That's it.
Check that it worked
To check it worked, once you've rebooted, do:
Code: Select all
iwconfig
Hope that helps.
-M