zearp / Nucintosh

Intel NUC Hackintosh Stuff
723 stars 85 forks source link

Sleep doesn't work properly #9

Closed hongphuc95 closed 3 years ago

hongphuc95 commented 3 years ago

Hello, thank you for your resource, it's been very helpful for me to fire up macOS on my NUC. With your EFO configuration, it worked pretty well for the most part. However, I've encountered a problem while putting the machine into sleep mode. It went to sleep for a moment then it random woke up by itself for about 10 seconds and went back to sleep again and this behavior repeated endlessly. I have a NUC8I5BEK model under Big Sur 11.0.1. I also followed your tutorial to disable parameters that prevent the NUC from waking up randomly. I'm struggling to debug this because I'm not familiar with the logs it produces. Can you help me out? Any help would be appreciated. Thanks.

Screenshot 2020-11-14 at 14 34 05

zearp commented 3 years ago

Can you run the following commands?

First sudo log erase --all to clean the logs, then enter sleep with pmset sleepnow wait a few minutes so the logs can collect data and then wake up the machine and run log show --style syslog | fgrep "[powerd:sleepWake]" and pmset -g assertions and pmset -g.

Let me know the outputs of the commands.

hongphuc95 commented 3 years ago
hongphucvu@Phucs-MacMini ~ % log show --style syslog | fgrep "[powerd:sleepWake]"
2020-11-14 17:00:50.487987+0100  localhost powerd[67]: [powerd:sleepWake] Next immediate inactivity window start:'2020-11-14 17:00:00 +0100' end:'2020-11-15 01:00:00 +0100'
2020-11-14 17:01:14.910802+0100  localhost powerd[67]: [powerd:sleepWake] vm.darkwake_mode: 0 -> 0
2020-11-14 17:01:14.928162+0100  localhost powerd[67]: [powerd:sleepWake] sendNoRespNotification: 0x19
2020-11-14 17:01:14.931389+0100  localhost powerd[67]: [powerd:sleepWake] AppWoke:com.apple.bluetoothd-blueavengers Reason:BlueAvengers: Toggle beacon state
2020-11-14 17:01:14.931460+0100  localhost powerd[67]: [powerd:sleepWake] Wake reason: "<private>"  identity: "<private>"
2020-11-14 17:01:29.935565+0100  localhost powerd[67]: [powerd:sleepWake] chooseStandbyDelay(): lowBattery = false, battery powered = false, capacity=0, lowBatteryThreshold=0; chosen delay=86400
2020-11-14 17:01:29.936267+0100  localhost powerd[67]: [powerd:sleepWake] Eligible for Standby: 0
2020-11-14 17:01:29.936268+0100  localhost powerd[67]: [powerd:sleepWake] standbyDelay:86400 eligibleForStandby:0 elapsedTime:0 gDelta2Standby:86400
2020-11-14 17:01:29.936382+0100  localhost powerd[67]: [powerd:sleepWake] Entering Sleep state due to 'Software Sleep pid=128'
2020-11-14 17:01:29.936560+0100  localhost powerd[67]: [powerd:sleepWake] connectionFireNotification: 0x0
2020-11-14 17:01:32.905244+0100  localhost powerd[67]: [powerd:sleepWake] No AdaptiveWake is requested. InactivityEnd:Mon Jan  1 01:00:00 2001 PowerNap State:0
2020-11-14 17:01:32.905950+0100  localhost powerd[67]: [powerd:sleepWake] Wake scheduled by com.apple.alarm
2020-11-14 17:18:09.017380+0100  localhost powerd[67]: [powerd:sleepWake] No need to refresh inactivity prediction: phase=0, start=0.000000, now=627063489.009743
2020-11-14 17:18:09.017383+0100  localhost powerd[67]: [powerd:sleepWake] sendNoRespNotification: 0x8019
2020-11-14 17:18:09.023049+0100  localhost powerd[67]: [powerd:sleepWake] Updating wake start timestamp to 111543014955
2020-11-14 17:18:09.076414+0100  localhost powerd[67]: [powerd:sleepWake] vm.darkwake_mode: 0 -> 0
2020-11-14 17:18:09.084995+0100  localhost powerd[67]: [powerd:sleepWake] Cancelling dark wake update capabilities timer
2020-11-14 17:18:09.086479+0100  localhost powerd[67]: [powerd:sleepWake] vm.darkwake_mode: 0 -> 0
2020-11-14 17:18:12.591135+0100  localhost powerd[67]: [powerd:sleepWake] Updating wake end timestamp to 115279897771
2020-11-14 17:18:12.591307+0100  localhost powerd[67]: [powerd:sleepWake] Wake from Normal Sleep [CDNVA] : due to XDCI/HID Activity
2020-11-14 17:18:12.591320+0100  localhost powerd[67]: [powerd:sleepWake] WakeDetails: <private>
2020-11-14 17:18:12.591631+0100  localhost powerd[67]: [powerd:sleepWake] <private>
2020-11-14 17:18:12.591982+0100  localhost powerd[67]: [powerd:sleepWake] sendNoRespNotification: 0x1f
2020-11-14 17:23:14.486846+0100  localhost powerd[67]: [powerd:sleepWake] vm.darkwake_mode: 0 -> 0
2020-11-14 17:23:14.492146+0100  localhost powerd[67]: [powerd:sleepWake] vm.darkwake_mode: 0 -> 0
2020-11-14 17:23:14.500815+0100  localhost powerd[67]: [powerd:sleepWake] Failed to get sleep type. rc:0xe00002c7
2020-11-14 17:24:14.511058+0100  localhost powerd[67]: [powerd:sleepWake] Next immediate inactivity window start:'2020-11-14 17:15:00 +0100' end:'2020-11-15 01:00:00 +0100'
2020-11-14 17:24:31.811488+0100  localhost powerd[67]: [powerd:sleepWake] vm.darkwake_mode: 0 -> 0
2020-11-14 17:24:31.817198+0100  localhost powerd[67]: [powerd:sleepWake] sendNoRespNotification: 0x19
2020-11-14 17:24:31.821224+0100  localhost powerd[67]: [powerd:sleepWake] AppWoke:com.apple.bluetoothd-blueavengers Reason:BlueAvengers: Toggle beacon state
2020-11-14 17:24:31.821310+0100  localhost powerd[67]: [powerd:sleepWake] Wake reason: "<private>"  identity: "<private>"
2020-11-14 17:24:46.831599+0100  localhost powerd[67]: [powerd:sleepWake] chooseStandbyDelay(): lowBattery = false, battery powered = false, capacity=0, lowBatteryThreshold=0; chosen delay=86400
2020-11-14 17:24:46.831985+0100  localhost powerd[67]: [powerd:sleepWake] Eligible for Standby: 0
2020-11-14 17:24:46.831992+0100  localhost powerd[67]: [powerd:sleepWake] standbyDelay:86400 eligibleForStandby:0 elapsedTime:0 gDelta2Standby:86400
2020-11-14 17:24:46.832092+0100  localhost powerd[67]: [powerd:sleepWake] Entering Sleep state due to 'Software Sleep pid=128'
2020-11-14 17:24:46.832237+0100  localhost powerd[67]: [powerd:sleepWake] connectionFireNotification: 0x0
2020-11-14 17:24:48.855480+0100  localhost powerd[67]: [powerd:sleepWake] No AdaptiveWake is requested. InactivityEnd:Mon Jan  1 01:00:00 2001 PowerNap State:0
2020-11-14 17:24:48.856513+0100  localhost powerd[67]: [powerd:sleepWake] Wake scheduled by com.apple.alarm
2020-11-14 17:28:54.022459+0100  localhost powerd[67]: [powerd:sleepWake] No need to refresh inactivity prediction: phase=0, start=0.000000, now=627064134.010927
2020-11-14 17:28:54.022462+0100  localhost powerd[67]: [powerd:sleepWake] sendNoRespNotification: 0x8019
2020-11-14 17:28:54.032610+0100  localhost powerd[67]: [powerd:sleepWake] Updating wake start timestamp to 107344327325
2020-11-14 17:28:55.351970+0100  localhost powerd[67]: [powerd:sleepWake] Updating wake end timestamp to 108684712779
2020-11-14 17:28:55.352266+0100  localhost powerd[67]: [powerd:sleepWake] vm.darkwake_mode: 0 -> 1
2020-11-14 17:28:55.352327+0100  localhost powerd[67]: [powerd:sleepWake] DarkWake from Normal Sleep [CDN] : due to XDCI/
2020-11-14 17:28:55.352337+0100  localhost powerd[67]: [powerd:sleepWake] WakeDetails: <private>
2020-11-14 17:28:55.352488+0100  localhost powerd[67]: [powerd:sleepWake] <private>
2020-11-14 17:28:55.352823+0100  localhost powerd[67]: [powerd:sleepWake] sendNoRespNotification: 0x19
2020-11-14 17:29:40.916531+0100  localhost powerd[67]: [powerd:sleepWake] chooseStandbyDelay(): lowBattery = false, battery powered = false, capacity=0, lowBatteryThreshold=0; chosen delay=86400
2020-11-14 17:29:40.917039+0100  localhost powerd[67]: [powerd:sleepWake] Eligible for Standby: 0
2020-11-14 17:29:40.917039+0100  localhost powerd[67]: [powerd:sleepWake] standbyDelay:86400 eligibleForStandby:0 elapsedTime:0 gDelta2Standby:86400
2020-11-14 17:29:40.917091+0100  localhost powerd[67]: [powerd:sleepWake] Entering Sleep state due to 'Maintenance Sleep'
2020-11-14 17:29:40.917211+0100  localhost powerd[67]: [powerd:sleepWake] connectionFireNotification: 0x0
2020-11-14 17:29:42.900066+0100  localhost powerd[67]: [powerd:sleepWake] No AdaptiveWake is requested. InactivityEnd:Mon Jan  1 01:00:00 2001 PowerNap State:0
2020-11-14 17:29:42.900266+0100  localhost powerd[67]: [powerd:sleepWake] Wake scheduled by com.apple.alarm
2020-11-14 17:30:11.002292+0100  localhost powerd[67]: [powerd:sleepWake] No need to refresh inactivity prediction: phase=0, start=0.000000, now=627064211.002188
2020-11-14 17:30:11.002297+0100  localhost powerd[67]: [powerd:sleepWake] sendNoRespNotification: 0x8019
2020-11-14 17:30:11.010239+0100  localhost powerd[67]: [powerd:sleepWake] Updating wake start timestamp to 161121487797
2020-11-14 17:30:11.074606+0100  localhost powerd[67]: [powerd:sleepWake] vm.darkwake_mode: 1 -> 0
2020-11-14 17:30:11.078077+0100  localhost powerd[67]: [powerd:sleepWake] Cancelling dark wake update capabilities timer
2020-11-14 17:30:11.078489+0100  localhost powerd[67]: [powerd:sleepWake] vm.darkwake_mode: 0 -> 0
2020-11-14 17:30:14.724309+0100  localhost powerd[67]: [powerd:sleepWake] Updating wake end timestamp to 164845645217
2020-11-14 17:30:14.724525+0100  localhost powerd[67]: [powerd:sleepWake] Wake from Normal Sleep [CDNVA] : due to XDCI/UserActivity Assertion
2020-11-14 17:30:14.724531+0100  localhost powerd[67]: [powerd:sleepWake] WakeDetails: <private>
2020-11-14 17:30:14.724931+0100  localhost powerd[67]: [powerd:sleepWake] <private>
2020-11-14 17:30:14.725356+0100  localhost powerd[67]: [powerd:sleepWake] sendNoRespNotification: 0x1f
hongphucvu@Phucs-MacMini ~ % pmset -g assertions
2020-11-14 17:34:31 +0100 
Assertion status system-wide:
   BackgroundTask                 1
   ApplePushServiceTask           0
   UserIsActive                   1
   PreventUserIdleDisplaySleep    0
   PreventSystemSleep             0
   ExternalMedia                  0
   PreventUserIdleSystemSleep     1
   NetworkClientActive            0
Listed by owning process:
   pid 125(WindowServer): [0x0000001200098083] 00:00:00 UserIsActive named: "com.apple.iohideventsystem.queue.tickle serviceID:10000069a name:AppleUserHIDEventSe product:Karabiner DriverKit eventType:3"  
    Timeout will fire in 600 secs Action=TimeoutActionRelease
   pid 346(sharingd): [0x000000ba00018343] 00:03:52 PreventUserIdleSystemSleep named: "Handoff"  
   pid 338(UserEventAgent): [0x00000030000b81e1] 00:10:36 BackgroundTask named: "com.apple.coreduet.sync.update-source-device-identifiers"  
    Created for PID: 341. 
Kernel Assertions: 0xc=USB,BT-HID
   id=500  level=255 0x4=USB creat=14/11/2020 17:32 description=com.apple.usb.externaldevice.14100000 owner=USB Receiver
   id=501  level=255 0x8=BT-HID creat=14/11/2020 17:32 description=com.apple.driver.IOBluetoothHIDDriver owner=IOBluetoothHIDDriver
Idle sleep preventers: IODisplayWrangler
hongphucvu@Phucs-MacMini ~ % pmset -g
System-wide power settings:
Currently in use:
 standby              0
 Sleep On Power Button 1
 womp                 0
 autorestart          1
 hibernatefile        /var/vm/sleepimage
 proximitywake        0
 powernap             0
 gpuswitch            2
 networkoversleep     0
 disksleep            10
 standbydelayhigh     86400
 sleep                1 (sleep prevented by nsurlsessiond, sharingd, UserEventAgent, apsd)
 hibernatemode        0
 ttyskeepawake        1
 displaysleep         10
 tcpkeepalive         0
 highstandbythreshold 50
 standbydelaylow      86400
