Laptop randomly waking up = Hibernate / Low Battery?

17,934

Solution 1

At the risk of looking stupid, I found the following:

I also had the same problem. I never shut down my laptop, I always put it into sleep mode, and it would wake up unexpectedly in the middle of the night. I discovered that this "S4 Doze to Hibernate" event is not a bug, it's a feature. Go to power advanced settings and change "hibernate after" under "sleep" drop down menu:

enter image description here>

Choose how long you want to wait before going to hibernate from sleep mode. I set mine to 1440 minutes (24 hours) which is enough for staying overnight.

By the way, also check you don't have anything under "allow wake timers".

I don't see that you say you've tried this, so if I missed you pointing it out, I apologize for wasting your time.

Solution 2

SleepWakeSolution

This is a solution for those who want their computers to never wake from sleep on their own anymore and simpler solutions have not worked. Nothing other than tapping a button or opening the cover will wake it. Not the planned tasks which are scheduled to wake up your system such as Windows Media Center or the unknown causes. The only negative I’ve found is that a laptop will not wake to hibernate if the battery is getting too low. It will just go dead and any unsaved information will be lost.

Open a command-prompt and run the following commands:

powercfg -setacvalueindex scheme_current sub_sleep bd3b718a-0680-4d9d-8ab2-e1d2b4ac806d 0
powercfg -setdcvalueindex scheme_current sub_sleep bd3b718a-0680-4d9d-8ab2-e1d2b4ac806d 0
powercfg -setactive scheme_current

These can be copied and pasted into the command prompt by clicking on the header/edit/paste at the top of the command prompt window.

This changes the default values for the current power scheme and stops the machine from being woken from sleep.

Applies to following registry keys:

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Power\PowerSettings\238C9FA8-0AAD-41ED-83F4-97BE242C8F20\BD3B718A-0680-4D9D-8AB2-E1D2B4AC806D
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Power\User\PowerSchemes\381b4222-f694-41f0-9685-ff5bb260df2e\238c9fa8-0aad-41ed-83f4-97be242c8f20\bd3b718a-0680-4d9d-8ab2-e1d2b4ac806d
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Control\Power\PowerSettings\238C9FA8-0AAD-41ED-83F4-97BE242C8F20\BD3B718A-0680-4D9D-8AB2-E1D2B4AC806D
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Control\Power\User\PowerSchemes\381b4222-f694-41f0-9685-ff5bb260df2e\238c9fa8-0aad-41ed-83f4-97be242c8f20\bd3b718a-0680-4d9d-8ab2-e1d2b4ac806d
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\238C9FA8-0AAD-41ED-83F4-97BE242C8F20\BD3B718A-0680-4D9D-8AB2-E1D2B4AC806D
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\User\PowerSchemes\381b4222-f694-41f0-9685-ff5bb260df2e\238c9fa8-0aad-41ed-83f4-97be242c8f20\bd3b718a-0680-4d9d-8ab2-e1d2b4ac806d

The above has been tested to work in Win7 and Win8. It modified the SKUACSettingIndex to a 0 from a 1 in Win8 under all the above categories during the test, which could also be done manually through regedit as an alternative. This enables a power scheme with the ability to wake from sleep completely disabled. Again, the only negative I have found is that a laptop will not wake to hibernate if the battery is getting too low. It will just go dead.

Important: The additional step of going to Control Panel / Power Options, and then resetting the current power scheme to the default values under advanced settings may also be necessary after implementing the config changes. The user can then readjust things back to their own preferences.

During my command-prompt test on a new Win8 system, it appears to have reset the power settings to default since things again have their default time-out settings after using the command-prompt solution. There have also not been any wakes reported during the test period in Event Viewer /system.

I also reviewed the Event Viewer on two other systems, and there have not been any wakes on those systems since I implemented the Command Prompt solution on them two weeks ago.

To return the defaults to the original values, enter the same command-prompt lines but enter a 1 for the last character instead of a 0. Then change the current power scheme back to default values in Power Options.

HKEY_USERS\S-1-5-19\Control Panel\PowerCfg - This lists the current Power Policy.
Share:
17,934
Synetech
Author by

Synetech

Sadly, I’ve become soured by the SE network. It started great, but went downhill. Some mods are too aggressive/bias, policies are arbitrarily/capriciously/selectively applied, and some users treat the sites as MMOGs, “rep-whoring”, copying others’ work, and posting random guesses to game the system by abusing and exploiting auto-bounty assignment. I care(d) about the integrity of the site, so I feel anywhere that allows such disreputable behavior isn’t somewhere worth staying. My OCD not withstanding, I won’t be contributing much here anymore and will find somewhere else to help people. I apologize to all of the people I would have helped here in the future. Press the chemise key to continue… 😈 Images As a visual-learner, I often add images to my posts to make them more effective. Sometimes I take photos, sometimes I create them with software, sometimes I find them through Google Images or Wikipedia. Mod I’ve been asked hey bro, y u no b mod? get u POWR! impr0ve site (or some other variation). I had considered it and was even tempted to run a few times, but I just have too much to do already, so I can’t take on that kind of commitment when I know I won’t be able to do as good a job as I’d like, or as Sweet Brown would say, ain’t nobody got time fo’ dat. Besides, as the behavior of the other mods became more and more apparent, I realized that it would be pointless.

