Determine Why Your Mac Wakes Up From Sleep

Jul 17, 2010 - 76 Comments

Sleeping Mac waking up unprompted

Have you ever put your Mac to sleep, only to find it awake seemingly on it’s own when you return to the machine? I’ve run into this mystery of a randomly waking Mac a few times, and with a few terminal commands you can help track down what caused your Mac to wake from sleep. So if you’re wondering why your Mac is waking from sleep, read on to learn how you can help determine the cause.

Do know there are many reasons why this can happen, sometimes it’s a hardware event that causes the Mac to wake from sleep, sometimes it’s software, and sometimes it is something else. This guide will help to determine the reason for any Mac, iMac, MacBook Air, Pro, etc, waking from a sleep state. Yes it is slightly technical and uses the command line in Mac OS X to look through system logs, and you’ll then need to compare a multiple character ‘wake reason’ code to a list shown below indicating what the actual sleep reason is. Let’s get started.

How to Find Out Why a Mac is Waking From Sleep

Launch the Terminal, found in /Applications/Utilities/ and type the following at the command line exactly, depending on your version of MacOS system software:

For macOS Monterey and Big Sur, try the following command:
pmset -g log |grep "Wake Request"

Which may reveal the direct process or app causing the wake up. Alternatively you can run the following command which also may show the process causing wake, but also the debug code that may help to discover the cause of the system wake:

log show |grep -i "Wake request"

For MacOS Sierra, Mojave, Catalina, and newer, with the new logging system, use the following command:

log show |grep -i “Wake reason”

For MacOS El Capitan, Yosemite, Mavericks, and older, with the traditional syslog command:

syslog |grep -i "Wake reason"

Hit return and you will then see a report from the system logs in Mac OS X that may look something like the following:

Sat Jul 10 08:49:33 MacBookPro kernel[0] : Wake reason = OHC1
Sat Jul 10 17:21:57 MacBookPro kernel[0] : Wake reason = PWRB
Sun Jul 11 08:34:20 MacBookPro kernel[0] : Wake reason = EHC2
Sun Jul 16 18:25:28 MacBookPro kernel[0] : Wake reason = OHC1

Now you’re going to want to look at the code next to the “Wake reason=” text, this is what is going to help to tell you why the computer is waking out of sleep. So what do these wake reason codes mean?

Wake Reason Codes & What They Mean in Mac OS X

We’ll describe each kernel debug wake reason code and what it pertains to, leading you to what is causing the machine to wake up.

  • OHC: stands for Open Host Controller, is usually USB or Firewire. If you see OHC1 or OHC2 it is almost certainly an external USB keyboard or mouse that has woken up the machine.
  • EHC: standing for Enhanced Host Controller, is another USB interface, but can also be wireless devices and bluetooth since they are also on the USB bus of a Mac.
  • USB: a USB device woke the machine up
  • LID0: this is literally the lid of your MacBook or MacBook Pro, when you open the lid the machine wakes up from sleep.
  • PWRB: PWRB stands for Power Button, which is the physical power button on your Mac
  • RTC: Real Time Clock Alarm, is generally from wake-on-demand services like when you schedule sleep and wake on a Mac via the Energy Saver control panel. It can also be from launchd setting, user applications, backups, and other scheduled events.

There may be some other codes (like PCI, GEGE, etc) but the above are the ones that most people will encounter in the system logs. Once you find out these codes, you can really narrow down what is causing your Mac to wake up from sleep seemingly at random.

Note: You can also monitor the Wake Reason codes by looking at the Console if you are not comfortable with the command line. However, in my experience the Console is slower to search and use than the Terminal. This is usually because the default string match search in Console will look through all of your system and applications logs, including those from third parties.

Did you find this useful for tracking down why a Mac woke from sleep? Do you have any other tips or suggestions for discovering similar information? Share with us in the comments below. And thank you to Matt for providing this awesome tip idea!

.

Related articles:

Posted by: William Pearson in Mac OS, Tips & Tricks, Troubleshooting

76 Comments