zearp commented 3 years ago

Haha, that literally hurts my eyes. I'll see if I can fix that formatting to see whats going on. I haven't had any issues with sleep but on Big Sur it does always "wake up" very shortly before going back to sleep and then it stays asleep. When running Catalina this very short "wake" doesn't happen and it sleep right away and stays asleep as it should.

Also keep in mind that many (Acidanthera) kexts are not fully working on Big Sur. So if you want a reliable and stable system its best to stick with Catalina. A lot of big things changed under the hood in Big Sur and it will take some time before all the kexts we need are fully updated and working with Big Sur.

hongphuc95 commented 3 years ago

Haha, that literally hurts my eyes. I'll see if I can fix that formatting to see whats going on. I haven't had any issues with sleep but on Big Sur it does always "wake up" very shortly before going back to sleep and then it stays asleep. When running Catalina this very short "wake" doesn't happen and it sleep right away and stays asleep as it should.

Also keep in mind that many (Acidanthera) kexts are not fully working on Big Sur. So if you want a reliable and stable system its best to stick with Catalina. A lot of big things changed under the hood in Big Sur and it will take some time before all the kexts we need are fully updated and working with Big Sur.

Oh sorry about the formatting, Github markdown ignore all of the newline characters for some reason. I'll try to remove the AirportItlwm kext and use only ethernet to see if that helps.

zearp commented 3 years ago

Ok, quickly glancing over the logs this stands out: AppWoke:com.apple.bluetoothd-blueavengers Reason:BlueAvengers: Toggle beacon state

This is a mesh network Apple uses to find devices and such. This will cause "wake-ups" every X minutes and shouldn't happen with tcpkeepalive disabled. Did you by any chance have "find my Mac" enabled? Its also possible Big Sur changed some sleep behaviour. I didn't login to my iCloud on Big Sur when I was testing, so I don't know about that.

Can you try a longer test? Clear the logs again and enter sleep and let it sit for 15-30 minutes. If I do that on my Big Sur it only does the "wake" once and then stays asleep. I need to be able to reproduce your issue else it will be very hard to help. I'd be interested to see the sleep/wake events when you let it sit there for a while.

One more thing, when you say it wakes up does the screen also turn on or does it only changes sleep state? To tell in an easy way change the LED colour in the BIOS to amber when it's in sleep mode. That way you can easily tell if it's sleeping or not.

hongphuc95 commented 3 years ago

Ok, quickly glancing over the logs this stands out: AppWoke:com.apple.bluetoothd-blueavengers Reason:BlueAvengers: Toggle beacon state

This is a mesh network Apple uses to find devices and such. This will cause "wake-ups" every X minutes and shouldn't happen with tcpkeepalive disabled. Did you by any chance have "find my Mac" enabled? Its also possible Big Sur changed some sleep behaviour. I didn't login to my iCloud on Big Sur when I was testing, so I don't know about that.

I do enable Find My Mac in the iCloud setting.

Can you try a longer test? Clear the logs again and enter sleep and let it sit for 15-30 minutes. If I do that on my Big Sur it only does the "wake" once and then stays asleep. I need to be able to reproduce your issue else it will be very hard to help. I'd be interested to see the sleep/wake events when you let it sit there for a while.

Ok, I will do another extensive test with Find My Mac turn off. We'll see what happens.

One more thing, when you say it wakes up does the screen also turn on or does it only changes sleep state? To tell in an easy way change the LED colour in the BIOS to amber when it's in sleep mode. That way you can easily tell if it's sleeping or not.

Yes actually, I set the idle led with different colour, I also set the fan to a higher RPM when working so when the thing wakes up I will know immediately from the LED and the fan noise.

zearp commented 3 years ago

Awesome, keep me posted! It will be interesting to see if find My Mac is causing it. I've ran into it before and disabling tcpkeepalive fixed it. But maybe Big Sur has changed it. you can also sleep with a little devices connected as possible. Like usb devices and usb hubs.

I hope tomorrow I have a few hours to do a clean install on a stock NUC here and do my testing. Need to test everything including sleep. The beta's did have some big changes so I stopped trying them out cuz it was a waste time when things keep changing.

hongphuc95 commented 3 years ago

Okay so here's the result. I don't think it's Find My Mac triggered the wake up. I observed during the test, the machine wakes up then back to sleep 3-4 times. It didn't turn on the screen or show the login page, it just changes the state from sleep to running (white LED to green LED in my case) and my fan did turn up when the state changes and turn off when it backs to sleep again. I don't know if there is something to do with the fact I'm using a keyboard which doesn't have Bluetooth LE.