Updated on September 18, 2022

Comments

  • Synetech
    Synetech almost 2 years

    A (Windows 7) laptop has been annoying me since the day we got it. When it is put to sleep (the lid closed), it seems to intermittently wake up randomly during the night (i.e., 10pm, 1:30am, 7am, etc.) There are plenty of people experiencing this, but I have done several tests and made numerous observations to provide as much information here as possible to diagnose the problem.


    When the laptop wakes up in the middle of the night, several telling observations can be made:

    • It stays on for approximately 20-50 seconds (more than a few, less than a lot)
    • The screen remains off (completely, not just the back-light)
    • The hard-drive is thrashed the whole time (HD LED is nearly solid)
    • The DVD drive spins up and whirs loudly for ~5-10 seconds if there is a disc in it
    • Windows is active (the PnP bing-bong noise is played if a drive/keyboard/etc. was removed or plugged in after the system was put to sleep)
    • (Unconfirmed: pressing a key—if enabled—won’t turn it on next time; must use the power-button)
    • The next time the system is turned on, there is no indication of the previous, random activity (using powercfg -lastwake returns a Wake History and Wake Source Count of 0)

    Other observations include:

    • Does not seem to happen when Windows is shut down or hibernated, only when put to sleep (e.g., lid closed)
    • There are countless tasks in the Task Scheduler in Windows 7, but a quick scan seems to indicate that none are responsible (though I have enabled the history to keep track)
    • (I keep trying to catch it to press a key to get the screen to show to see what is happening, but it always seems to happen at an inopportune moment and shuts down before I get the chance)
    • As Mark suggested, I checked the Event Log and found a set of events that are the best clue yet:

      6:51:37pm The system is entering sleep.
                Sleep Reason: Button or Lid
      6:51:42am The system time has changed to ‎2012‎-‎08‎-‎21T10:51:42.500000000Z from ‎2012‎-‎08‎-‎20T22:51:39.080510600Z.
      6:51:42am-6:51:47am Six services were stopped…
      6:51:47am The system has resumed from sleep.
                Sleep Time: ‎2012‎-‎08‎-‎21T10:51:46.021150600Z
                Wake Time: ‎2012‎-‎08‎-‎21T10:51:44.010053500Z
                Wake Source: S4 Doze to Hibernate
      6:51:55am The system is entering sleep.
                Sleep Reason: Hibernate from Sleep
      

    What it’s not:

    • Windows update : WU is set to only check, not download and do so at noon (not randomly)
    • Wake-on-LAN : WoL and Magic-Packet are both disabled in Device Manager, there is no option in the BIOS, and cable-modem is turned off at night
    • Devices : All keyboards, mice, NICs are set to not wake the system (powercfg -devicequery wake_armed returns an empty list)
    • Malware : This is a new system with up-to-date Windows updates and active MSSE with the latest defs, plus careful browsing with the latest Chrome and no files that are even the least bit questionable

    I have two theories as to what it could be:

    1. Hybrid sleep

      In Windows Vista and up, hybrid sleep lets the system first sleep (suspend to RAM), then after some time, flush the memory to disk to hibernate. This may make sense in that the laptop is sleeping, and then eventually switches to hibernation, so it wakes up to flush the memory to disk.

      This could work since instead of going straight into Windwos, the BIOS POSTs and Windows “Resumes”. However, it should transition from sleep to hibernation at the same time, not randomly. Moreover, this particular laptop does not have hybrid sleep enabled.

      Can anyone confirm how (at a low level) if hybrid sleep works like this?

    2. Low battery

      When a laptop’s battery is too low, Windows automatically hibernates (of course Windows does this before the battery is too low so that it has enough power left to perform the hibernation). When it does this, the hard-drive thrashes for a few dozen seconds and then shuts down. This seems to match the behavior of the laptop when it wakes up randomly, especially since the battery can reach the drained-point at a seemingly random time.

      The problem with this theory is that when the system is turned on after having awaken randomly, it does not print the message about Windows having shut down due to a low battery like it does whenever it hibernates due to a low battery while it is running.

      Further, it implies that Windows is active and processing (to some extent) while it is sleeping or even when it should already be off/hibernating.

      Can anyone confirm if Windows is active and monitoring battery levels while “off”?


    Based on the events, it looks like updating the system time is normal whenever the system turns on, so it’s not that, but it is clearly transitioning from sleep to hibernation at twelve hours after it went to sleep. This is baffling for three reasons:

    • The current setting is to hibernate after three hours on battery and six hours when plugged in for the Balanced and Power Saver plans (four hours and not at all with the High Performance plan). The Power Saver plan is in effect and it was unplugged this morning when it happened
    • Hybrid-sleep is disabled in every power plan
    • powercfg has no record of it happening

    Does anyone know why Windows would wake up randomly and exhibit the above symptoms or why the power plan settings seem to be incorrect?


    There are a lot of people experiencing laptops (of all makes and models) randomly turning on in the middle of the night. Unfortunately most of them get the same set of responses which rarely seem to fix the issue.

    Some notable ones include:

    • This question that seems to be the same issue with a couple of the observations I have made above.
    • This question seems to have the same issue, but with Linux.
    • This question lead me to turn off the keyboards/mice in case the touchpad sensitivity is set too low, but it still does it.
    • This thread points at sleep-timers, but they are already disabled.
    • Everett
      Everett almost 12 years
      +1 Just because I love this question, the thoroughness, the work behind it. This is a thing of beauty. Never mind the answer, I just want to enjoy the question some more... ;)
    • BrtH
      BrtH almost 12 years
      I think one of your first sentences is also your solution: "When it is put to sleep (the lid closed)". Are you sure that 'closing the lid' == 'hibernating'? If I remember correctly, the default setting for closing the lid is standby, and not hibernate. Go to configuration screen -> hardware and sound -> energymanagement -> Change when the screen is disabled (left panel) -> advanced settings -> change the settings under 'standby' (or sleep or sth.) and 'on/off buttons and lid'. (I use a Dutch windows 7 and tried to translate as good as possible, but things might be called different.)
    • Synetech
      Synetech almost 12 years
      @BrtH, yes, it is set to sleep by default, but that does not explain why it would suddenly, randomly, spontaneously turn on again. I have looked for hardware and software triggers that could cause it to turn on, but none seem to apply. Plus, I already said it doesn’t seem to happen when using the actual Shutdown or Hibernate commands.
    • BrtH
      BrtH almost 12 years
      Well, why don't you just use hibernate? It is more energy efficient, doesn't randomly wake up and is almost as fast to start up.
    • Everett
      Everett almost 12 years
      I wonder if Microsoft didn't use a shortcut in going from Sleep to Hibernate. Your computer is Sleeping. It is not in use, and the battery level drops. The computer protects itself by going to Hibernate. You don't get notification. What if Microsoft used the same code that Hybrid sleep uses when the computer is already asleep (did it as a shortcut)? You're not using the system, so who cares that the reason it went Hibernate on you is that the power dropped (just like the Hybrid system wouldn't care). I'm done, I just wanted to try to say something intelligent.
    • Synetech
      Synetech almost 12 years
      @Everett, I considered that and if it is how it works, it is poorly designed since it adds unnecessary wear-and-tear by spinning up the drives unnecessarily. What’s worse, is that all drives get spun up for one minute just so that it can flush the RAM to one of them (obviously worse for desktops). Of course the opposite (flushing the RAM to disk on sleep) is bad as well since it requires quite a bit of disk activity before the system sleeps, even if it gets awakened just a few minutes later. :-( Either way, this laptop isn’t even using hybrid sleep, so (unfortunately?) that can’t be it.
    • mgkrebbs
      mgkrebbs almost 12 years
      You could test if it is low-battery leading to hibernate by leaving the AC power block plugged in (assuming the laptop's low-bat detection is not defective). I've had services wake up the machine out of sleep, do stuff, and go back to sleep (not hibernate, I think) on Vista. I think an antivirus scan schedule did this on my machine.
    • Synetech
      Synetech almost 12 years
      @mgkrebbs, if anything, leaving it plugged in would prevent it from happening. Tonight, I’ll do the opposite by trying to arrange it so that the battery is very low before sleeping it. As for programs, I can’t fathom (nor find) any program that is scheduled to perform any task at random times.
    • Mark Allen
      Mark Allen almost 12 years
      What does the Windows System Event log say? It seems like there should be something in there when it sleeps or hibernates.
    • Synetech
      Synetech almost 12 years
      @Mark, hmm, there is a very telling set of events from this morning when it happened. It looks like it is indeed transitioning from Sleep to Hibernate, but I still don’t understand why it seems to be doing it “randomly”. Surprisingly, hibernate is set for SIX hours, which can certainly appear to be “random” since it happens so long after going to sleep. The problem is that last night, it did not sleep at 12:51am (six hours before it woke up) but rather at 6:51pm (TWELVE hours before it woke up). There is definitely some sort of correlation here, but why 12 hours? Plus, hybrid is “off”. o.O
    • Indrek
      Indrek almost 12 years
      If you think it's the laptop transitioning from sleep to hibernate due to low battery (which I agree it looks like), try this. Go to Power Options -> Change plan settings -> Advanced settings, and under Battery set critical battery action from "Hibernate" to "Shut down". Leave it to sleep overnight as usual, then the next morning see if Windows resumes from hibernation or does a cold boot.
    • Indrek
      Indrek almost 12 years
      I'm assuming, of course, that you leave the laptop on battery. Try leaving it plugged in for the night and see if the behaviour persists. If it does, then it can't be due to low battery (or at least that's not the only reason). You can also disable hibernating due to inactivity (in Advanced settings, under Sleep set "Hibernate after" to Never) and see if that makes a difference. These are all long shots, but might help rule out some potential culprits.
    • Synetech
      Synetech almost 12 years
      @Indrek, good suggestions. The problem is that not seeing it happen is hard to use as a symptom/confirmation since it is already intermittent to begin with. After I saw the suggestion about the touchpad being too sensitive, I disabled the let this device wake the system setting for everything and thought it was good because it didn’t happen for a week or two, but then it happened again this morning. :-|
  • Synetech
    Synetech almost 12 years
    If it had awakened transitioned after two hours like it is set to, then I could accept that as the explanation, but it did so after twelve, so if it is the reason, then I don’t know why it is using the wrong time.
  • Synetech
    Synetech almost 12 years
    No, that’s not updating the system time from an Internet time-server, it is simply noting that twelve hours have passed.
  • Everett
    Everett almost 12 years
    Solar flares? I kid. I'll stop here, I feel I legitimately tried.
  • Synetech
    Synetech almost 12 years
    I finally did a good test. I set hibernation to 60 mins, closed the lid at 19:00:00, and opened it at 19:59:50. Ten seconds later, the laptop turned on and did it's usual thing. This time however, the lid was open so I was able to see the Windows login screen for a second before the screen turned off. I pressed the DVD eject button and it opened. I moved the cursor and pressed the touch-pad buttons but nothing happened. I pressed some keys to try to log in, but only got the Windows default beep. The next time it was on, I checked the Event Log and yup, it logged a state change from S3 to S4.
  • Synetech
    Synetech almost 12 years
    That's it. I am officially closing The Case of the Randomly Waking Laptop because a state change from sleep to hibernation explains everything, including the seemingly random period. It seems random because of the default long interval between closing it and its changing from sleep to hibernation (e.g. 3p→3am or 7pm→1am). The only question now is why it is using hybrid sleep when it is supposed to be disabled…
  • Synetech
    Synetech over 11 years
    Completely disabling automatic power-on is a bit scorched-earth, but I suppose it could be useful for some systems that just won’t behave.
  • Paul Kinslow
    Paul Kinslow over 11 years
    I've found that it's a necessity in Las Vegas to protect high-end laptops from turning themselves on during 100 degree plus days while the laptop is in it's case in a parked car. I've had warped keyboards, fried video cards and thermal shutdown faults that caused all sorts of grief and expense. It also avoids any unnecessary battery drain. Some laptops go back to sleep after a short time, while others can remain on until the battery goes dead or a thermal shutdown takes place if the sleep timer is set for a longer period.
  • Synetech
    Synetech over 11 years
    I’d say that in that case, it would be better to figure out the cause of the wake in the first place instead of just preventing it from happening. Systems should not be turning on for no reason, and certainly not staying on for no reason. It would be better to check WoL, hybrid-sleep, and device-wake options, and then block it if nothing else works (e.g., if the system is buggy).
  • greenlungus
    greenlungus over 9 years
    Though my comment is a bit late... From my own experience it is often very nearly impossible to find all possible causes, and at least it is impossible to know if those found were all. Also, at any time a new cause (e.g. scheduled task) may be added by software. Considering that a laptop turning on in a bag may very well destroy the laptop (or worst-case even ignite a fire), fully disabling automatic wake seems pretty reasonable. It is one of those behaviours no operating system currently seems to get right.
  • Qwerty
    Qwerty over 8 years
    @Synetech Same problem, however, I disabled hybrid sleep in every option I found, I set the timer Everett shows in the picture to 0 minutes on un/plugged / all power settings. My laptop still wakes up after 12 hours, but WON'T shut down/go to hybernation.
  • Qwerty
    Qwerty over 8 years
    *Sorry, I don't have Hybrid sleep and Allow hybrid sleep in options as I disabled it thoroughly. My options are Sleep -> Sleep After | Allow wake timers, set to 0 (never) and disallow.