Macbook wakes up immediately (OHC1)

macbook prosleep-wake

I have problems with my white unibody MacBook (13-inch, Late 2009, 10.10.1) – it can't go to sleep. I've read dozens of forum threads and could not fix it:

I've reseted PRAM/NVRAM. I've disconnected every USB device, disabled Bluetooth and Wi-fi but after about 15 seconds of black screen preparing-to-sleep it turns back on. I see the same lines in console logs:

kernel[0]: Wake reason: OHC1
kernel[0]: The USB device Apple Internal Keyboard / Trackpad (Port 6 of Hub at 0x4000000) may have caused a wake by issuing a remote wakeup (2)

I suppose there's an issue with keyboard / trackpad but I don't know how to disable wakeup for this events. Waking by opening lid / pressing power button would be great.

I've set TTYSPreventSleep = 0 in com.apple.PowerManagement.plist with no noticable result.

Here is full Console output:

08.12.14 15:46:47,382 coreaudiod[382]: 2014-12-08 03:46:47.379098 PM [AirPlay] Power: SystemWillSleep
08.12.14 15:46:47,385 coreaudiod[382]: 2014-12-08 03:46:47.385143 PM [AirPlay] BTLE client stopping to browse for AirPlay Solo Target Presence.
08.12.14 15:46:47,386 coreaudiod[382]: 2014-12-08 03:46:47.386069 PM [AirPlay] BTLE discovery removing all devices
08.12.14 15:46:47,396 coreaudiod[382]: 2014-12-08 03:46:47.396326 PM [AirPlay] BTLE client stopped to browse for AirPlay Solo Target Presence.
08.12.14 15:46:47,443 XPCKeychainSandboxCheck[1157]: Can't get sandbox fs extension for /Library/Sophos Anti-Virus/Sophos.keychain, status=-1 errno=No such file or directory ext=(null)
08.12.14 15:46:47,458 Telegram[473]: tcp_connection_destination_prepare_complete 6 connectx to 149.154.167.91:80@0 failed: Network is unreachable
08.12.14 15:46:47,459 Telegram[473]: tcp_connection_destination_prepare_complete 6 connectx to 149.154.167.91:80@0 failed: Network is unreachable
08.12.14 15:46:47,465 Telegram[473]: tcp_connection_destination_prepare_complete 7 connectx to 149.154.175.50:80@0 failed: Network is unreachable
08.12.14 15:46:47,465 Telegram[473]: tcp_connection_destination_prepare_complete 7 connectx to 149.154.175.50:80@0 failed: Network is unreachable
08.12.14 15:46:47,473 identityservicesd[420]: <IMMacNotificationCenterManager: 0x7fb8bad6fca0>: notification observer: com.apple.iChat   notification: __CFNotification 0x7fb8bace1ad0 {name = _NSDoNotDisturbEnabledNotification}
08.12.14 15:46:47,473 imagent[430]: <IMMacNotificationCenterManager: 0x7fdedb540140>: notification observer: com.apple.FaceTime   notification: __CFNotification 0x7fdedb50ba10 {name = _NSDoNotDisturbEnabledNotification}
08.12.14 15:46:47,482 Telegram[473]: tcp_connection_destination_prepare_complete 8 connectx to 149.154.171.5:80@0 failed: Network is unreachable
08.12.14 15:46:47,482 Telegram[473]: tcp_connection_destination_prepare_complete 8 connectx to 149.154.171.5:80@0 failed: Network is unreachable
08.12.14 15:46:47,483 Telegram[473]: tcp_connection_destination_prepare_complete 9 connectx to 149.154.167.51:80@0 failed: Network is unreachable
08.12.14 15:46:47,484 Telegram[473]: tcp_connection_destination_prepare_complete 9 connectx to 149.154.167.51:80@0 failed: Network is unreachable
08.12.14 15:46:47,507 imagent[430]: <IMMacNotificationCenterManager: 0x7fdedb540140>:    NC Disabled: NO
08.12.14 15:46:47,508 identityservicesd[420]: <IMMacNotificationCenterManager: 0x7fb8bad6fca0>:    NC Disabled: NO
08.12.14 15:46:47,539 identityservicesd[420]: <IMMacNotificationCenterManager: 0x7fb8bad6fca0>:   DND Enabled: YES
08.12.14 15:46:47,539 imagent[430]: <IMMacNotificationCenterManager: 0x7fdedb540140>:   DND Enabled: YES
08.12.14 15:46:47,539 identityservicesd[420]: <IMMacNotificationCenterManager: 0x7fb8bad6fca0>: Updating enabled: NO   (Topics: (null))
08.12.14 15:46:47,539 imagent[430]: <IMMacNotificationCenterManager: 0x7fdedb540140>: Updating enabled: NO   (Topics: (null))
08.12.14 15:46:47,574 Telegram[473]: tcp_connection_destination_prepare_complete 10 connectx to 174.140.142.6:80@0 failed: Network is unreachable
08.12.14 15:46:47,575 Telegram[473]: tcp_connection_destination_prepare_complete 10 connectx to 174.140.142.6:80@0 failed: Network is unreachable
08.12.14 15:46:49,538 WindowServer[299]: device_generate_desktop_screenshot: authw 0x7f957b5f3120(2000), shield 0x7f957d828220(2001)
08.12.14 15:46:49,544 Telegram[473]: tcp_connection_destination_prepare_complete 11 connectx to 149.154.167.91:80@0 failed: Network is unreachable
08.12.14 15:46:49,545 Telegram[473]: tcp_connection_destination_prepare_complete 11 connectx to 149.154.167.91:80@0 failed: Network is unreachable
08.12.14 15:46:49,575 Telegram[473]: tcp_connection_destination_prepare_complete 12 connectx to 149.154.175.50:80@0 failed: Network is unreachable
08.12.14 15:46:49,577 Telegram[473]: tcp_connection_destination_prepare_complete 13 connectx to 149.154.171.5:80@0 failed: Network is unreachable
08.12.14 15:46:49,577 Telegram[473]: tcp_connection_destination_prepare_complete 14 connectx to 149.154.167.51:80@0 failed: Network is unreachable
08.12.14 15:46:49,579 Telegram[473]: tcp_connection_destination_prepare_complete 12 connectx to 149.154.175.50:80@0 failed: Network is unreachable
08.12.14 15:46:49,582 Telegram[473]: tcp_connection_destination_prepare_complete 13 connectx to 149.154.171.5:80@0 failed: Network is unreachable
08.12.14 15:46:49,583 Telegram[473]: tcp_connection_destination_prepare_complete 14 connectx to 149.154.167.51:80@0 failed: Network is unreachable
08.12.14 15:46:49,583 Telegram[473]: tcp_connection_destination_prepare_complete 15 connectx to 174.140.142.6:80@0 failed: Network is unreachable
08.12.14 15:46:49,585 Telegram[473]: tcp_connection_destination_prepare_complete 15 connectx to 174.140.142.6:80@0 failed: Network is unreachable
08.12.14 15:46:49,601 WindowServer[299]: device_generate_lock_screen_screenshot: authw 0x7f957b5f3120(2000)[0, 0, 1280, 800] shield 0x7f957d828220(2001), dev [1280,800]
08.12.14 15:46:49,730 com.apple.xpc.launchd[1]: (com.apple.xpc.launchd.domain.user.501) Service "com.apple.xpc.launchd.unmanaged.loginwindow.67" tried to hijack endpoint "com.apple.tsm.uiserver" from owner: com.apple.SystemUIServer.agent
08.12.14 15:46:49,730 com.apple.xpc.launchd[1]: (com.apple.xpc.launchd.domain.user.501) Service "com.apple.xpc.launchd.unmanaged.loginwindow.67" tried to hijack endpoint "com.apple.tsm.uiserver" from owner: com.apple.SystemUIServer.agent
08.12.14 15:46:50,000 kernel[0]: PM response took 2216 ms (26, powerd)
08.12.14 15:46:50,000 kernel[0]: Failed to get hibernate image filename
08.12.14 15:46:50,000 kernel[0]: AirPort_Brcm43xx::powerChange: System Sleep 
08.12.14 15:46:50,000 kernel[0]: 00000000  00000020  NVEthernet::setLinkStatus - not Active
08.12.14 15:46:50,000 kernel[0]: [IOBluetoothHostControllerUSBTransport][ReceiveInterruptData] -- kIOReturnAborted, data size is 0, but data in buffer -- (data Length = 4, packet length = 6)  Data Content: 
08.12.14 15:46:53,000 kernel[0]: Wake reason: OHC1
08.12.14 15:46:53,000 kernel[0]: AirPort_Brcm43xx::powerChange: System Wake - Full Wake/ Dark Wake / Maintenance wake
08.12.14 15:46:53,000 kernel[0]: AirPort_Brcm43xx::checkInterfacePowerState: Check _pwrOffThreadCall!
08.12.14 15:46:53,000 kernel[0]: Previous sleep cause: 5
08.12.14 15:46:53,000 kernel[0]: The USB device Apple Internal Keyboard / Trackpad (Port 6 of Hub at 0x4000000) may have caused a wake by issuing a remote wakeup (2)
08.12.14 15:46:53,000 kernel[0]: full wake promotion (reason 1) 22 ms
08.12.14 15:46:53,109 watchdogd[375]: [watchdog_daemon] @(         pm_callback) - ref=0x0 msg_type=0xe0000320 msg=0x0
08.12.14 15:46:53,000 kernel[0]: 00000000  00000020  NVEthernet::setLinkStatus - not Active
08.12.14 15:46:53,547 WindowServer[299]: CGXDisplayDidWakeNotification [1057087667987]: posting kCGSDisplayDidWake
08.12.14 15:46:53,548 WindowServer[299]: handle_will_sleep_auth_and_shield_windows: Ordering out authw 0x7f957b5f3120(2000), shield 0x7f957d828220(2001) (lock state: 2)
08.12.14 15:46:53,548 WindowServer[299]: handle_will_sleep_auth_and_shield_windows: errs 0x0, 0x0
08.12.14 15:46:53,553 loginwindow[67]: ERROR | -[LWBuiltInScreenLockAuthLion closeAuthAndReset:] | Attempted to remove an observer when not observing
08.12.14 15:46:53,580 Telegram[473]: tcp_connection_destination_prepare_complete 16 connectx to 149.154.167.91:80@0 failed: Network is unreachable
08.12.14 15:46:53,605 Telegram[473]: tcp_connection_destination_prepare_complete 17 connectx to 149.154.175.50:80@0 failed: Network is unreachable
08.12.14 15:46:53,606 Telegram[473]: tcp_connection_destination_prepare_complete 16 connectx to 149.154.167.91:80@0 failed: Network is unreachable
08.12.14 15:46:53,608 Telegram[473]: tcp_connection_destination_prepare_complete 17 connectx to 149.154.175.50:80@0 failed: Network is unreachable
08.12.14 15:46:53,620 discoveryd[51]: Basic DNSResolver UDNSServer:: PowerState is Wakeup
08.12.14 15:46:53,645 Telegram[473]: tcp_connection_destination_prepare_complete 18 connectx to 149.154.171.5:80@0 failed: Network is unreachable
08.12.14 15:46:53,647 Telegram[473]: tcp_connection_destination_prepare_complete 18 connectx to 149.154.171.5:80@0 failed: Network is unreachable
08.12.14 15:46:53,709 Telegram[473]: tcp_connection_destination_prepare_complete 19 connectx to 149.154.167.51:80@0 failed: Network is unreachable
08.12.14 15:46:53,715 Telegram[473]: tcp_connection_destination_prepare_complete 19 connectx to 149.154.167.51:80@0 failed: Network is unreachable
08.12.14 15:46:53,718 Telegram[473]: tcp_connection_destination_prepare_complete 20 connectx to 174.140.142.6:80@0 failed: Network is unreachable
08.12.14 15:46:53,719 Telegram[473]: tcp_connection_destination_prepare_complete 20 connectx to 174.140.142.6:80@0 failed: Network is unreachable
08.12.14 15:46:53,815 coreaudiod[382]: 2014-12-08 03:46:53.814777 PM [AirPlay] Power: SystemHasPoweredOn
08.12.14 15:46:53,815 watchdogd[375]: [watchdog_daemon] @(         pm_callback) - ref=0x0 msg_type=0xe0000300 msg=0x0
08.12.14 15:46:53,815 coreaudiod[382]: 2014-12-08 03:46:53.814996 PM [AirPlay] BTLE client starting to browse for AirPlay Solo Target Presence.
08.12.14 15:46:53,819 sharingd[386]: 15:46:53.816 : Starting AirDrop server for user 501 on wake
08.12.14 15:46:54,000 kernel[0]: PM response took 219 ms (26, powerd)
08.12.14 15:46:54,133 sharingd[386]: 15:46:54.133 : SDStatusMonitor::kStatusWirelessPowerChanged
08.12.14 15:46:54,251 sharingd[386]: 15:46:54.250 : SDStatusMonitor::kStatusWirelessPowerChanged
08.12.14 15:46:54,332 sharingd[386]: 15:46:54.331 : SDStatusMonitor::kStatusWirelessPowerChanged
08.12.14 15:46:59,143 imagent[430]: <IMMacNotificationCenterManager: 0x7fdedb540140>: notification observer: com.apple.FaceTime   notification: __CFNotification 0x7fdedb4421b0 {name = _NSDoNotDisturbDisabledNotification}
08.12.14 15:46:59,145 identityservicesd[420]: <IMMacNotificationCenterManager: 0x7fb8bad6fca0>: notification observer: com.apple.iChat   notification: __CFNotification 0x7fb8bad86bb0 {name = _NSDoNotDisturbDisabledNotification}
08.12.14 15:46:59,161 imagent[430]: <IMMacNotificationCenterManager: 0x7fdedb540140>:    NC Disabled: NO
08.12.14 15:46:59,182 imagent[430]: <IMMacNotificationCenterManager: 0x7fdedb540140>:   DND Enabled: NO
08.12.14 15:46:59,182 imagent[430]: <IMMacNotificationCenterManager: 0x7fdedb540140>: Updating enabled: YES   (Topics: (
    "com.apple.ess",
    "com.apple.private.ac"
))
08.12.14 15:46:59,182 identityservicesd[420]: <IMMacNotificationCenterManager: 0x7fb8bad6fca0>:    NC Disabled: NO
08.12.14 15:46:59,192 identityservicesd[420]: <IMMacNotificationCenterManager: 0x7fb8bad6fca0>:   DND Enabled: NO
08.12.14 15:46:59,193 identityservicesd[420]: <IMMacNotificationCenterManager: 0x7fb8bad6fca0>: Updating enabled: YES   (Topics: (
    "com.apple.private.alloy.icloudpairing",
    "com.apple.private.alloy.continuity.encryption",
    "com.apple.private.alloy.continuity.activity",
    "com.apple.ess",
    "com.apple.private.ids",
    "com.apple.private.alloy.phonecontinuity",
    "com.apple.private.alloy.continuity.activity.public",
    "com.apple.madrid",
    "com.apple.private.alloy.continuity.auth",
    "com.apple.private.ac",
    "com.apple.private.alloy.idsremoteurlconnection",
    "com.apple.private.alloy.sms",
    "com.apple.private.alloy.screensharing",
    "com.apple.private.alloy.maps",
    "com.apple.private.alloy.callhistorysync",
    "com.apple.private.alloy.continuity.tethering"
))
08.12.14 15:47:05,202 loginwindow[67]: CoreAnimation: warning, deleted thread with uncommitted CATransaction; set CA_DEBUG_TRANSACTIONS=1 in environment to log backtraces.