hongphucvu@Phucs-MacMini ~ % log show --style syslog | fgrep "[powerd:sleepWake]"
2020-11-14 18:07:43.055319+0100  localhost powerd[67]: [powerd:sleepWake] vm.darkwake_mode: 0 -> 0
2020-11-14 18:07:43.074242+0100  localhost powerd[67]: [powerd:sleepWake] sendNoRespNotification: 0x19
2020-11-14 18:07:58.088550+0100  localhost powerd[67]: [powerd:sleepWake] chooseStandbyDelay(): lowBattery = false, battery powered = false, capacity=0, lowBatteryThreshold=0; chosen delay=86400
2020-11-14 18:07:58.088952+0100  localhost powerd[67]: [powerd:sleepWake] Eligible for Standby: 0
2020-11-14 18:07:58.088953+0100  localhost powerd[67]: [powerd:sleepWake] standbyDelay:86400 eligibleForStandby:0 elapsedTime:0 gDelta2Standby:86400
2020-11-14 18:07:58.089027+0100  localhost powerd[67]: [powerd:sleepWake] Entering Sleep state due to 'Software Sleep pid=128'
2020-11-14 18:07:58.089123+0100  localhost powerd[67]: [powerd:sleepWake] connectionFireNotification: 0x0
2020-11-14 18:08:01.076025+0100  localhost powerd[67]: [powerd:sleepWake] No AdaptiveWake is requested. InactivityEnd:Mon Jan  1 01:00:00 2001 PowerNap State:0
2020-11-14 18:08:01.076208+0100  localhost powerd[67]: [powerd:sleepWake] Wake scheduled by com.apple.alarm
2020-11-14 18:11:51.018075+0100  localhost powerd[67]: [powerd:sleepWake] No need to refresh inactivity prediction: phase=0, start=0.000000, now=627066711.012051
2020-11-14 18:11:51.018078+0100  localhost powerd[67]: [powerd:sleepWake] sendNoRespNotification: 0x8019
2020-11-14 18:11:51.029706+0100  localhost powerd[67]: [powerd:sleepWake] Updating wake start timestamp to 2434362312115
2020-11-14 18:11:52.398054+0100  localhost powerd[67]: [powerd:sleepWake] Updating wake end timestamp to 2435754293051
2020-11-14 18:11:52.398359+0100  localhost powerd[67]: [powerd:sleepWake] vm.darkwake_mode: 0 -> 1
2020-11-14 18:11:52.398417+0100  localhost powerd[67]: [powerd:sleepWake] DarkWake from Normal Sleep [CDN] : due to XDCI/
2020-11-14 18:11:52.398428+0100  localhost powerd[67]: [powerd:sleepWake] WakeDetails: <private>
2020-11-14 18:11:52.398568+0100  localhost powerd[67]: [powerd:sleepWake] <private>
2020-11-14 18:11:52.398893+0100  localhost powerd[67]: [powerd:sleepWake] sendNoRespNotification: 0x19
2020-11-14 18:12:37.615360+0100  localhost powerd[67]: [powerd:sleepWake] chooseStandbyDelay(): lowBattery = false, battery powered = false, capacity=0, lowBatteryThreshold=0; chosen delay=86400
2020-11-14 18:12:37.615937+0100  localhost powerd[67]: [powerd:sleepWake] Eligible for Standby: 0
2020-11-14 18:12:37.615937+0100  localhost powerd[67]: [powerd:sleepWake] standbyDelay:86400 eligibleForStandby:0 elapsedTime:0 gDelta2Standby:86400
2020-11-14 18:12:37.615992+0100  localhost powerd[67]: [powerd:sleepWake] Entering Sleep state due to 'Maintenance Sleep'
2020-11-14 18:12:37.616078+0100  localhost powerd[67]: [powerd:sleepWake] connectionFireNotification: 0x0
2020-11-14 18:12:38.620192+0100  localhost powerd[67]: [powerd:sleepWake] No AdaptiveWake is requested. InactivityEnd:Mon Jan  1 01:00:00 2001 PowerNap State:0
2020-11-14 18:12:38.620350+0100  localhost powerd[67]: [powerd:sleepWake] Wake scheduled by com.apple.alarm
2020-11-14 18:14:31.001741+0100  localhost powerd[67]: [powerd:sleepWake] No need to refresh inactivity prediction: phase=0, start=0.000000, now=627066871.002361
2020-11-14 18:14:31.001746+0100  localhost powerd[67]: [powerd:sleepWake] sendNoRespNotification: 0x8019
2020-11-14 18:14:31.010068+0100  localhost powerd[67]: [powerd:sleepWake] Updating wake start timestamp to 2487219974096
2020-11-14 18:14:32.376575+0100  localhost powerd[67]: [powerd:sleepWake] Updating wake end timestamp to 2488597129840
2020-11-14 18:14:32.376880+0100  localhost powerd[67]: [powerd:sleepWake] vm.darkwake_mode: 1 -> 1
2020-11-14 18:14:32.376938+0100  localhost powerd[67]: [powerd:sleepWake] DarkWake from Normal Sleep [CDN] : due to XDCI/
2020-11-14 18:14:32.376949+0100  localhost powerd[67]: [powerd:sleepWake] WakeDetails: <private>
2020-11-14 18:14:32.377100+0100  localhost powerd[67]: [powerd:sleepWake] <private>
2020-11-14 18:14:32.377439+0100  localhost powerd[67]: [powerd:sleepWake] sendNoRespNotification: 0x19
2020-11-14 18:15:17.387066+0100  localhost powerd[67]: [powerd:sleepWake] chooseStandbyDelay(): lowBattery = false, battery powered = false, capacity=0, lowBatteryThreshold=0; chosen delay=86400
2020-11-14 18:15:17.387579+0100  localhost powerd[67]: [powerd:sleepWake] Eligible for Standby: 0
2020-11-14 18:15:17.387580+0100  localhost powerd[67]: [powerd:sleepWake] standbyDelay:86400 eligibleForStandby:0 elapsedTime:0 gDelta2Standby:86400
2020-11-14 18:15:17.387638+0100  localhost powerd[67]: [powerd:sleepWake] Entering Sleep state due to 'Maintenance Sleep'
2020-11-14 18:15:17.387759+0100  localhost powerd[67]: [powerd:sleepWake] connectionFireNotification: 0x0
2020-11-14 18:15:18.392270+0100  localhost powerd[67]: [powerd:sleepWake] No AdaptiveWake is requested. InactivityEnd:Mon Jan  1 01:00:00 2001 PowerNap State:0
2020-11-14 18:15:18.392403+0100  localhost powerd[67]: [powerd:sleepWake] Wake scheduled by com.apple.alarm
2020-11-14 18:21:07.003216+0100  localhost powerd[67]: [powerd:sleepWake] No need to refresh inactivity prediction: phase=0, start=0.000000, now=627067267.004608
2020-11-14 18:21:07.003222+0100  localhost powerd[67]: [powerd:sleepWake] sendNoRespNotification: 0x8019
2020-11-14 18:21:07.009989+0100  localhost powerd[67]: [powerd:sleepWake] Updating wake start timestamp to 2540051887811
2020-11-14 18:21:08.359872+0100  localhost powerd[67]: [powerd:sleepWake] Updating wake end timestamp to 2541413116255
2020-11-14 18:21:08.360182+0100  localhost powerd[67]: [powerd:sleepWake] vm.darkwake_mode: 1 -> 1
2020-11-14 18:21:08.360308+0100  localhost powerd[67]: [powerd:sleepWake] DarkWake from Normal Sleep [CDN] : due to XDCI/
2020-11-14 18:21:08.360319+0100  localhost powerd[67]: [powerd:sleepWake] WakeDetails: <private>
2020-11-14 18:21:08.360478+0100  localhost powerd[67]: [powerd:sleepWake] <private>
2020-11-14 18:21:08.360899+0100  localhost powerd[67]: [powerd:sleepWake] sendNoRespNotification: 0x19
2020-11-14 18:21:53.376501+0100  localhost powerd[67]: [powerd:sleepWake] chooseStandbyDelay(): lowBattery = false, battery powered = false, capacity=0, lowBatteryThreshold=0; chosen delay=86400
2020-11-14 18:21:53.377029+0100  localhost powerd[67]: [powerd:sleepWake] Eligible for Standby: 0
2020-11-14 18:21:53.377029+0100  localhost powerd[67]: [powerd:sleepWake] standbyDelay:86400 eligibleForStandby:0 elapsedTime:0 gDelta2Standby:86400
2020-11-14 18:21:53.377088+0100  localhost powerd[67]: [powerd:sleepWake] Entering Sleep state due to 'Maintenance Sleep'
2020-11-14 18:21:53.377183+0100  localhost powerd[67]: [powerd:sleepWake] connectionFireNotification: 0x0
2020-11-14 18:21:54.380838+0100  localhost powerd[67]: [powerd:sleepWake] No AdaptiveWake is requested. InactivityEnd:Mon Jan  1 01:00:00 2001 PowerNap State:0
2020-11-14 18:21:54.380951+0100  localhost powerd[67]: [powerd:sleepWake] Wake scheduled by com.apple.alarm
2020-11-14 18:27:49.002264+0100  localhost powerd[67]: [powerd:sleepWake] No need to refresh inactivity prediction: phase=0, start=0.000000, now=627067669.002260
2020-11-14 18:27:49.002268+0100  localhost powerd[67]: [powerd:sleepWake] sendNoRespNotification: 0x8019
2020-11-14 18:27:49.008654+0100  localhost powerd[67]: [powerd:sleepWake] Updating wake start timestamp to 2592874410122
2020-11-14 18:27:50.359233+0100  localhost powerd[67]: [powerd:sleepWake] Updating wake end timestamp to 2594233598641
2020-11-14 18:27:50.359506+0100  localhost powerd[67]: [powerd:sleepWake] vm.darkwake_mode: 1 -> 1
2020-11-14 18:27:50.359572+0100  localhost powerd[67]: [powerd:sleepWake] DarkWake from Normal Sleep [CDN] : due to XDCI/
2020-11-14 18:27:50.359590+0100  localhost powerd[67]: [powerd:sleepWake] WakeDetails: <private>
2020-11-14 18:27:50.359753+0100  localhost powerd[67]: [powerd:sleepWake] <private>
2020-11-14 18:27:50.360112+0100  localhost powerd[67]: [powerd:sleepWake] sendNoRespNotification: 0x19
2020-11-14 18:28:35.375037+0100  localhost powerd[67]: [powerd:sleepWake] chooseStandbyDelay(): lowBattery = false, battery powered = false, capacity=0, lowBatteryThreshold=0; chosen delay=86400
2020-11-14 18:28:35.375383+0100  localhost powerd[67]: [powerd:sleepWake] Eligible for Standby: 0
2020-11-14 18:28:35.375384+0100  localhost powerd[67]: [powerd:sleepWake] standbyDelay:86400 eligibleForStandby:0 elapsedTime:0 gDelta2Standby:86400
2020-11-14 18:28:35.375445+0100  localhost powerd[67]: [powerd:sleepWake] Entering Sleep state due to 'Maintenance Sleep'
2020-11-14 18:28:35.375549+0100  localhost powerd[67]: [powerd:sleepWake] connectionFireNotification: 0x0
2020-11-14 18:28:36.380168+0100  localhost powerd[67]: [powerd:sleepWake] No AdaptiveWake is requested. InactivityEnd:Mon Jan  1 01:00:00 2001 PowerNap State:0
2020-11-14 18:28:36.380332+0100  localhost powerd[67]: [powerd:sleepWake] Wake scheduled by com.apple.alarm
2020-11-14 18:33:42.001463+0100  localhost powerd[67]: [powerd:sleepWake] No need to refresh inactivity prediction: phase=0, start=0.000000, now=627068022.002230
2020-11-14 18:33:42.001468+0100  localhost powerd[67]: [powerd:sleepWake] sendNoRespNotification: 0x8019
2020-11-14 18:33:42.014606+0100  localhost powerd[67]: [powerd:sleepWake] Updating wake start timestamp to 2645694336250
2020-11-14 18:33:42.073087+0100  localhost powerd[67]: [powerd:sleepWake] vm.darkwake_mode: 1 -> 0
2020-11-14 18:33:42.076344+0100  localhost powerd[67]: [powerd:sleepWake] Cancelling dark wake update capabilities timer
2020-11-14 18:33:42.076779+0100  localhost powerd[67]: [powerd:sleepWake] vm.darkwake_mode: 0 -> 0
2020-11-14 18:33:43.133718+0100  localhost powerd[67]: [powerd:sleepWake] Updating wake end timestamp to 2646828782814
2020-11-14 18:33:43.134052+0100  localhost powerd[67]: [powerd:sleepWake] Wake from Normal Sleep [CDNVA] : due to XDCI/UserActivity Assertion
2020-11-14 18:33:43.134064+0100  localhost powerd[67]: [powerd:sleepWake] WakeDetails: <private>
2020-11-14 18:33:43.134958+0100  localhost powerd[67]: [powerd:sleepWake] <private>
2020-11-14 18:33:43.135468+0100  localhost powerd[67]: [powerd:sleepWake] sendNoRespNotification: 0x1f
hongphucvu@Phucs-MacMini ~ % pmset -g assertions
2020-11-14 18:34:48 +0100 
Assertion status system-wide:
   BackgroundTask                 1
   ApplePushServiceTask           0
   UserIsActive                   1
   PreventUserIdleDisplaySleep    0
   PreventSystemSleep             0
   ExternalMedia                  0
   PreventUserIdleSystemSleep     1
   NetworkClientActive            0