» Comments RSS Feed

  1. Stu says:

    Utterly absurd that a website can have obviously technically minded writers, but still have “smart quotes” enabled, prevening the useful commands from being copy-pasted.

    Fix it. There’s zero excuse for it. It makes you look like a bunch of clowns.

    • jesselee says:

      I am NOT technically-minded but I need to know date/times when my Macbook was used. When I copy and paste the grey boxes, my Mac shows a wall of text but nothing like the examples provided. Is it bc I’m copying and pasting?

  2. verstaerker says:

    my MacPro wakes up every 6 minutes … in the log this comes every 6 minutes

    2022-02-14 09:04:16.456585+0100 0x12de10 Default 0x0 117 0 powerd: [powerd:wakeRequests] Selected RTC wake request: {

    Does anyone know how i can further track down what’s causing this?

  3. verstaerker says:

    my MacPro wakes up every 6 minutes … in the log this comes every 6 minutes

    2022-02-14 09:04:16.456585+0100 0x12de10 Default 0x0 117 0 powerd: [powerd:wakeRequests] Selected RTC wake request: {

    Does anyone know how i can further track down what’s causing this?

  4. Julia says:

    Hallo Robin, ich hab auch das Problem mit dem Spit user und kann leider garnichts dazu im Internet finden, nur diesen Beitrag hier. Mein Mac wacht ständig auf.. Hast du damals eine Lösung dazu gefunden? Danke und viele Grüße :)

  5. Kerri says:

    I am getting this and have not idea why. This started after i downloaded the newest operating system
    iMac:~ ciarrai$ syslog |grep -i “Wake reason”
    NOTE: Most system logs have moved to a new logging system. See log(1) for more information.
    iMac:~ ciarrai$
    What new logging system?

  6. Robin says:

    What does the message AM kernel: Wake reason: SPIT (User) mean??

  7. Jim Lee says:

    Not a single one of these has provide a clue that fixed my issue. Been all over System Preferences. Looked at WiFI, Energy Saver, But Tooth, Network, Desktop & Screen Savers. Turned off everything I can think of. Still wakes up for no reason.

  8. Daniel says:

    try this one with macOS High Sierra: log show –style syslog | fgrep “Wake reason”

  9. Laurel says:

    I just updated to OS X High Sierra. So the old terminal command didn’t work, but the new one you gave didn’t work either. The response I got was:

    grep: reason”: No such file or directory

    Help! Why does my computer wake up after I put it to sleep?

    • Paul says:

      The command must be inputted correctly into the Terminal.

      The proper syntax for syslog is:

      syslog |grep -i "Wake reason"

      You can also try the console or log command.

      log show |grep -i "Wake reason"

      The command line requires exact syntax otherwise the commands will not work properly. If you are unfamiliar with the command line, it is best not to use it.

      You can manually look around in your “Console” application as well, found via Spotlight or in Utilities folder.

  10. Rob says:

    If you get the message:

    NOTE: Most system logs have moved to a new logging system. See log(1) for more information.

    then this command will work for you:

    log show | grep -i “Wake reason”

  11. Monica says:

    NOTE: Most system logs have moved to a new logging system. See log(1) for more information.
    grep: reason”: No such file or directory

    My Mac turns on by itself with a black screen sometimes, but when I put it to sleep it goes to sleep but then the screen lights up about a minute after. Need help!

  12. Asu says:

    I get a “Most system logs have moved to a new logging system. See log(1) for more information.” message. What does it mean?

  13. Domenic says:

    This is killing me. Literally. Like wakes then sleeps every 30 seconds. Ran the terminal and. Its def an RTC. Although i have no scheduled back ups, sleep timer, alarms or anything of the sought. Help :(

  14. Chris Cogdon says:

    Just in case someone’s searching for this, I found one reason why my Mac Pro was not going to sleep: the display would shut down, but the keyboard/mouse would stay powered up, and the power light on the Mac would not switch to “sleeping”.

    The reason was the printer driver: It had gotten into a state where a print job that was polling for my printers supply-level state had stalled. It makes sense that you don’t want your computer shutting down in the middle of a print job, but this one was never going to complete.

    I had found the problem by firstly noticing that there was a CPU spike every minute or so, and then wrote a quick program to capture the output of “ps” every 10 seconds. Found the culprit as one of the printing processes. Once found, I saw that in the print dialog the printer was marked as something like “Idle, Processing”, which seemed odd.

    Since there was no actual job in the print queue, I could only solve the problem using “Reset printing system…” (Right-click or control-click in the list of printers window).

  15. Mohamed says:

    This article was so helpful to me!

  16. Elaine says:

    I am trying to find out if my iMac wakes when I am not in the house, I type in wake reason in Console and get nothing just a blank page How can I get this to show me what I want

  17. Brett says:

    Hello there

    I get XHC1. For me, if i put my Mac to sleep and then leave the house I come back to find the music playing. Anyone know of any settings in Music program that could be causing this issue?

  18. Mike says:

    Hi everyone I am on snow leopard and am getting this
    Wake reason=us I dont know what this means by the way it is a 2006 MacBook Core Duo

  19. […] of the time since that alone can give you the information you’re looking for. Furthermore, by reading the wake reasons you’ll be able to see how the Mac was woken up and by what method. For example, Mac laptops […]

  20. Billy Gard says:

    My computer is a macbook with Leopard 10.5.8. Nothing is connected to the machine except a power supply. No bluetooth devices are present.

    In the middle of the night I heard the disk making its humming sound when the lid was closed. The computer woke. When I opened it the screen stayed blank, like the computer crashed in some weird way. So I did a cold reboot. It did a Hum-Hum-Chime sequence twice before successfully rebooting.

    In a previous situation the computer woke while closed, and the fan was running furiously as if it were hot. It had to be rebooted then as well.

    The “Wake for ethernet network administrator access” is set, but nothing is plugged in the ethernet. Something would have to wake it up through the airport.

  21. Sheldon says:

    I was having this same problem and the wake reason that I was getting was XHC1, which appears to be related to the USB ports on my MacBook Pro. In my case, the culprit was a hard drive docking station that was turned on, but did not have a hard drive plugged into it at the time and was not making any noise so I had no idea it was still on. I also had no idea that it would try to communicate so actively with my computer. I hope this saves somebody out there and a lot of frustration.

  22. terry says:

    Thank you so much for this post, finally solved that problem w my MBA, now all i have to do is remember to unplug my usb hub Before I close the lid!

  23. cmcc says:

    Thanks for this post, just wanted to post in case it helps others out.
    I had the same problem with an early 2009 Mac Pro.
    The problem turned out to be an extra keyboard that I had connected directly to the back USB ports of the MAC.

  24. Sam says:

    For other’s reference, USB devices include iSight, IR port (remote IR receiver), keyboard and trackpad, and bluetooth.
    My Core Duo macbook has USB7 wake reasons which can be cross referenced with the USB section of the Apple Utility “System Profiler”. Look through the USB bus sections until you see Bus Number 0x7d for example. In my case this is the bluetooth module which is failing and giving weird on/off issues and of course making the computer wake up. Might have to remove or found out how to disable this…

  25. Guest says:

    Mac OS X 10.4, doesn’t work.

    syslog does provide a log, but it doesn’t have any entries for “wake reason” even during the time when it did wake up.

  26. John says:

    I’m running Terminal and it’s telling me “: Wake reason = USB7” or sometime with “USB4.” However, I have no USB elements plugged into my laptop. Any ideas, people?

  27. […] the wake reason is. In Lion the terminal commando is: syslog | grep -i "wake reason" Determine Why Your Mac Wakes Up From Sleep Tell us how you install? Retail? Which extra kexts are you using? Maybe you need a clean install? […]

  28. allan says:

    Ok, nvm, it worked with

    syslog | grep -i “wake reason”

    HOWEVER, I’ve found that EHC could also mean when your macbook is with the lid open and in sleep mode. When you press any button and it wakes up, thats going to show up in the logs as EHC2.

  29. allan says:

    NONE of the commands work on lion!!! I’m desperate!!!

    All of them give me no response or the no file in directory thing.

    • Anic297 says:

      Do like me: avoid the Terminal and search in the Console. Why wasting time with so abstract things that are Unix commands?

  30. Thanks. What is the following? “Fri Jan 6 17:16:19 npxpstndrd218 kernel[0] : Wake reason = EC LID0”

    The name of my computer is different and there are only a few of these mixed in. My problem is that when I close my computer the apple goes dark then turns back on and the drive starts spinning until I open it in which case it goes into sleep mode for about a minute.

  31. Raoul says:

    syslog | grep -i “wake reason” is the correct command!

  32. Sean says:

    I am running Lion 10.7.2 on a Mac Pro. This problem of randomly waking only started after installing Lion. I’ve tried the following commands:

    syslog |grep -i “Wake reason =”
    no response

    syslog |grep -i “Wake reason:”
    response: grep: reason:”: No such file or directory

    syslog |grep -i “Wake”
    no response

    While I’d like to find this article useful, none of the commands mentioned are working at all. Any other ideas?

  33. […] OS X daily provides a detailed article on what the different wake reason short codes mean. RTC stands for the […]

  34. Nachi says:

    I am facing the same problem, but it happens only when on power and not on batteries. When on power and the lid is closed, the sleep light goes on and off exactly 6 time and it wakes up by its own and goes back to sleep again. And the loop is end less.

    But only when connected to power, That means any external factor like Bluetooth or Keyboard or wireless or usb are not the problem( Though I do not use any of them)

  35. Aaron says:

    Mine just says:

    Nov 25 13:12:28 AaronsiMac kernel[0] : Wake reason: ? (User)
    Nov 26 01:04:50 AaronsiMac kernel[0] : Wake reason: ? (User)
    Nov 26 03:58:09 AaronsiMac kernel[0] : Wake reason: ? (User)
    Nov 27 10:58:50 AaronsiMac kernel[0] : Wake reason: ? (User)
    Nov 27 18:32:55 AaronsiMac kernel[0] : Wake reason: ? (User)
    Nov 27 20:38:28 AaronsiMac kernel[0] : Wake reason: ? (User)
    Nov 27 22:41:37 AaronsiMac kernel[0] : Wake reason: ? (User)

    So I’m not quit sure where to go from that information. Has anyone else seen anything like this?

  36. Daniel says:

    Try this…

    syslog |grep -i “Wake”

  37. Greg says:

    None of those strings are getting me any results …. :-(

  38. Diogo says:

    For those of you aren’t getting any response, the right string (on Lion, I suppose) is “Wake reason :”.

  39. Hans says:

    I’m having the same issues with my iMac. And I’ve tried the Terminalcommand. But it gives me this response:

    syslog: unknown option “|grep”
    run “syslog -help” for usage

    [Proces voltooid]

    I’m definitely no expert. Has anyone a clue? Should I use another command after “syslog”?

    Thanks,

    Hans

  40. Karmela says:

    Does a command like this exist for seeing what wakes the display?

  41. Drew says:

    Mine just says: Thu Sep 15 22:05:37 andrew-pulidos-imac-2 kernel[0] : Wake reason = EC

    is EC = Enhanced Controller? I had the airport off and bluetooth off, and my Imac still wakes immediately after I put it to sleep. any suggestions?

  42. Joe says:

    Thanks, Caspar! I ran into that same thing and was just about to post about it.

    What the heck; I’ll post it too.

    In Lion, try typing this:
    syslog |grep -i “Wake reason”

  43. Caspar says:

    In Lion (10.7) something changed. They changed “Wake reason =” to “Wake reason:” so the command under Lion should be:

    syslog |grep -i “Wake reason:”

  44. Andrei says:

    Anyone having tho sleep – wake problem try the following:
    open up your Terminal and enter:
    sudo pmset -a lidwake 0

    This will stop your laptop from waking up when lid is lifted – you will have to push your keyboard, but it worked for me and I’ve tried all solutions I could шватв – doubt 20 all together. I cannot guarantee this worked with 100% certainty because it hasn’t been 2 weeks since implemented, but try it and if it doesn’t work change it back if you prefer.

  45. Mons says:

    My new iMac also wokes up from sleep.

    When i run the terminal script, I can see the times when it woke up. When I look in console the same times are there, and the first line says:
    m.skype.skype[188] WirelessAttach’: IOServiceOpen error: e00002c7.

    Is it skype that wakes up my mac?

  46. Miles says:

    Thanks for this tip. My new MBP + cinema display is waking from sleep, but my 2007 MBP was doing this as well for over 2 years.

    Log reveals that EHC1 is waking my machine, and at 4 AM last night woke it every few minutes until I finally pulled the power cord out.

    EHC2 seems to be a BT trigger, so EHC1 covers my USB devices. Will be unplugging them one at a time until (if) the problem goes away. Maybe it’s a peripheral that doesn’t play nice, but I am not optimistic.

  47. Tolga says:

    Hello,

    I have been working on sleep issues on my MacBook Pro, OS X 10.6.6. After I uninstalled HP Printer and WD External Disk programs, now my MBP sleeps but it goes to sleep very late. For example, I set Energy Saving to 2 minutes to sleep. But my MBP goes to sleep after 15 minutes instead of set 2 minutes. Why is it so ? How can I solve this problem ? Here is the console messages, so that hopefully someone can help me with this issue. In this console log, I leave alone my MacBook Pro at 12:26 PM and first time I see a message about Sleep at 12.34 PM. I should have see a sleep message at 12:36 PM, because it is set for sleep 2 minues in Energy Saving settings.

    24.01.2011 12:26:46 [0x0-0x3c03c].com.apple.systempreferences[378] Couldn’t find any matches.
    24.01.2011 12:27:23 Firewall[57] Stealth Mode connection attempt to UDP 192.168.1.5:60251 from 208.67.222.222:53
    24.01.2011 12:30:16 Firewall[57] Stealth Mode connection attempt to UDP 192.168.1.5:50148 from 208.67.222.222:53
    24.01.2011 12:32:59 awacsd[70] EAP-GTC failed. Retrying in 3600 seconds.
    24.01.2011 12:34:57 configd[13] PowerManagement configd: System Sleep prevented by active remote login session (120 second threshold).
    24.01.2011 12:34:57 configd[13] PowerManagement configd: tty sleep preventer: /dev/ttys000
    24.01.2011 12:34:58 kernel PM notification cancel (pid 13, configd)
    24.01.2011 12:34:58 kernel IOPMrootDomain: idle cancel
    24.01.2011 12:35:37 Firewall[57] Stealth Mode connection attempt to UDP 192.168.1.5:61473 from 208.67.222.222:53
    24.01.2011 12:40:34 kernel hibernate image path: /var/vm/sleepimage
    24.01.2011 12:40:34 kernel sizeof(IOHibernateImageHeader) == 512
    24.01.2011 12:40:34 kernel Opened file /var/vm/sleepimage, size 4294967296, partition base 0xc805000, maxio 400000 ssd 0
    24.01.2011 12:40:34 kernel hibernate image major 14, minor 2, blocksize 512, pollers 5
    24.01.2011 12:40:34 kernel hibernate_alloc_pages flags 00000000, gobbling 0 pages
    24.01.2011 12:40:34 kernel hibernate_setup(0) took 0 ms
    24.01.2011 12:40:35 kernel AirPort: Link Down on en1. Reason 8 (Disassociated because station leaving).
    24.01.2011 12:40:35 kernel [0f96a980][AppleMultitouchDevice::willTerminate] entered
    24.01.2011 12:40:35 kernel [0f96a980][AppleMultitouchDevice::stop] entered
    24.01.2011 12:40:35 kernel System SafeSleep
    24.01.2011 12:40:42 kernel hibernate_page_list_setall start 0x44409000, 0x44428000
    24.01.2011 12:40:42 kernel hibernate_page_list_setall time: 202 ms
    24.01.2011 12:40:42 kernel pages 567743, wire 74756, act 176978, inact 893, spec 177, zf 3026, throt 0, could discard act 55041 inact 74176 purgeable 19300 spec 163396
    24.01.2011 12:40:42 kernel hibernate_page_list_setall found pageCount 255830
    24.01.2011 12:40:42 kernel IOHibernatePollerOpen, ml_get_interrupts_enabled 0
    24.01.2011 12:40:42 kernel IOHibernatePollerOpen(0)
    24.01.2011 12:40:42 kernel writing 254650 pages
    24.01.2011 12:40:42 kernel encryptStart 2e270
    24.01.2011 12:40:42 kernel encryptEnd 4979820
    24.01.2011 12:40:42 kernel image1Size 135123456, encryptStart1 2e270, End1 4979820
    24.01.2011 12:40:42 kernel encryptStart 80dd200
    24.01.2011 12:40:42 kernel encryptEnd 1b343de0
    24.01.2011 12:40:42 kernel PMStats: Hibernate write took 6005 ms
    24.01.2011 12:40:42 kernel all time: 6005 ms, comp time: 1761 ms, deco time: 0 ms,
    24.01.2011 12:40:42 kernel image 456408576, uncompressed 1043312640 (254715), compressed 454224304 (43%), sum1 32212469, sum2 e1de75ed
    24.01.2011 12:40:42 kernel wired_pages_encrypted 39896, wired_pages_clear 33745, dirty_pages_encrypted 181074
    24.01.2011 12:40:42 kernel hibernate_write_image done(0)
    24.01.2011 12:40:42 kernel sleep

    Thanks,
    Tolga

  48. majec says:

    Hi there! After switching to a new mac mini i encountered a problem i had before when my mac was awakening itself with no reason or any applications applied…Finally ,after reading lots of unhelpfull remedies i remembered what was causing the problem,In System Prefs go to Bluetooth and uncheck “Allow Bluetooth devices to wake-up this computer”.This should solve 99,99 % problems with waking up bu itself, in my opinion.To wake up you just need to press the power button and wait a little longer for the bluetooth mouse response ,but there are programds which can speed it up… :)

    • Ron says:

      Thank you majec, unchecking this bluetooth box solved the problem

    • Hal says:

      majec, you’re awesome.

    • amazingrobie says:

      It’s the year 2016 and I’m still enjoying Snow Leopard on a Steve Jobs-era mid-2011 iMac. Ran across this sleep/wake problem just this year and I am so thankful that this article and it’s comments are still up. Thanks from 2016 for the knowledge from 2010! You’re awesome.

  49. Amy says:

    Awesome, thanks :)

  50. David says:

    I recently bought a 27″ iMac. Never had any wake-up problems before, but this new iMac, with Snow Leopard, regularly wakes up: last night, according to the log, it woke up four times. The syslog indicates two reasons, EHC2 and RTC, but these don’t say how to correct the problem, of course! Could it have something to do with the wireless (Bluetooth) mouse and keyboard?

  51. stendec says:

    Sat Aug 21 07:06:40 IgorMacBook kernel[0] : Wake reason = UHC3
    Sat Aug 21 10:50:59 IgorMacBook kernel[0] : Wake reason = UHC3
    Sat Aug 21 12:12:42 IgorMacBook kernel[0] : Wake reason = UHC3
    Sat Aug 21 12:20:07 IgorMacBook kernel[0] : Wake reason = UHC3
    Sun Aug 22 09:11:37 IgorMacBook kernel[0] : Wake reason = UHC3
    Sun Aug 22 13:13:14 IgorMacBook kernel[0] : Wake reason = UHC3

    I always get UHC3. what is that? how to solve it?

    • Anic297 says:

      UHC3 is one USB port of your Mac. If you install Apple Developer Tools, you’ll have two apps for figuring out which it is. I don’t know of any other way to discover that (even System Information doesn’t tell).

  52. Alex C says:

    My MacBook must have a short in the keyboard or something, since I’ve tried everything I found and it always wakes immediately after sleeping, with wake reason = OHC1 and the message “The USB device Apple Internal Keyboard / Trackpad (Port 6 of Hub at 0x4000000) may have caused a wake by issuing a remote wakeup” — even when I’ve got no external USB devices plugged in. If anyone knows a way to disable waking on keyboard input, please let me know at this support forum thread: http://discussions.apple.com/thread.jspa?messageID=11593780

  53. ToeKnee says:

    quick update, seem to have figured this out – in /Library/Preferences/SystemConfiguration/com.apple.PowerManagement.plist, changing keys called “TTYSPreventSleep” from 1 to 0 solved my issue. Not sure why, just saying. YMMV.

  54. ToeKnee says:

    Good info, but my current issue with waking gives a blank wake code, as in:
    7/21/10 12:18:31 AM kernel System Sleep
    7/21/10 12:18:55 AM kernel Wake reason =
    7/21/10 12:18:55 AM kernel System Wake

    arggggg

  55. tico says:

    Nice tip.

    Thanks. ;)

Leave a Reply

 

Shop on Amazon.com and help support OSXDaily!

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates

Tips & Tricks

News

iPhone / iPad

Mac

Troubleshooting

Shop on Amazon to help support this site