Elk Wake on Lan

Smarty

Active Member
Tis the season for rolling blackouts and misc power outages....

Background: I have and elk M1 and a home automation computer (on a UPS), running PowerHome. Whenever there is a power outage, I start a timer on the M1 via the rules and triggers. If the power outage is greater that say 5 minutes, I have the Elk turn on an output that triggers PowerHome to run a macro that causes the computer to Hibernate/Sleep.

When the line power is restored (which can be sensed by the M1), I am looking for a way to have the M1 "wake up" the hibernating computer. Does anyone know a way to do this? The Elk (via the EXP) and the computer are on the same network. Ideas? can the M1 send magic packets? If so, how?

Thanks
 
Only simple way I can think of is by connecting an output to the power switch on the computer. Some motherboards support waking up when they see activity on the serial port, so maybe you could go that route.
 
From Wikipedia:
The magic packet is a broadcast frame containing anywhere within its payload 6 bytes of all 255 (FF FF FF FF FF FF in hexadecimal), followed by sixteen repetitions of the target computer's 48-bit MAC address.

From Elk's RS-232 protocal Doc:
4.3 Send ASCII String To IP Address(AP)
The AP command allows you to send a custom ASCII string message via
TCP/IP to a specific IP address on a specific port. To accomplish this,
you need to create a TEXT string in the Automation/Text section of ELKRP
which is stored in the M1.

I know the MAC address of the machine I want to wake up....so there should be a way to do this....

Any proficient ELK-232 protocal people out there?
 
From Wikipedia:
The magic packet is a broadcast frame containing anywhere within its payload 6 bytes of all 255 (FF FF FF FF FF FF in hexadecimal), followed by sixteen repetitions of the target computer's 48-bit MAC address.

From Elk's RS-232 protocal Doc:
4.3 Send ASCII String To IP Address(AP)
The AP command allows you to send a custom ASCII string message via
TCP/IP to a specific IP address on a specific port. To accomplish this,
you need to create a TEXT string in the Automation/Text section of ELKRP
which is stored in the M1.

I know the MAC address of the machine I want to wake up....so there should be a way to do this....

Any proficient ELK-232 protocal people out there?

My understanding is that the packet is usually sent on UDP port 7 or 9 (usually 9), but it can be sent using either UDP or TCP on any port. You will need to do UDP since it doesn't require a syn/syn-ack/ack before sending data. Assuming the IP stack on the XEP will set the destination MAC to broadcast (FF:FF:FF:FF:FF:FF) when you send data to the Layer-3 broadcast address (.255 on a /24), then you should be able to craft a command that will do that.

How do you get the AP command to actually execute? You can't do it through rules can you?
 
One other option I can think of is to build an OpenWRT based router, and either write an M1 driver in PHP or something (which is what I did), or have it automatically send the WOL packet upon bootup, and control the router with an appliance module (got an old Linksys WRT54G laying around?).
 
Any chance you can set the PowerHome computer BIOS to always boot when power is applied and control the computer input power via the Elk and a relay?

1) turn the power relay off after giving the computer time to hibernate.
2) turn the power back on when you want it the computer to boot.
 
Or couldn't you just use a relay to short the power switch jumper on the MB? Most power switches these days will bring a computer out of sleep.

I can't get WOL to work most of the time between PC's that support it natively, not to mention trying to hack an ELK to send out the right packet. I wish you luck...
 
Back
Top