Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Hardware > Desktops > iMac

Reply
 
Thread Tools Search this Thread Display Modes
Old Jun 18, 2012, 10:00 AM   #1
MrViking
macrumors member
 
Join Date: Jul 2011
iMac will not go to sleep

Hello,

My iMac does not go to sleep automatically. Not when i'm running Lion nor when running Windows 7. Only if i select "sleep" it does, automatically it does not anymore.

I disabled all sharing stuff, WOL etc. Reset the SMC and PRAM.

I now formatted and then reinstalled from the recovery partition.

Still it doesn't go to sleep. The display dims but i still hear the machine's HDD + fans.

Can anyone help me as where to find a culprit or reason for this behaviour?

27" 2011 iMac

Thank you

Last edited by MrViking; Jun 18, 2012 at 10:07 AM.
MrViking is offline   0 Reply With Quote
Old Jun 18, 2012, 11:09 AM   #2
Set845
macrumors regular
 
Join Date: Jun 2010
I had the same problem with my mid 2011 27 inch i7 imac. To find out what is preventing sleep open Console and search Wake Reason in the kernel log. If you find a Wake Reason event that returns a code you can google it to find the meaning of the code. You can also check to see if there is anything in your Launch Agent folder in both system and user libraries. Also check your startup items in your Users Preference pane.
Set845 is offline   2 Reply With Quote
Old Jun 18, 2012, 11:21 AM   #3
MrViking
Thread Starter
macrumors member
 
Join Date: Jul 2011
Quote:
Originally Posted by Set845 View Post
I had the same problem with my mid 2011 27 inch i7 imac. To find out what is preventing sleep open Console and search Wake Reason in the kernel log. If you find a Wake Reason event that returns a code you can google it to find the meaning of the code. You can also check to see if there is anything in your Launch Agent folder in both system and user libraries. Also check your startup items in your Users Preference pane.
Thanks for the advice.

Couldn't find anything in the logs though :<

The problem is, i formatted (no apps left) and the problem was the same under bootcamp.

I am pretty clueless right now..
MrViking is offline   0 Reply With Quote
Old Jun 18, 2012, 11:52 AM   #4
Set845
macrumors regular
 
Join Date: Jun 2010
I'm not in front of my iMac right now so forgive me if I get this wrong. Check your Bluetooth settings. Try turning off wake with Bluetooth. Sorry I can't remember the correct term. If you have a Bluetooth mouse/trackpad then you won't be able to wake or log on the Mac. But this is just a test. Wake the Mac with the power button and don't bother to try logging on. Wait for the monitor to dim, give it a few minutes and then listen for the fans. If it in fact goes to sleep then the problem is Bluetooth. Maybe the keyboard or mouse, or the USB controller that Bluetooth is on. You will need a USB keyboard and mouse to log back on to enable wake on bluetooth again. Sometimes changing a setting like that and changing it back can fix it.

----------

Oops scratch that last part. You won't need a USB keyboard and mouse. You can wake the Mac with the power button. Sorry I'm sitting in a dentist waiting room right now. Not the best place to give advise from.
Set845 is offline   1 Reply With Quote
Old Jun 18, 2012, 05:02 PM   #5
MrViking
Thread Starter
macrumors member
 
Join Date: Jul 2011
Quote:
Originally Posted by Set845 View Post
I'm not in front of my iMac right now so forgive me if I get this wrong. Check your Bluetooth settings. Try turning off wake with Bluetooth. Sorry I can't remember the correct term. If you have a Bluetooth mouse/trackpad then you won't be able to wake or log on the Mac. But this is just a test. Wake the Mac with the power button and don't bother to try logging on. Wait for the monitor to dim, give it a few minutes and then listen for the fans. If it in fact goes to sleep then the problem is Bluetooth. Maybe the keyboard or mouse, or the USB controller that Bluetooth is on. You will need a USB keyboard and mouse to log back on to enable wake on bluetooth again. Sometimes changing a setting like that and changing it back can fix it.

----------

Oops scratch that last part. You won't need a USB keyboard and mouse. You can wake the Mac with the power button. Sorry I'm sitting in a dentist waiting room right now. Not the best place to give advise from.
Thank you for the advice. I installed the "pleasesleep"-app and that helped, but it shouldn't be necessary for the machine. So after de-installing that app it worked sometimes. But now it doesn't anymore :/

The screen dims, the HDD rattles (saving something?) and then nothing... I unchecked the bluetooth wake.

Probably have to bring it to an APR..

Hope the dentist didn't hurt you too bad

----------



hmm screen turns off. After a while I hear the hardisk spin down and click, as it is turning off... but then it spins up again and i can clearly hear it's on!

