Implementing Wake On Lan WOL

Tutorials for working with our software
Locked
User avatar
DemoPad
Site Admin
Posts: 723
Joined: Thu Jun 14, 2012 10:46 am
Contact:

Implementing Wake On Lan WOL

Post by DemoPad » Thu Jul 05, 2012 4:29 pm

To implement Wake On Lan, you first need to know the 'magic packet' to send to the network. This consists of 6 bytes of 255 (or FF in hex) followed by 16 repetitions of the device's MAC address, in hex format.

Hex data is entered in our software in \x format, hence the command will be:

\xFF\xFF\xFF\xFF\xFF\xFF[MAC address x 16]

So for example, if the MAC address of the machine is 00:1e:bc:04:45:d1, then the command should be:

\xFF\xFF\xFF\xFF\xFF\xFF\x00\x1E\xBC\x04\x45\xD1\x00\x1E\xBC\x04\x45\xD1
\x00\x1E\xBC\x04\x45\xD1\x00\x1E\xBC\x04\x45\xD1\x00\x1E\xBC\x04\x45\xD1
\x00\x1E\xBC\x04\x45\xD1\x00\x1E\xBC\x04\x45\xD1\x00\x1E\xBC\x04\x45\xD1
\x00\x1E\xBC\x04\x45\xD1\x00\x1E\xBC\x04\x45\xD1\x00\x1E\xBC\x04\x45\xD1
\x00\x1E\xBC\x04\x45\xD1\x00\x1E\xBC\x04\x45\xD1\x00\x1E\xBC\x04\x45\xD1
\x00\x1E\xBC\x04\x45\xD1\x00\x1E\xBC\x04\x45\xD1


Note the capitalization of the hex values. There should be no carriage returns in the command, ensure that it is one continuous string.

This should be sent out, typically on port 7 or 9 via UDP to the network broadcast address, usually 192.168.1.255 (though this is network dependent).

Set up a device in the software with the IP address as above, port 7 or 9, and tick UDP. Remove the default command suffix, and enter the magic packet command as a pre-defined command. There should be a total of 102 hex values in \x format, including the first 6 FF bytes.

It is strongly recommended that you test Wake On Lan with a 3rd party app before attempting in DemoPad to confirm that it works!

Locked