iMac will not go to sleep

Discussion in 'iMac' started by MrViking, Jun 18, 2012.

  1. MrViking, Jun 18, 2012
    Last edited: Jun 18, 2012

    macrumors member

    Joined:
    Jul 16, 2011
    #1
    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
     
  2. macrumors regular

    Joined:
    Jun 29, 2010
    #2
    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.
     
  3. thread starter macrumors member

    Joined:
    Jul 16, 2011
    #3
    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.. :(
     
  4. macrumors regular

    Joined:
    Jun 29, 2010
    #4
    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.
     
  5. MrViking, Jun 18, 2012
    Last edited: Jun 18, 2012

    thread starter macrumors member

    Joined:
    Jul 16, 2011
    #5
    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!
     
  6. Set845, Jun 18, 2012
    Last edited: Jun 18, 2012

    macrumors regular

    Joined:
    Jun 29, 2010
    #6
    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.
     
  7. macrumors newbie

    Joined:
    Jul 27, 2010
    #7
    When mine refused to sleep that was the reason.
     
  8. macrumors newbie

    Joined:
    Nov 3, 2011
    Location:
    New Zealand
    #8
    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.
     
  9. thread starter macrumors member

    Joined:
    Jul 16, 2011
    #9
    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 :)
     
  10. macrumors 6502

    jota73

    Joined:
    Apr 19, 2006
    Location:
    South America
    #10
    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
     
  11. macrumors regular

    Joined:
    Jun 29, 2010
    #11
    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.
     
  12. macrumors 6502

    jota73

    Joined:
    Apr 19, 2006
    Location:
    South America
    #12
    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
     
  13. macrumors regular

    Joined:
    Jun 29, 2010
    #13
    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".
     
  14. macrumors 6502

    jota73

    Joined:
    Apr 19, 2006
    Location:
    South America
    #14
    Set845

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

    Thanks
     
  15. macrumors regular

    Joined:
    Jun 29, 2010
    #15
    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.
     
  16. macrumors 6502

    jota73

    Joined:
    Apr 19, 2006
    Location:
    South America
    #16
    Set845,

    you have been really helpful.

    Thanks.
     
  17. macrumors newbie

    Joined:
    Mar 20, 2013
    Location:
    Kent, UK
    #17
    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.
     

Share This Page