System connected to UPS goes to sleep short time after power is lost

4

2

I have a Win7 x64 system connected to the UPS. The UPS is capable of maintaining the system power for about 30 minutes. After I have connected the UPS, I have verified this by disconnecting the power cord and everything has worked as expected, I was receiving low level battery notifications and the system went off once the battery has reached the critical level. Since then a long time passed. Recently I was experiencing a power loss several times, and each time the computer went to sleep in a very short time.

I can reproduce this easily any time by disconnecting the power cord from the UPS. When I do this, the system correctly shows the battery level and the remaining battery time when I disconnect the cord (the level starts at 100 % and the remaining time at 0:32 and gradually goes down). Yet, the system sleeps after a short while without any warning.

I do not have any 3rd party software installed to manage the UPS, I am using default Windows battery handling. My advanced power settings when on battery are as follows:

  • Sleep after: 20 Minutes
  • Critical batter action: Sleep
  • Low battery level: 20 %
  • Critical battery level: 10 %
  • Low battery notification: On
  • Low batter action: Do nothing
  • Reserve battery level: 7 %

When the system sleeps, following entry is shown in the event log:

The system is entering sleep. Sleep Reason: Battery

<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
  <Provider Name="Microsoft-Windows-Kernel-Power" Guid="{331C3B3A-2005-44C2-AC5E-77220C37D6B4}" /> 
  <EventID>42</EventID> 
  <Version>2</Version> 
  <Level>4</Level> 
  <Task>64</Task> 
  <Opcode>0</Opcode> 
  <Keywords>0x8000000000000004</Keywords> 
  <TimeCreated SystemTime="2012-08-01T06:55:18.358031800Z" /> 
  <EventRecordID>325242</EventRecordID> 
  <Correlation /> 
  <Execution ProcessID="4" ThreadID="48" /> 
  <Channel>System</Channel> 
  <Computer>xxxxx</Computer> 
  <Security /> 
</System>
<EventData>
  <Data Name="TargetState">4</Data> 
  <Data Name="EffectiveState">4</Data> 
  <Data Name="Reason">2</Data> 
  <Data Name="Flags">0</Data> 
  </EventData>
</Event>

I have found a user reporting and solving a similar problem on Microsoft Answers, in his case the cause were broken drivers for Iomega drive. While I have quite a lot of devices connected to the computer, I do not have any Iomage drive.

  • Is there any systematic way how could I troubleshoot this problem or identify which particular device is malfunctioning and causing the computer to sleep?
  • Does some documentation for "Microsoft-Windows-Kernel-Power", which would help me understand the exact source of the event?

Suma

Posted 2012-08-01T07:37:40.160

Reputation: 1 307

I have tried setting reserve level to 0 as advised in http://superuser.com/questions/454450/windows-7-goes-into-hibernation-immediately-after-the-ups-kicks-on?rq=1. Did not see any change. I wanted to change the Critical level to 0 %, but the system does not allow me to go below 10 % with this option. I wanted to disable the Critical battery action, but system does not allow me this, it offers only "Shut down" and "Sleep", there is no "Do nothing" for Critical battery action / On battery. :(

– Suma – 2012-08-01T07:58:34.813

4Testing a UPS by pulling the plug out of the wall socket is a bad idea, because you are removing earth ground while a battery source continues to provide 120VAC to the equipment. You have created a potential shock hazard. The safer method is to plug the UPS into a power strip, and use the switch on the power strip to simulate a power outage. – sawdust – 2012-08-01T08:35:48.107

How old is the battery? Sounds very much like it's unable to hold it's charge more than a short time before it reaches 'critical'. – HaydnWVN – 2012-08-01T09:45:51.000

1@HaydnWVN The battery is 6 month old, but this is not a problem. The battery does not go off. It is the system sleeping itself. The battery still contains 85 % when this happens, power outpur is not interrupted, I am able to start the system many times while still running at it, only to have it sleeping in a short moment again. – Suma – 2012-08-01T11:17:14.327

Powercfg.exe -qh will also display power related settings that are not shown within Control Panel. You might want to check if there is something odd. – Tex Hex – 2012-08-09T18:02:22.770

Answers

4

I was not able to solve the issue despite of my efforts. I was not even able to get any more information on the "Microsoft-Windows-Kernel-Power" so far.

The best I could do was a workaround: instead of using native Windows battery management I have installed APCUPSD software and I can no longer observer the issue. With this sotware Windows are not aware of the battery, the APCUPSD controls shutdown directly and I have verified it is not doing so prematurely.

I guess using APC provided PowerChute might work as well, but I did not like the sofware much when I installed it, sounds too much cluttered and obtrusive to me.

Suma

Posted 2012-08-01T07:37:40.160

Reputation: 1 307

1