Listed by owning process:
   pid 125(WindowServer): [0x0000001200098083] 00:00:00 UserIsActive named: "com.apple.iohideventsystem.queue.tickle serviceID:10000069a name:AppleUserHIDEventSe product:Karabiner DriverKit eventType:3"  
        Timeout will fire in 600 secs Action=TimeoutActionRelease
   pid 346(sharingd): [0x00000a65000187b1] 00:00:51 PreventUserIdleSystemSleep named: "Handoff"  
   pid 338(UserEventAgent): [0x00000030000b81e1] 01:10:53 BackgroundTask named: "com.apple.coreduet.sync.update-source-device-identifiers"  
        Created for PID: 341. 
Kernel Assertions: 0xc=USB,BT-HID
   id=500  level=255 0x4=USB creat=14/11/2020 17:32 description=com.apple.usb.externaldevice.14100000 owner=USB Receiver
   id=501  level=255 0x8=BT-HID creat=14/11/2020 17:32 description=com.apple.driver.IOBluetoothHIDDriver owner=IOBluetoothHIDDriver
Idle sleep preventers: IODisplayWrangler
hongphucvu@Phucs-MacMini ~ % pmset -g                                            
System-wide power settings:
Currently in use:
 standby              0
 Sleep On Power Button 1
 womp                 0
 autorestart          1
 hibernatefile        /var/vm/sleepimage
 proximitywake        0
 powernap             0
 gpuswitch            2
 networkoversleep     0
 disksleep            10
 standbydelayhigh     86400
 sleep                1 (sleep prevented by sharingd, UserEventAgent)
 hibernatemode        0
 ttyskeepawake        1
 displaysleep         10
 tcpkeepalive         0
 highstandbythreshold 50
 standbydelaylow      86400
