42

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?

9
  • It would be helpful to us if you could tag your question with the appropriate display manager. Thanks!
    – user46
    Aug 1 '12 at 4:12
  • Can you see any output on an attached screen? And do you have an up-to-date OS? Could be a kernel panic, which happended to me randomly after certain uptime.
    – macrojames
    Aug 1 '12 at 5:40
  • 1
    @BryanDunsmore I doubt he is using a DM - it's a headless audio player... Aug 1 '12 at 8:20
  • Possible duplicate of How do I prevent the screen from going blank?
    – Jivings
    Aug 1 '12 at 10:53
  • @AlexChamberlain If he is using Raspian I highly doubt he has uninstalled the default display manager. =/
    – user46
    Aug 1 '12 at 15:50
52

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.

1
  • Unfortunately, the same thing is happening to be on xbian with 8192cu and power management is already set to 0. Somehow it still goes into coma...
    – StasM
    Jul 30 '13 at 7:06
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.

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

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

10
  • 3
    Where did he say he was using GDM?
    – Jivings
    Aug 1 '12 at 10:53
  • 1
    @Jivings He didn't. I'm just providing an answer in the case that he is using GDM.
    – user46
    Aug 1 '12 at 15:52
  • 2
    Then you should ask for more information before answering.
    – Jivings
    Aug 2 '12 at 8:56
  • 1
    I highly doubt that they will respond considering (1) they have no account on here, and (2) this question is about a week old. In this case it would still be best to provide an answer for future visitors.
    – user46
    Aug 2 '12 at 16:19
  • 2
    I do have an account at stackoverflow and a few of the other stackexchange sites and I asked this question on superuser.stackexchange and then it got moved to raspberrypi.stackexchange. I guess that's why I got no notifications of replies. It got moved to a sub-site where I had no account, before anyone commented on it. Annoying.
    – dgrant
    Aug 10 '12 at 16:43

This site is temporarily in read only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .