14

I'm facing a similar issue to this one, How do I disable suspend mode?, except I have a Raspberry Pi 3 and am running OpenELEC 6.0.3. When I leave it on without using it for awhile, I can no longer ssh to it or connect to it via samba. I have to use it use again and then I'm able to connect to it (although occasionally I have to reboot in order to be able to ssh to it for some reason).

Is the wifi going into sleep mode when there is no traffic? How can I disable it on the Pi 3?

OpenUserX03
  • 273
  • 1
  • 3
  • 6

3 Answers3

13

To stop your wifi from go to sleep after idle for awhile, you need to disable its power management.

Edit file /etc/network/interfaces

Assume you Pi connect to network through wlan0. Add new line with wireless-power off right BELOW the line iface wlan0 inet manual

Save and reboot your Pi

run iwconfig now you should see Power Management:off

Aura
  • 428
  • 2
  • 12
  • There is no /etc/network/interfaces nor iwconfig in OpenELEC though... – OpenUserX03 May 09 '16 at 20:40
  • F.Y.I about OpenELEC, power saving has been disabled in the brcmfmac driver with RPi 4.4.5 linux kernel. You should use builds come with that kernel version – Aura May 10 '16 at 01:32
  • 3
    On Raspbian Stretch, there is no line "iface wlan0 inet manual" in the config file. If I add the option to the end and reboot, power management is still on. I used the command "iw wlan0 set power_save off" instead. – TSGames Jun 23 '18 at 18:00
10

Editing /etc/network/interfaces no longer works in Raspbian, as TSGames commented in the most upvoted answer.

Instead, you can use /sbin/iw wlan0 get power_save to read the current power save state, and sudo /sbin/iw wlan0 set power_save off to disable power state.

Since the iw command is not persistant, I added /sbin/iw wlan0 set power_save off to /etc/rc.local right before exit 0 to have it set at startup (no need for sudo since rc.local already is run with admin rights).

Oystein
  • 201
  • 2
  • 5
0

Octopi going to sleep fix.

The following did the trick for Octopi print server:

added the wireless-power off into the ipconfig.txt file since this file is called by the file at: /etc/network/interfaces

No more sleeping octopi server!

Dana

Dana D
  • 1
  • 1
    Welcome -- but this is not a direct answer to the question. Although it might be implied that the same answer will work generally, it's not clear that is the case. And please take the tour to understand better how the site works ;) – goldilocks Nov 18 '17 at 18:40