% pmset -g

Active Profiles:
Battery Power   -1
AC Power    -1*
Currently in use:
 womp                 0
 halfdim              1
 sms                  1
 hibernatefile        /var/vm/sleepimage
 networkoversleep     0
 disksleep            0
 sleep                0
 hibernatemode        3
 ttyskeepawake        0
 displaysleep         10
 acwake               0
 lidwake              1

% pmset -g log

Time stamp                Domain                Message                                                                     Duration    Delay
==========                ======                =======                                                                     ========    =====
UUID: F27753E8-65F8-47DB-B204-75FC7E293FD1
2014-12-08 14:43:23 +0200 Notification          Display is turned off
2014-12-08 14:43:23 +0200 Assertions            PID 72(hidd) Summary UserIsActive "com.apple.iohideventsystem.queue.tickle" 00:06:39  id:0x900000452 [System: DeclUser kDisp]
2014-12-08 14:43:24 +0200 Sleep                 Entering Sleep state due to 'Clamshell Sleep': Using AC (Charge:64%)        8 secs
2014-12-08 14:43:29 +0200 Wake Requests         [*proc=discoveryd request=Maintenance inDelta=6475]
2014-12-08 14:43:29 +0200 PM Client Acks        Delays to Sleep notifications: [com.apple.apsd is slow(5459 ms)]
2014-12-08 14:43:32 +0200 Kernel Client Acks    Delays to Sleep notifications: [NVDATesla driver is slow(msg: SetState to 1)(1038 ms)] [powerd is slow(5472 ms)]
2014-12-08 14:43:32 +0200 Notification          Display is turned on
2014-12-08 14:43:32 +0200 Wake                  Wake [CDNVA] due to OHC1/HID Activity: Using AC (Charge:64%)
2014-12-08 14:43:32 +0200 Kernel Client Acks    Delays to Wake notifications: [en0 driver is slow(msg: DidChangeState to 1)(441 ms)] [AppleHDADriver driver is slow(msg: SetState to 1)(464 ms)] [NVDATesla driver is slow(msg: SetState to 2)(516 ms)] [PRT0 driver is slow(msg: SetState to 2)(599 ms)]

% ioreg -rn OHC1 says: http://pastebin.com/KsBejaLj

I tried to enable forced hibernation to disk with sudo pmset -a hibernatemode 1, it does not help, here is one more console log: http://pastebin.com/FWXe4Y1x

Best Answer

I've had similar strange problems with macbook being unable to sleep, unable to wake up without restart, waking with the lid closed and draining down the battery to zero... phhew - so much headache((
Until I've finally tracked down the culprit - guess who? Telegram Desktop app!
I can also see it listed in your logs.
Try exiting the app and then put the laptop to sleep.
Tell me how it went.