hongphuc95 commented 3 years ago

This is interesting. I turned off my Bluetooth keyboard and switched to my Logitech keyboard paired with my USB dongle and now it can sleep properly. I have this time the event 2020-11-14 20:48:37.028175+0100 localhost powerd[67]: [powerd:sleepWake] AppWoke:com.apple.bluetoothd-blueavengers Reason:BlueAvengers: Toggle beacon state in the log which is strange cause I already disable Find My Mac. It hurts not to be able to use my mechanical keyboard due to sleep issue :(

hongphucvu@Phucs-MacMini ~ % log show --style syslog | fgrep "[powerd:sleepWake]"
2020-11-14 20:22:35.895598+0100  localhost powerd[67]: [powerd:sleepWake] vm.darkwake_mode: 0 -> 0
2020-11-14 20:22:35.900614+0100  localhost powerd[67]: [powerd:sleepWake] sendNoRespNotification: 0x19
2020-11-14 20:22:50.914620+0100  localhost powerd[67]: [powerd:sleepWake] chooseStandbyDelay(): lowBattery = false, battery powered = false, capacity=0, lowBatteryThreshold=0; chosen delay=86400
2020-11-14 20:22:50.915140+0100  localhost powerd[67]: [powerd:sleepWake] Eligible for Standby: 0
2020-11-14 20:22:50.915141+0100  localhost powerd[67]: [powerd:sleepWake] standbyDelay:86400 eligibleForStandby:0 elapsedTime:0 gDelta2Standby:86400
2020-11-14 20:22:50.915197+0100  localhost powerd[67]: [powerd:sleepWake] Entering Sleep state due to 'Software Sleep pid=128'
2020-11-14 20:22:50.915286+0100  localhost powerd[67]: [powerd:sleepWake] connectionFireNotification: 0x0
2020-11-14 20:22:53.914816+0100  localhost powerd[67]: [powerd:sleepWake] No AdaptiveWake is requested. InactivityEnd:Mon Jan  1 01:00:00 2001 PowerNap State:0
2020-11-14 20:22:53.914979+0100  localhost powerd[67]: [powerd:sleepWake] Wake scheduled by com.apple.alarm
2020-11-14 20:48:37.006751+0100  localhost powerd[67]: [powerd:sleepWake] No need to refresh inactivity prediction: phase=0, start=0.000000, now=627076117.006725
2020-11-14 20:48:37.006782+0100  localhost powerd[67]: [powerd:sleepWake] sendNoRespNotification: 0x8019
2020-11-14 20:48:37.012859+0100  localhost powerd[67]: [powerd:sleepWake] Updating wake start timestamp to 6321587624517
2020-11-14 20:48:37.028175+0100  localhost powerd[67]: [powerd:sleepWake] AppWoke:com.apple.bluetoothd-blueavengers Reason:BlueAvengers: Toggle beacon state
2020-11-14 20:48:37.028319+0100  localhost powerd[67]: [powerd:sleepWake] Wake reason: "<private>"  identity: "<private>"
2020-11-14 20:48:37.067985+0100  localhost powerd[67]: [powerd:sleepWake] vm.darkwake_mode: 0 -> 0
2020-11-14 20:48:37.077414+0100  localhost powerd[67]: [powerd:sleepWake] Cancelling dark wake update capabilities timer
2020-11-14 20:48:37.079018+0100  localhost powerd[67]: [powerd:sleepWake] vm.darkwake_mode: 0 -> 0
2020-11-14 20:48:38.148158+0100  localhost powerd[67]: [powerd:sleepWake] Updating wake end timestamp to 6322735723081
2020-11-14 20:48:38.148396+0100  localhost powerd[67]: [powerd:sleepWake] Wake from Normal Sleep [CDNVA] : due to XDCI/HID Activity
2020-11-14 20:48:38.148408+0100  localhost powerd[67]: [powerd:sleepWake] WakeDetails: <private>
2020-11-14 20:48:38.148808+0100  localhost powerd[67]: [powerd:sleepWake] <private>
2020-11-14 20:48:38.149218+0100  localhost powerd[67]: [powerd:sleepWake] sendNoRespNotification: 0x1f
hongphucvu@Phucs-MacMini ~ % pmset -g assertions                                 
2020-11-14 20:50:00 +0100 
Assertion status system-wide:
   BackgroundTask                 1
   ApplePushServiceTask           0
   UserIsActive                   1
   PreventUserIdleDisplaySleep    0
   PreventSystemSleep             0
   ExternalMedia                  0
   PreventUserIdleSystemSleep     1
   NetworkClientActive            0
Listed by owning process:
   pid 371(nsurlsessiond): [0x0000190100018c5d] 00:00:03 PreventUserIdleSystemSleep named: "NSURLSessionTask 517F7746-88CD-43F5-ABB4-72FF825512E9"  
    Timeout will fire in 10797 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190100018c5f] 00:00:02 PreventUserIdleSystemSleep named: "NSURLSessionTask FA5D4CF4-5CB0-4C3D-BAA3-FE289AA1E435"  
    Timeout will fire in 10797 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190100018c60] 00:00:02 PreventUserIdleSystemSleep named: "NSURLSessionTask 16D5E712-7FF5-4EF9-B588-612D21F29816"  
    Timeout will fire in 10797 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190100018c61] 00:00:02 PreventUserIdleSystemSleep named: "NSURLSessionTask 11C8CB7B-C625-45BE-A5AE-C72E451C2975"  
    Timeout will fire in 10797 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190100018c62] 00:00:02 PreventUserIdleSystemSleep named: "NSURLSessionTask 5444A769-54B7-4825-AA2A-29D10E9329C4"  
    Timeout will fire in 10797 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190100018c63] 00:00:02 PreventUserIdleSystemSleep named: "NSURLSessionTask 3AEC324F-5B0E-40E0-A905-1FB85B5DB241"  
    Timeout will fire in 10797 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190200018c65] 00:00:02 PreventUserIdleSystemSleep named: "NSURLSessionTask C651AB08-FC43-44CE-8684-0F7532642955"  
    Timeout will fire in 10797 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190200018c67] 00:00:02 PreventUserIdleSystemSleep named: "NSURLSessionTask A9AB77DA-1228-4A17-AE98-724ABAB8ACF2"  
    Timeout will fire in 10797 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190200018c69] 00:00:02 PreventUserIdleSystemSleep named: "NSURLSessionTask B28007B0-46CD-4C46-B08D-E17438E6BADF"  
    Timeout will fire in 10797 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190200018c6b] 00:00:02 PreventUserIdleSystemSleep named: "NSURLSessionTask 6F9719B6-D116-4F03-9DAE-8EEE3AE146EE"  
    Timeout will fire in 10797 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190200018c6d] 00:00:02 PreventUserIdleSystemSleep named: "NSURLSessionTask A317BB88-E02A-4AC3-A67D-411F2383AFB3"  
    Timeout will fire in 10797 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190200018c6e] 00:00:02 PreventUserIdleSystemSleep named: "NSURLSessionTask A57C1C66-25DE-4080-B234-8FEA3A1BF4A9"  
    Timeout will fire in 10797 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190200018c6f] 00:00:02 PreventUserIdleSystemSleep named: "NSURLSessionTask 7EC32580-EFB5-48B8-A18E-A4C46C9E80A9"  
    Timeout will fire in 10797 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190200018c70] 00:00:02 PreventUserIdleSystemSleep named: "NSURLSessionTask 37724ECA-3C7B-4FF5-896D-92715EC7A944"  
    Timeout will fire in 10797 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190200018c71] 00:00:02 PreventUserIdleSystemSleep named: "NSURLSessionTask FA7BF6FB-BB95-4F16-9FCB-57537EC5882D"  
    Timeout will fire in 10797 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190200018c72] 00:00:02 PreventUserIdleSystemSleep named: "NSURLSessionTask A831838B-2FCF-4FDB-A506-F726160EA9CD"  
    Timeout will fire in 10797 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190200018c73] 00:00:02 PreventUserIdleSystemSleep named: "NSURLSessionTask 7C22BF13-4C01-4A43-99F4-3613D8A0469E"  
    Timeout will fire in 10797 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190200018c74] 00:00:02 PreventUserIdleSystemSleep named: "NSURLSessionTask D658B4B3-0BB7-4ACF-9DA7-12F603D422F0"  
    Timeout will fire in 10797 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190200018c75] 00:00:02 PreventUserIdleSystemSleep named: "NSURLSessionTask 298D09DB-50F1-42A4-89B5-DF0794BBFDDC"  
    Timeout will fire in 10797 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190200018c76] 00:00:02 PreventUserIdleSystemSleep named: "NSURLSessionTask DF1B31C4-E3D8-4311-87F5-ED3F4E325040"  
    Timeout will fire in 10797 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190200018c77] 00:00:02 PreventUserIdleSystemSleep named: "NSURLSessionTask 4BFCEA93-E848-4905-9F42-C2137F46FEC8"  
    Timeout will fire in 10797 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190200018c78] 00:00:02 PreventUserIdleSystemSleep named: "NSURLSessionTask BB051F8C-9757-4A0E-888B-8B74B9A726F7"  
    Timeout will fire in 10797 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190200018c79] 00:00:02 PreventUserIdleSystemSleep named: "NSURLSessionTask 53A813F6-E487-443B-882E-E5AB918B6B87"  
    Timeout will fire in 10797 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190200018c7a] 00:00:02 PreventUserIdleSystemSleep named: "NSURLSessionTask 7811E351-5034-47A9-B2F8-CD7D27BA2038"  
    Timeout will fire in 10797 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190200018c7c] 00:00:02 PreventUserIdleSystemSleep named: "NSURLSessionTask 3FCD6770-8602-43C3-8290-916C92A462C5"  
    Timeout will fire in 10797 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190200018c7e] 00:00:02 PreventUserIdleSystemSleep named: "NSURLSessionTask 29F0CBD4-97AE-4CC6-BC7C-024D1BE57D69"  
    Timeout will fire in 10798 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190200018c80] 00:00:02 PreventUserIdleSystemSleep named: "NSURLSessionTask A88A1E39-EB43-42A1-83E2-9DC7E3847D31"  
    Timeout will fire in 10798 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190200018c81] 00:00:02 PreventUserIdleSystemSleep named: "NSURLSessionTask 606728EA-B661-4743-974A-9D012570BFE5"  
    Timeout will fire in 10798 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190200018c82] 00:00:02 PreventUserIdleSystemSleep named: "NSURLSessionTask A1F876B1-D301-43C3-8908-678C235D6F63"  
    Timeout will fire in 10798 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190200018c83] 00:00:02 PreventUserIdleSystemSleep named: "NSURLSessionTask C16A5ADF-C381-4F6B-977E-8637B8F09482"  
    Timeout will fire in 10798 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190200018c84] 00:00:02 PreventUserIdleSystemSleep named: "NSURLSessionTask 0AB9B1D3-3959-4A51-A4A4-F6D858758929"  
    Timeout will fire in 10798 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190200018c85] 00:00:02 PreventUserIdleSystemSleep named: "NSURLSessionTask FC749B6F-375F-4FD9-B485-D0FB54F3E596"  
    Timeout will fire in 10798 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190200018c86] 00:00:02 PreventUserIdleSystemSleep named: "NSURLSessionTask 83C4DD3C-5EFB-4C6C-ABF1-E9701656C35F"  
    Timeout will fire in 10798 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190200018c87] 00:00:02 PreventUserIdleSystemSleep named: "NSURLSessionTask 0E64CEF0-3B28-4811-9BC9-FF89C0D9ECE0"  
    Timeout will fire in 10798 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190200018c88] 00:00:02 PreventUserIdleSystemSleep named: "NSURLSessionTask 966EC7FC-D5A2-4EDE-92B4-3B512645C4A5"  
    Timeout will fire in 10798 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190200018c89] 00:00:01 PreventUserIdleSystemSleep named: "NSURLSessionTask CB7F6D5C-F588-4B5D-A0F9-7BCC46DA4A04"  
    Timeout will fire in 10798 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190300018c8a] 00:00:01 PreventUserIdleSystemSleep named: "NSURLSessionTask 4AC6C94A-86AE-4311-A32B-648F57C9B134"  
    Timeout will fire in 10798 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190300018c8b] 00:00:01 PreventUserIdleSystemSleep named: "NSURLSessionTask 48F1DF20-D08C-4295-8319-DBD48D2202D8"  
    Timeout will fire in 10798 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190300018c8c] 00:00:01 PreventUserIdleSystemSleep named: "NSURLSessionTask D24435E5-A829-48B5-AB33-15C93CAA7293"  
    Timeout will fire in 10798 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190300018c8d] 00:00:01 PreventUserIdleSystemSleep named: "NSURLSessionTask 90F6D369-4000-4277-94DD-73AAB339C74D"  
    Timeout will fire in 10798 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190300018c8e] 00:00:01 PreventUserIdleSystemSleep named: "NSURLSessionTask 60FCB598-C2B4-4B67-9A6F-EA16BF9475EF"  
    Timeout will fire in 10798 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190300018c8f] 00:00:01 PreventUserIdleSystemSleep named: "NSURLSessionTask 0432DA80-682C-495B-B8D0-D254C4A67EE2"  
    Timeout will fire in 10798 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190300018c90] 00:00:01 PreventUserIdleSystemSleep named: "NSURLSessionTask AD3C68A7-6936-499B-AF09-FBC9197215D9"  
    Timeout will fire in 10798 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190300018c91] 00:00:01 PreventUserIdleSystemSleep named: "NSURLSessionTask 0A326CF1-1BF1-4AF2-A601-B06E6307627F"  
    Timeout will fire in 10798 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190300018c93] 00:00:01 PreventUserIdleSystemSleep named: "NSURLSessionTask 0A926ED9-62DC-40DA-8D5F-599FF5AC6AE6"  
    Timeout will fire in 10799 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190300018c95] 00:00:01 PreventUserIdleSystemSleep named: "NSURLSessionTask 2AE8C2C4-8E1F-498D-A21A-B689362B0827"  
    Timeout will fire in 10799 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190300018c97] 00:00:01 PreventUserIdleSystemSleep named: "NSURLSessionTask 271194D2-017D-421C-ACA7-00DD009D1270"  
    Timeout will fire in 10799 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190400018c99] 00:00:00 PreventUserIdleSystemSleep named: "NSURLSessionTask 2DA12FE9-0B20-4B2C-8D5E-784B584F06BC"  
    Timeout will fire in 10799 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190400018c9a] 00:00:00 PreventUserIdleSystemSleep named: "NSURLSessionTask 153C2BC3-B118-461B-BC9C-A276B08C7233"  
    Timeout will fire in 10799 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190400018c9c] 00:00:00 PreventUserIdleSystemSleep named: "NSURLSessionTask E46226E6-0BC5-45C5-833A-69D3F8939154"  
    Timeout will fire in 10799 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190400018c9d] 00:00:00 PreventUserIdleSystemSleep named: "NSURLSessionTask B7C9B835-E658-4ADD-B2B7-9A9B83103EC8"  
    Timeout will fire in 10800 secs Action=TimeoutActionTurnOff
   pid 371(nsurlsessiond): [0x0000190400018c9f] 00:00:00 PreventUserIdleSystemSleep named: "NSURLSessionTask 90249645-9375-4907-80E7-25B1B595F482"  
    Timeout will fire in 10800 secs Action=TimeoutActionTurnOff
   pid 346(sharingd): [0x000018e700018bc1] 00:00:29 PreventUserIdleSystemSleep named: "Handoff"  
   pid 125(WindowServer): [0x000015120009898b] 00:00:00 UserIsActive named: "com.apple.iohideventsystem.queue.tickle serviceID:10000069a name:AppleUserHIDEventSe product:Karabiner DriverKit eventType:3"  
    Timeout will fire in 600 secs Action=TimeoutActionRelease
   pid 96(apsd): [0x000018ff000b8c4e] 00:00:05 ApplePushServiceTask named: "com.apple.apsd-recreatecourierstate-push.apple.com"  