Last edited by MrViking; Jun 18, 2012 at 05:08 PM.
MrViking is offline   0 Reply With Quote
Old Jun 18, 2012, 07:43 PM   #6
Set845
macrumors regular
 
Join Date: Jun 2010
Copy and paste this in Terminal

pmset -g assertions

then hit Enter.

That will tell you if there are any conditions keeping the Mac awake. If PreventSystemSleep and/or PreventUserIdleSystemSleep returns a 1 then the command should display the reason. They should return a 0. EnableIdleSleep should return a 1. Did you check the LaunchAgent folders in both user and system library? I once found a plist file there for a printer driver that was keeping my Mac awake.

Oh and speaking of printers. If you have one, it's possible that a print job could be stuck in the print spooler keeping the Mac awake.

Last edited by Set845; Jun 18, 2012 at 07:58 PM.
Set845 is offline   0 Reply With Quote
Old Jun 19, 2012, 02:18 AM   #7
mapollo2112
macrumors newbie
 
Join Date: Jul 2010
Quote:
Originally Posted by Set845 View Post
Oh and speaking of printers. If you have one, it's possible that a print job could be stuck in the print spooler keeping the Mac awake.
When mine refused to sleep that was the reason.
mapollo2112 is offline   0 Reply With Quote
Old Jun 19, 2012, 03:10 AM   #8
NZPilgrim
macrumors newbie
 
Join Date: Nov 2011
Location: New Zealand
I used to have a similar issue as well. Mine was a USB wireless receiver for a second mouse I was using. Whatever the polling period was was just enough to prevent my Mac from going to sleep unless I specifically slept it. And then it would wake the machine up anyway. Pulled the receiver from the Mac, no more issues.

Also, I tried finding the wake reason but nothing was showing up in the activity monitor. Turns out I had to log in with my Admin account for those events to show up. If you're using a standard account you likely won't see much at all.
__________________
There are 10 types of people in the world. Those that understand binary, and those that don't.
NZPilgrim is offline   0 Reply With Quote
Old Jun 24, 2012, 08:37 PM   #9
MrViking
Thread Starter
macrumors member
 
Join Date: Jul 2011
Quote:
Originally Posted by NZPilgrim View Post
I used to have a similar issue as well. Mine was a USB wireless receiver for a second mouse I was using. Whatever the polling period was was just enough to prevent my Mac from going to sleep unless I specifically slept it. And then it would wake the machine up anyway. Pulled the receiver from the Mac, no more issues.

Also, I tried finding the wake reason but nothing was showing up in the activity monitor. Turns out I had to log in with my Admin account for those events to show up. If you're using a standard account you likely won't see much at all.
Thank you for all the advice, it appears after a reinstall and doing some things with the sharing settings, removing some apps etc. it's fixed :-)
MrViking is offline   0 Reply With Quote
Old Jun 26, 2012, 07:04 AM   #10
jota73
macrumors 6502
 
Join Date: Apr 2006
Location: South America
Quote:
Originally Posted by Set845 View Post
Copy and paste this in Terminal

pmset -g assertions

then hit Enter.

That will tell you if there are any conditions keeping the Mac awake. If PreventSystemSleep and/or PreventUserIdleSystemSleep returns a 1 then the command should display the reason. They should return a 0. EnableIdleSleep should return a 1. Did you check the LaunchAgent folders in both user and system library? I once found a plist file there for a printer driver that was keeping my Mac awake.

Oh and speaking of printers. If you have one, it's possible that a print job could be stuck in the print spooler keeping the Mac awake.
Set845,

I did as you said, and I got the following:

pmset -g assertions
Last login: Sun Jun 24 10:09:20 on console
Juan-Fernando-Vallejos-iMac:~ jota$ pmset -g assertions
26/06/12 6:57:14 GMT-05:
Assertion status system-wide:
PreventUserIdleDisplaySleep 1
CPUBoundAssertion 0
DisableInflow 0
ChargeInhibit 0
PreventSystemSleep 0
PreventUserIdleSystemSleep 0
ExternalMedia 0
DisableLowPowerBatteryWarnings 0
EnableIdleSleep 1
NoRealPowerSources_debug 0
UserIsActive 0
ApplePushServiceTask 0

Listed by owning process:
pid 367: [0x0000016f012c0043] PreventUserIdleDisplaySleep named: "com.apple.WebCore: HTMLMediaElement playback"

I see there might be one issue... coould you tell me what else I must do?

Besides this, I get 5 kernel assertions

thanks
Juan
jota73 is offline   0 Reply With Quote
Old Jun 26, 2012, 01:26 PM   #11
Set845
macrumors regular
 
Join Date: Jun 2010
Quote:
Originally Posted by jota73 View Post
Set845,

I did as you said, and I got the following:

