Find out why your Mac wakes up

Wake

When we put a Mac to sleep the last thing that interests us is that it automatically exit it, but sometimes it happens, especially starting with OS X Lion since new characteristics have been introduced that favor the possible appearance of this problem. Let's see how we can remedy it.

Identifying

To locate the problem We are going to make use of a simple terminal command that will search the length and width of our system log for the reason why the Mac comes out of sleep. To do this, we open Terminal and execute the following:

syslog | grep -i "Wake reason"

After that we will obtain all the recent dates in which the Mac woke up, and with it the reason, although you may not fully understand the reason. For this you can support yourself from these points:

  • OHC: Open Host Controller, probably through a USB, Thunderbolt or FireWire port. If it shows OHC1 or OHC2 it may be the mouse or keyboard.
  • EHC: Enhanced Host Controller, also referred to USBs and Bluetooth devices.
  • USB: A USB was the cause of coming out of sleep.
  • LID0: If you have a MacBook, then the lid has been lifted, there is no more mystery.
  • PWRB: Power button.
  • RTC: RealTime Clock Alarm, used by services such as reminders, calendar or the economizer panel. Check that you don't have anything scheduled.
  • XHC1: Usually Bluetooth, possibly an automatic disconnection or connection.
  • ARPT: Network connections made while idle (allowed in the economizer).

Now you just have to try to locate the problem and solve it. The most common case of all is the option "Activate the computer to allow access to the network" on the panel Saver, which makes connections every hour. In my case, it was deactivate it and the sleepless nights on my Mac disappeared.