Kernel Assertions: 0x4=USB
   id=500  level=255 0x4=USB creat=14/11/2020 17:32 description=com.apple.usb.externaldevice.14100000 owner=USB Receiver
Idle sleep preventers: IODisplayWrangler
zearp commented 3 years ago

So if I understand correctly with the bluetooth keyboard it cycles sleep states without waking up the screen all the time until you wake it up?

And without the bluetooth keyboard it cycles a couple of time before settling in sleep also without turning the screen back on?

I'm not sure if its possible to disable the bluetooth beacons completely. It will wake up from time to time to send out those beacons and the screen will stay off. There's not much info other than lots of people blaming sleep issues on it, but it is working as Apple intended it: periodic wake-ups for the Apple mesh network. It work similar to Tile.

It's possible that your bluetooth keyboard sends something out that prevents sleep from settling in. You can see this message repeated in our log with bluetooth: DarkWake from Normal Sleep [CDN] : due to XDCI/ -- those message usually indicate usb/bluetooth activity. You get a similar message when you wake it up pressing a key: Wake from Normal Sleep [CDNVA] : due to XDCI/HID Activity.

It would be nice if you could test it with another bluetooth keyboard if you have around. That way we can find out if its related to your keyboard or bluetooth in general. The best I can do is test sleep with in Big Sur with a bluetooth keyboard connected and see if I also get a sleep-cycle loop. At least the problem has been narrowed down to bluetooth. I'll update when I have Big Sur installed.

zearp commented 3 years ago

I've just done a clean install of Big Sur, and sleep is working fine with my old Apple bluetooth keyboard. I've also tested a cheap AliExpress bluetooth keyboard and sleep worked with that one too. All I did after installation was the same as you did; disable hibernate mode and such. It didn't even do the cycle thing, it went straight into amber led and has stayed there since I started typing this reply.

I hope you can try another bluetooth keyboard, just so we know if your sleep issue is caused by bluetooth in general or your keyboard. I'm sorry I can't do more but if I can't reproduce the issue there's not much I can do unfortunately.

If anything update to the latest versions of OpenCore and co from the repo. Just so we use the same EFI.

hongphuc95 commented 3 years ago

Strangely, I can connect to my Apple Magic Keyboard via Bluetooth but my Logitech Bluetooth devices refuse to connect so I can't test it properly yet. Mine every time I put it into sleep mode it takes about 6-7 seconds before the led changes. I'll do a fresh install of Big Sur with your identical EFI next week so we're on the same pace. I'll keep you to do date on this.

zearp commented 3 years ago

I'm afraid the Logitech might "do" something that macOS's bluetooth stack doesn't like. If it works with one keyboard but doesn't with another the problem lies in that keyboard. I do know macOS can be very fussy sometimes. When I enter sleep from the menu on top it also takes about 10-30 seconds before it fully sleeps (sometimes longer).

I don't think there's much we can do to change this. It also happens on my MBP. Sometimes it goes to sleep very quickly, sometimes it takes a while. Maybe it waits for some background processes or does some checks, really no clue what its doing.

What you can do when testing is open the debug menu and clear all devices and reset the bluetooth module. It may help when you can't pair new devices. Specially if you're using the Intel Bluetooth chip. You get to the debug menu by holding down shift + alt and then click the bluetooth icon in the top bar.