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?

2
  • Have you checked in the settings for something which gives you control over how long the Pi stays awake before going to sleep?
    – Darth Vader
    May 9, 2016 at 15:59
  • 1
    @DarthVader Yes I have and there are no power settings in OpenELEC May 9, 2016 at 20:46

3 Answers 3

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

3
  • There is no /etc/network/interfaces nor iwconfig in OpenELEC though... May 9, 2016 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 May 10, 2016 at 1: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, 2018 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).

4
  • 2
    I'm pretty certain that iw doesn't make any changes that persist after a reboot. Nov 19, 2019 at 15:40
  • @DmitryGrigoryev You're absolutely right. Good catch! I've updated my answer.
    – Oystein
    Nov 20, 2019 at 7:46
  • When the question was asked, /etc/network/interfaces was working!
    – MatsK
    Nov 20, 2019 at 18:37
  • Please take note that using /etc/rc.local has limitations due to Compatibility with SysV. We have seen many problems here on this site using it. Following the recommendation of the developers from systemd you should avoid using it.
    – Ingo
    Nov 20, 2019 at 19:20
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

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, 2017 at 18:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.