pmset -g assertions
Last login: Sun Jun 24 10:09:20 on console
Juan-Fernando-Vallejos-iMac:~ jota$ pmset -g assertions
26/06/12 6:57:14 GMT-05:
Assertion status system-wide:
PreventUserIdleDisplaySleep 1
CPUBoundAssertion 0
DisableInflow 0
ChargeInhibit 0
PreventSystemSleep 0
PreventUserIdleSystemSleep 0
ExternalMedia 0
DisableLowPowerBatteryWarnings 0
EnableIdleSleep 1
NoRealPowerSources_debug 0
UserIsActive 0
ApplePushServiceTask 0

Listed by owning process:
pid 367: [0x0000016f012c0043] PreventUserIdleDisplaySleep named: "com.apple.WebCore: HTMLMediaElement playback"

I see there might be one issue... coould you tell me what else I must do?

Besides this, I get 5 kernel assertions

thanks
Juan
It looks like some process is preventing your display from sleeping thereby keeping your Mac awake. Try this to list info about process 367.

ps -ax | grep 367

Then hit Enter.
Set845 is offline   0 Reply With Quote
Old Jun 26, 2012, 10:17 PM   #12
jota73
macrumors 6502
 
Join Date: Apr 2006
Location: South America
Quote:
Originally Posted by Set845 View Post
It looks like some process is preventing your display from sleeping thereby keeping your Mac awake. Try this to list info about process 367.

ps -ax | grep 367

Then hit Enter.
Here is the result of ps -ax | grep 367

367 ?? 182:03.22 /System/Library/StagedFrameworks/Safari/WebKit2.framework/WebProcess.app/Contents/MacOS/WebProcess /System/Library/StagedFrameworks/Safari/WebKit2.framework/WebKit2 -type webprocess -servicename com.apple.WebKit.WebProcess-365-0x11074f1e0 -localization es_ES
3679 ?? 0:00.62 /Applications/iTunes.app/Contents/MacOS/iTunesHelper.app/Contents/MacOS/iTunesHelper -psn_0_655520
31296 ttys000 0:00.00 grep 367
jota73 is offline   0 Reply With Quote
Old Jun 26, 2012, 11:30 PM   #13
Set845
macrumors regular
 
Join Date: Jun 2010
It does look as if some WebProcess is the culprit. iTunes helper is also listed. Try removing it (and anything else) from your Login Items in Users & Groups System Preference Pane. Did you search for "Wake Reason" in Console kernel log? See post 2. You can also search "sleep".
Set845 is offline   0 Reply With Quote
Old Jun 27, 2012, 04:16 PM   #14
jota73
macrumors 6502
 
Join Date: Apr 2006
Location: South America
Quote:
Originally Posted by Set845 View Post
It does look as if some WebProcess is the culprit. iTunes helper is also listed. Try removing it (and anything else) from your Login Items in Users & Groups System Preference Pane. Did you search for "Wake Reason" in Console kernel log? See post 2. You can also search "sleep".
Set845

Thanks, could you tell me how to I remove such? I not as agile when doing this.

Thanks
jota73 is offline   0 Reply With Quote
Old Jun 27, 2012, 06:26 PM   #15
Set845
macrumors regular
 
Join Date: Jun 2010
Open System Preferences (in the dock by default). Click on Users & Groups. Click the Login Items button. On the right side window highlight iTunesHelper and press the minus button (on the bottom of the window) to remove it. Highlight and remove any other items that may be listed. You can easily add them back by way of the plus button.
Set845 is offline   0 Reply With Quote
Old Jun 27, 2012, 08:15 PM   #16
jota73
macrumors 6502
 
Join Date: Apr 2006
Location: South America
Set845,

you have been really helpful.

Thanks.
jota73 is offline   0 Reply With Quote
Old Mar 20, 2013, 05:40 PM   #17
imac331731
macrumors newbie
 
Join Date: Mar 2013
Location: Kent, UK
I had the same problem and followed the steps via terminal and mine was down to having internet sharing switched on. My iMac would stay on with the screen off at night and all I could hear was the hard drive and fan going. Now pure silence.

Thank you for the useful and easy to follow instructions.
imac331731 is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Hardware > Desktops > iMac

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
iMac will not stay in sleep dlewis23 iMac 5 Dec 12, 2013 10:28 AM
iMac does not want to go to sleep MacMythos iMac 2 Dec 11, 2013 05:21 PM
G4 Imac display sleep? dirkblaze PowerPC Macs 0 Oct 30, 2012 10:40 AM
iMac sleep issue mrskullfreak iMac 2 Sep 28, 2012 12:13 PM
iMac slow to come out of Sleep? MBM007 OS X 10.8 Mountain Lion 11 Aug 3, 2012 08:32 PM

Forum Jump

All times are GMT -5. The time now is 06:12 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC