On December 16, 2009 at 17:01, Prontosw said...
Installed the new firmware & PEP today and tried to get the script above to use the WOL function but no luck... does the script needs to be changed to get it working poperly ?
It likely has to be changed yes, since opening a TCP connection to a broadcast address will probably not work (TCP is a point-to-point protocol; there is no TCP server listening on the broadcast address to accept the connection), so you'll never get an 'onConnect'.
Try something like:
function sendWOL(aMacAddress) {
var s, i, packet;
// Constuct payload: 6 0xFF bytes..
packet = "\xFF\xFF\xFF\xFF\xFF\xFF";
// ..followed by 16 repetitions of the MAC address
for (i = 0; i < 16; i += 1) {
packet += aMacAddress;
}
s = new UDPSocket();
// Now, send that packet 40 times, in UDP packets,
// to the "all multicast hosts" address.
for (i = 0; i < 40; i += 1) {
s.send(packet, "224.0.0.1", 7);
}
s.close();
}
// Send WOL to 00:17:55:BE:00:F0
sendWOL("\x00\x17\x55\xBE\x00\xF0");
(Note: I haven't tested this code)