How can I wake up my Mac from sleep mode remotely?

From this post:

Most modern computers offer a feature called "Wake on LAN". This is designed to allow a network administrator to turn on a computer remotely, even when it is turned off, by sending a "magic packet". This is used, for instance, to allow backup programs to run at night.

Here is a Python script that does this (if your MAC address is01-23-45-67-89-0a:

#!/usr/bin/env python 
import socket 
s=socket.socket(socket.AF_INET, socket.SOCK_DGRAM) 
s.sendto('\xff'*6+'\x01\x23\x45\x67\x89\x0a'*16, ('192.168.1.255', 80))

Or you can use Wake550.

or use this site.


Historically, I've accomplished this by two means. First, both methods require you to check "Wake for Network Access" in System Preferences -> Energy Saver

System Preferences - Energy Saver

(1) If you open Finder, expand the "Shared" section if necessary, and connect to the sleeping computer!

This works occasionally, but not every time. The bonus is that (presumably) at this point, I'm doing what I needed to do anyways.

(2) If that failed, I generally open Wake On LAN and manually send a Wake request to the computer.


@Am1rr3zA, I had to add one line to your Python script to make it work, as documented on this page:

#!/usr/bin/env python 
import socket 
s=socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
s.sendto('\xff'*6+'\x01\x23\x45\x67\x89\x0a'*16, ('192.168.1.255', 80))

You can also wake up your Mac over wireless.

First, your Mac must support Wake on Wireless. Second, your router must support Wireless Multimedia Extensions (WME), also known as Wi-Fi Multimedia (WMM).

After your enabled WME on your router, you must enable "Wake for network access" on your Mac. Then check the MAC address of your wireless card of your Mac. Put your Mac into sleep. From a second computer log in to your router and with the WOL (Wake on LAN) option wake up your Mac wirelessly by entering the MAC address.

Remember, not every router supports WME.