Digital Loggers

Wake on Lan (WOL) for DLI power controllers.

WOL - Wake on Lan

DLI power switches can send a network message to remotely power-up systems using the Wake On Lan standard.The WOL command is called a "magic packet".  It's sent via the Lua or  BASIC scripting languages.  TCompatible products include the Ethernet Power Controller, Web Power Switch, POE injectors and DIN relays.  A full list of scripting commands can be found here.   For non-WiFi products, firmware versions 1.5.2 and later support WOL.  Here's a step-by-step example:

1.  Set the target system to respond to WOL.  This is a BIOS setting.  Each computer is different, but it's generally easy to find.  Often, holding down the DEL key or pressing ESC or F1 during boot will enter the BIOS setup.  Enable WOL and save your changes.  Here are examples from an Award BIOS and an HP server:


 


2. Next, set up network adapter options to enable WOL. In Windows, you'll log on as an administrator, launch Device Manager, select the network adapter used for WOL, open the properties and click "advanced". Check the list of options displayed. Again, they will vary from computer to computer. Look for an option like "WOL", "Magic packet" or "enable remote power control" and enable it..   Here's a good description of WOL setup under Linux.  While you're setting this, make note of the MAC address of the physical WOL port.  Here's a utility to help find the MAC address if it isn't apparent..

On most systems, only one physical Ethernet port on the motherboard can be used for WOL.  Once WOL is enabled in the BIOS, you'll see a link light only on this port when system power is turned off.

3. At this point, you're ready to test the system.  The easiest way to do this is with a free WOL utility.  Here's one for Windows:

 Linux users have it easy.  Just invoke "wakeonlan":

wakeonlan 01:23:45:67:89:ab

If WOL doesn't power-up the machine, first check that broadcast is passing through your router or switch.  The WOL "magic packet" needs to be broadcast to all systems via the OSI Layer 2 broadcast address.  WOL is most commonly configured to function only between devices in the same subnet.  Troubleshoot using a direct hardwired connection.  The Wikipedia WOL explanation is helpful.

4.  Now you're ready to create a script.  It's easy in BASIC.  Log in as admin. Follow the scripting link on the left. Disable scripting.  Enter the following example as shown below.  Subsitute  your MAC address in string 2 in the format 01:02:03:04:05:06  Enable scripting.  Cycle power to the switch.  Line 1 of the script sends a magic packet  to the target MAC in string 2 and wakes the target.  Line 2 of the script just prints a message "Wake up..." to the LCD.  In this example, we've used "power up" to start the script. This works because Line 1 is always executed on power-up when scripting is enabled.  You can start scripts that include WOL functions with an HTTP command, shortcut on the desktop, autoping event, remote program, or a more complicated script. 

Here's a BASIC example:

 

Here's a Lua WOL example that runs on any DLI WiFi enabled product:

#!/usr/bin/lua

if #arg ~= 2 then
  print("Usage:  wol.lua <broadcast> <mac>\n")
  os.exit()
end

local mac = ''
for w in string.gmatch(arg[2], "[0-9A-Za-z][0-9A-Za-z]") do
  mac = mac .. string.char(tonumber(w, 16))
end

local udp = require("socket").udp()
udp:settimeout(1)
udp:setoption("broadcast", true)
udp:sendto(string.char(0xff):rep(6) .. mac:rep(16) , arg[1], 9)

Have a look at the BASIC or Lua scripting pages for more details. Hope this helps.  Please share comments and suggestions. Thanks!

 

"Wake on LAN" is a trademark of IBM