API Reference

Interface function located in the pywol.wol module.

wake

pywol.wol.wake(mac_address, *, ip_address='255.255.255.255', port=9, return_dest=False)[source]

Generate and send WoL magic packet.

Prefer to specify the IPv4 broadcast address of the target host’s subnet over the default ‘255.255.255.255’.

To automatically resolve the broadcast address of a subnet, specify the target host’s IPv4 address along with its netmask. E.g. ‘192.168.1.5/24’ or ‘192.168.1.5/255.255.255.0’ –> ‘192.168.1.255’

Parameters:
mac_address : str

Target MAC address.

ip_address : str, optional

Target IPv4 address. (default is ‘255.255.255.255’).

port : int, optional

Target port. (default is 9).

return_dest : bool, optional

Flag to return package destination ip & port on success. (default is False).

Returns:
tuple(str, str)

Returns destination IP & port of successfully sent package if return_dest is True.