43

Whenever I leave my Raspberry Pi on overnight, it always seems to have entered some kind of suspended state. The red power light is still on but the light on the USB WiFi device is off and I can't access it with SSH.

I have no peripherals attached except for a USB WiFi device. I just use it headless as an audio player.

Anyone know how to completely disable any kind of suspend features?

goldilocks
  • 60,325
  • 17
  • 117
  • 234
dgrant
  • 532
  • 1
  • 4
  • 6

4 Answers4

51

You didn't provide a lot of details, but I'm going to assume you are using a WiFi adapter with the Realtek 8192cu chip, since that seems to be commonly used. Mine is the same and I have been experiencing what I think is the same issue: when leaving the RPi idle for an extended period of time, the WiFi seems to be disabled and you can no longer connect via SSH, etc.

I have been searching for a solution to this for months and only just now found one here: https://github.com/xbianonpi/xbian/issues/217. The solution is for xbian, but it worked for me on Raspbian.

The problem seems to be that the adapter has power management features enabled by default. This can be checked by running the command:

cat /sys/module/8192cu/parameters/rtw_power_mgnt

A value of 0 means disabled, 1 means min. power management, 2 means max. power management. To disable this, you need to create a new file:

sudo nano /etc/modprobe.d/8192cu.conf

and add the following:

# Disable power management
options 8192cu rtw_power_mgnt=0

Once you save the file and reboot your RPi, the WiFi should stay on indefinitely.

techraf
  • 4,353
  • 10
  • 32
  • 43
Herohtar
  • 833
  • 1
  • 9
  • 15
3

The preferred answer looks close to correct, but some additional comments in the original issue (https://github.com/xbianonpi/xbian/issues/217) would suggest an additional option is better:

options 8192cu rtw_power_mgnt=0 rtw_enusbss=0

in /etc/modprobe.d/8192.conf, as opposed to just rtw_power_mgnt=0. Simply specifying that one option did not work for me, as the wifi still turned itself off.

Talos
  • 31
  • 1
1

My issue was the screen saver. Disable with the following commands:

This turns off the screen saver:

xset s off

Disable other energy star features:

xset -dpms

This will not work in a remote SSH session

Dan Power
  • 119
  • 1
0

GDM

You can prevent GDM from suspending your computer by changing a value in dconf-editor. Note that I said dconf-editor, not gconf-editor.

$ dconf-editor

Now, you need to navigate to the org.gnome.settings-daemon.plugins.power node. You should see a whole list of key-value pairs. Change the following keys to the following values.

  • sleep-inactive-ac-type to nothing
  • sleep-inactive-battery-type to nothing

References