I am on my third replacement iMac (27" late 2012), the last two are exhibiting identical issue: the machines will go to sleep and will not wake up, and in addition the power button is disabled, i.e. pressing the power button will not restart the machine.
I am guessing that the SMC crashed, as the only course of recovery is to reset the SMC by removing power, pressing the power button for a while, and attempting to restart (does not work all the time, so I sometimes have to repeat the SMC reset procedure).
after doing some research on the net, I found how to see the hibernate mode, and found out that my machine was set to hibernate mode 5.
I used the system pref -> energy saver and clicked restore defaults which restored it to 0.
HOWVER, upon plugging in a powered USB hub, the hibernate mode was automagically reset to 5.
once at hibernate mode 5, putting the machine to sleep manually exhibited the same symptoms, i.e. not wake from sleep and disabled power button.
this was done with an apple care tech on the phone, and he recommended replacing the iMac once again, and sending me a fourth replacement!
overnight I played some more with this
I reset the hibernate mode but this time to 3 and I tried a different USB hub.
hibernate mode stayed at 3 after plugging in the USB hub.
I then created a small shell script to monitor and display the hibernate mode:
function showhibernate() {
while true
do echo -n `date` " ";pmset -g|grep hibernatemode;sleep 10
done
}
and executed it overnight
this evening after I came home from work, I noticed that the hibernate mode somehow was switched from 3 to 7!?
unfortunately, I did not have the echo `date` on the first version, so I do not know when it was switched from 3 to 7.
however, the machine did wake up from sleep... (so it seems that 7 is not as bad as 5?)
I am guessing that some powered USB hubs cause unexpected changes to the hibernatemode, which in turn cause the SMC to crash, disabling the power button.
do you have any idea why plugging in some powered USB hubs but not others will cause the hibernatemode to switch?
do you have any idea why hibernate mode would automagically switch from 3 to 7?
neither 5 nor 7 are documented in the man page, and the only recommended modes are 0 3 and 25:
We do not recommend modifying hibernation settings. Any changes you make are not supported. If you choose to do so anyway, we recommend using one of these three settings. For your sake and mine, please don't use anything other 0, 3, or 25.
For now I cancled the shipment of the fourth replacement, as this seems to be an issue affecting all iMacs (and a specific USB powered hub), so that a new machine will not resolve the issue...