2007-01-25, 17:46
ow and it has a really ugly icon
kricker Wrote:I am trying to get my Xbox to send a WOL to my server when XBMC starts. I understand how to use autoexec.py. The problem lies in trying to find the correct WOL script. I have the tweaked WOL, but it opens a GUI to select the PC to wake. This is great if I have other computers to wake, but I want it to always wake the server and not show a GUI when running at startup. All my searches for the older WOL showed either dead links or the code I lifted from the posts did nothing. Can anyone please help me out?
# Wake-On-LAN
#
# Copyright (C) 2002 by Micro Systems Marc Balmer
# Written by Marc Balmer, [email protected], http://www.msys.ch/
# This code is free software under the GPL
import struct, socket
def WakeOnLan(ethernet_address):
# Construct a six-byte hardware address
addr_byte = ethernet_address.split(':')
hw_addr = struct.pack('BBBBBB', int(addr_byte[0], 16),
int(addr_byte[1], 16),
int(addr_byte[2], 16),
int(addr_byte[3], 16),
int(addr_byte[4], 16),
int(addr_byte[5], 16))
# Build the Wake-On-LAN "Magic Packet"...
msg = '\xff' * 6 + hw_addr * 16
# ...and send it to the broadcast address using UDP
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
s.sendto(msg, ('<broadcast>', 9))
s.close()
# Example use
WakeOnLan('aa:bb:cc:dd:ee:ff') # My PC
kricker Wrote:That is the exact code I tried to lift and use. When I run it nothing happens. If I run the tweaked WOL script it works properly.I tested before I posted, and copied and pasted from the forums just to double check, and it all works fine. Have you tested as just a standalone script?
kricker Wrote:I looked for Nuka's Plug-in maker and could not find it. Is it only in the SVN? So I need to find it there? I'd love for it to only send the WOL when the share is requested. That is even better than always waking the server at boot up.The repositry is covered in this thread http://forum.xbmc.org/showthread.php?tid=29911
<onclick>XBMC.RunScript(Q:\scripts\Wake\wakePVR.py)</onclick>