I have done a fresh install of El Capitan on the iMac (11,1), after replacing the HDD with an SSD. Previously it was running Mavericks with no problems, but it was getting slow and dated. One thing to note for disclosure is that I installed Macs Fan App, as the iMac didn't want to play nicely with the SMART temperature sensor on the drive out of the box. I have however tried disabling the app before putting the iMac to sleep and it changes nothing with regards to the problems.
Initially the issue was the the iMac would wake up in the middle of the night and randomly restart. This appears to be a problem that happens to people and none of the solutions I tried worked (there is no Antivirus, FileVault is disabled).
I have attempted to circumvent the problem by setting the hibernatemode to 25 and disabling DarkWake (I am not sure the latter worked as I am not seeing it under Domain column, but some stuff still appears in the PM log):
2020-11-04 10:54:37 +0100 Notification Display is turned off
2020-11-04 10:54:37 +0100 Assertions PID 97(hidd) Summary UserIsActive "com.apple.iohideventsystem.queue.tickle" 00:18:10 id:0x0x9000001be [System: DeclUser kDisp]
2020-11-04 10:54:37 +0100 Assertions Kernel Idle sleep preventers: -None-
2020-11-04 10:54:37 +0100 Assertions PID 54(powerd) Created InternalPreventSleep "com.apple.powermanagement.darkwakelinger" 00:00:00 id:0x0xd0000028d [System: DeclUser SRPrevSleep kCPU kDisp]
2020-11-04 10:54:52 +0100 Assertions PID 54(powerd) TimedOut InternalPreventSleep "com.apple.powermanagement.darkwakelinger" 00:00:15 id:0x0xd0000028d [System: DeclUser SRPrevSleep kCPU kDisp]
2020-11-04 10:54:52 +0100 Summary- [System: DeclUser kDisp] Using AC
Sleep/Wakes since boot at 2020-11-04 10:35:51 +0100 :0 Dark Wake Count in this sleep cycle:0
Anyways, the computer still occasionally wakes up, after being explicitly put to sleep from the Apple menu, and it always happens after exactly 10 minutes. Here is a log snippet of that:
Time stamp Domain Message Duration Delay
========== ====== ======= ======== =====
UUID: BC26B472-54C5-4640-B214-18F5A5C336EF
2020-11-04 10:55:07 +0100 Sleep Entering Sleep state due to 'Software Sleep pid=93': Using AC 569 secs
2020-11-04 10:55:10 +0100 Wake Requests [*proc=mDNSResponder request=Maintenance inDelta=528]
2020-11-04 10:55:10 +0100 PM Client Acks Delays to Sleep notifications: [IOPowerWatcher is slow(263 ms)] [com.apple.telemetry is slow(262 ms)] [com.apple.time is slow(263 ms)] [com.apple.notificationcenter.dnd is slow(263 ms)] [com.apple.xpc.activity is slow(263 ms)] [com.apple.time is slow(263 ms)] [com.apple.xpc.activity is slow(263 ms)] [opendirectoryd is slow(263 ms)] [VPN is slow(263 ms)] [IOPowerWatcher is slow(263 ms)] [networkd power system capabilities monitor is slow(263 ms)] [IPConfiguration is slow(264 ms)] [mDNSResponder is slow(268 ms)] [AirPort configd plug-in is slow(269 ms)] [com.apple.apsd is slow(3412 ms)]
2020-11-04 11:04:19 +0100 Kernel Client Acks Delays to Sleep notifications: [powerd is slow(3418 ms)] [BroadcomBluetoothHostControllerUSBTransport driver is slow(msg: SetState to 1)(437 ms)] [en0 driver is slow(msg: WillChangeState to 0)(2139 ms)]
2020-11-04 11:04:19 +0100 Assertions Kernel Idle sleep preventers: IODisplayWrangler
2020-11-04 11:04:19 +0100 Notification Display is turned on
2020-11-04 11:04:19 +0100 Assertions PID 90(mDNSResponder) Created MaintenanceWake "mDNSResponder:maintenance" 00:00:00 id:0x0xd000002a1 [System: DeclUser BGTask SRPrevSleep kCPU kDisp]
2020-11-04 11:04:19 +0100 Assertions PID 90(mDNSResponder) Released MaintenanceWake "mDNSResponder:maintenance" 00:00:00 id:0x0xd000002a1 [System: DeclUser BGTask kDisp]
2020-11-04 11:04:36 +0100 Wake Wake from Hibernate [CDNVA] due to EHC1 EHC2/User: Using AC
2020-11-04 11:04:36 +0100 Kernel Client Acks Delays to Wake notifications: [AppleHDADriver driver is slow(msg: SetState to 1)(478 ms)] [AppleHDADriver driver is slow(msg: SetState to 1)(400 ms)] [com_apple_driver_AppleUSBCardReaderDriverNub driver is slow(msg: SetState to 2)(10156 ms)] [AppleBluetoothHIDKeyboard driver is slow(msg: SetState to 1)(11978 ms)] [BNBMouseDevice driver is slow(msg: SetState to 1)(11979 ms)]
2020-11-04 11:05:06 +0100 Assertions PID 681(Bluetooth Setup Assistant) Created PreventUserIdleDisplaySleep "Bluetooth Setup Assistant" 00:00:00 id:0x0x5000002c7 [System: PrevDisp DeclUser kDisp]
2020-11-04 11:05:16 +0100 Assertions PID 54(powerd) Created InternalPreventDisplaySleep "com.apple.powermanagement.delayDisplayOff" 00:00:00 id:0x0x10000002c8 [System: PrevDisp DeclUser IntPrevDisp kDisp]
2020-11-04 11:05:16 +0100 Assertions PID 681(Bluetooth Setup Assistant) Released PreventUserIdleDisplaySleep "Bluetooth Setup Assistant" 00:00:09 id:0x0x5000002c7 [System: DeclUser IntPrevDisp kDisp]
2020-11-04 11:10:16 +0100 Assertions PID 54(powerd) TimedOut InternalPreventDisplaySleep "com.apple.powermanagement.delayDisplayOff" 00:05:00 id:0x0x10000002c8 [System: DeclUser IntPrevDisp kDisp]
I keep seeing mDNSResponder there, and IODisplayWrangler, but networkoversleep is disabled. These are my settings:
Currently in use:
hibernatemode 25
halfdim 1
womp 1
networkoversleep 0
sleep 10
Sleep On Power Button 1
ttyskeepawake 1
hibernatefile /var/vm/sleepimage
autorestart 0
disksleep 10
displaysleep 10
and these are the capabilities:
Capabilities for AC Power:
displaysleep
disksleep
sleep
womp
autorestart
halfdim
ttyskeepawake
hibernatemode
hibernatefile
I have no idea what is causing the iMac to have this insomnia. I have spent many hours researching this. It is running the newest SMC and EFI firmware updates. I did the usual dance of resetting the SMC and NVRAM. Nothing helps. To add a final log, this is what happens when the Mac crashes in the middle of the night and reboots (here around 2015-10-25 01:20):
- crash report: https://gist.github.com/szymonlopaciuk/6209c9444894113aaba06dce86abdc06#file-crash-log-txt
pmset -g everything: https://gist.github.com/szymonlopaciuk/6209c9444894113aaba06dce86abdc06#file-pmset-log-txt
To summarise, the Mac does not want to sleep, even with hibernatemode 25, wakes up on its own frequently, and some of those times, usually in the night, crashes and reboots autonomously. I am at a loss, and I have run out of hypotheses and ideas to try. I would at least want it to sleep and not wake up to minimise the number of crashes. It seems that after my fiddling with the pmset settings, the frequency of the crashes decreased, but I have no idea what is happening...
I would be thankful for any advice and suggestions!