Search code examples
applescriptosx-maverickswake-on-lan

Wake on lan doesn't wake up the display of OSX Mavericks


I updated to OSX 10.9.5 and realized that one function pipeline that I used flawlessly is now broken.

I send a wake-on-lan magic packet to my OSX from my Raspberry Pi which successfully wakes up the OSX, but unlike before the iMac's display stays dark. Previously the display also brightened up. The problem is not that particularly, but that when I run an applescript through SSH the iMac goes back to sleep by itself in the middle of running and I have to wake it up again to finish the interrupted script. I have setup my energy saving to "Never" so it shouldn't do that.

I even tried running a script that actually sets the brightness of iMac's display to highest, but that doesn't wake up the display either.

Only when I take a VNC connection or move the local USB mouse the display wakes up and OSX won't go back to sleep by itself.


Solution

  • I found a solution for this. Just run this on the remote OSX's terminal:

    caffeinate -u -t 1
    

    It will wake up the display immediately. I found the solution from this blog