The most likely answer is, it's intelligently designed. Other than size, if I unplug a UPS and computer from the wall, it is in effect a laptop (computer + battery). The newest power management functions in Windows likely use the USB connection to determine that there is a power loss state (the UPS is unplugged). The power management system then kicks in and does its job reducing the amount of power the system is using, when it's not in use. How about a reason to go along with this?

Let's say you go with friends to see a movie, and leave your computer on. Ten minutes after you leave the house, there is a power failure at your house. No one is using the computer, it goes to sleep (using very little to no power). You return two hours later, discover this, and have time to shut down the computer because there is still enough power left in the battery...

OR

The computer never went to sleep, it used up all the power in the UPS before it was shut down. You have lost everything you were working on.

This is most logically behavior as expected, and I might recommend not trying to change it, in the interest of protecting your computer.

My hypothesis is strongly supported by:

Critical batter action: Sleep

The computer detects a critical action (no more power going into the UPS causes use of the battery, a critical action) and the computer sleeps to conserve power. Please post a picture of the output of the screen below, but open the dropdown that says Sleep>+Sleep after.

enter image description here

Everett

Posted 2012-08-01T07:37:40.160

Reputation: 5 425

2The most likely answer is, intelligent design. There is no reason to get religion involved :) – Scott Chamberlain – 2012-08-09T13:20:49.473

@Scott Chamberlain - Thanks Scott Wiping Coffee off my laptop after laughing with mouth full – Everett – 2012-08-09T13:22:09.910

The problem is the sleep kick in way too early. When I set a critical battery level to 10 %, it should sleep once I have 10 % left, not when I have 90 %. Moreover, when I installed the UPS, I have tested it and it worked as expected. It does not now. I would like to check what was broken meanwhile, but I do not know how. – Suma – 2012-08-09T13:22:27.167

Suma, what you think it should do is irrelevant. It is doing what it is designed to do. This was likely a software update in power manager, as you pointed out, it behaved one way when you first tested it, and behaves this way now. – Everett – 2012-08-09T13:23:46.600

Suma, try changing the critical battery action to hibernate and see if you still have the same problem. If the computer hibernates when you unplug the UPS, you just proved what I said. If not, there may be another setting, so I MAY still be correct (there may be hard coding into the software to force sleep when running on battery)... – Everett – 2012-08-09T13:31:23.643

Apparently APC and Microsoft think I'm correct: http://www.apcmedia.com/salestools/TDOY-5UQVCZ_R2_EN.pdf (page 6)

– Everett – 2012-08-09T13:43:07.513

Here is an in depth analysis of power management functions for Windows7 http://www.sevenforums.com/tutorials/778-power-plan-settings-change.html

– Everett – 2012-08-09T13:48:06.693

I am sorry, but you are wrong. The switch to battery is not a critical state, it never was and it is not now. This is a non-critical state for both laptops and UPS backed computers. None of the documents you link support the notion the computer should sleep immediately once the AC power goes off. – Suma – 2012-08-09T15:00:19.667

I am not complaining it goes to sleep, this is expected. I am complaining it goes to sleep way to early, while the battery is still fully charged and can run the system for another 30 minutes. – Suma – 2012-08-09T15:01:44.983

@Everett To answer your questions I will have to reinstall the native Windows UPS drivers (I am now running acpupds instead), which, as I remember will be a messy procedure, as the system will prefer APC powershute drivers. I will try it, but I have no time for that today. Your theory, if I understand it right, is UPS running without AC is a critical state, which itself is enough to put the computer to sleep ASAP. This is not supported by the references you have linked. If you mean something else, please, explain. – Suma – 2012-08-09T19:58:37.250

1Suma, it appears I owe you an apology. I am working on the idea that a change in state in the UPS is causing a change in which Power management Profile is being used. Your system becomes a giant laptop when the UPS is unplugged. In effect it assumes that running on battery power means use a default profile that a laptop would use. I was able to reproduce what you describe, that's the part I find most interesting. – Everett – 2012-08-09T20:15:14.793

0

Just a guess: I presume you have the UPS plugged into the computer using a USB cable to do notification and monitoring. Check device manager and see if the usb ports/hubs are set for power management. If the computer starts to believe there is a power issue, it could be turning off the usb ports/hubs and you may be loosing signal from the UPS. If that happens, the computer could interpret this as a critical power level event.

Blackbeagle

Posted 2012-08-01T07:37:40.160

Reputation: 6 424

Upvoted, as this sounds like a good idea in general, but unfortunately in my case it did not help. – Suma – 2012-08-03T09:59:18.880

Down voted because it doesn't work this way, and it wouldn't be the cause. Even if the hub/ports are set for power management, the system is changing, which would cause the change you are talking about. The change you are talking about wouldn't be the cause. – Everett – 2012-08-09T17:33:19.833