xboxscene.org forums

Author Topic: Feature Request: Wake On Lan  (Read 87 times)

miDJAR

  • Archived User
  • Newbie
  • *
  • Posts: 8
Feature Request: Wake On Lan
« on: December 31, 2003, 02:32:00 AM »

I've made a small app to the Xbox that sends magicpackets... (broadcasting)...
I made it so you can specify a xbe to exit to...
If someone want it to be sent to use ip also I can fix it...
If there is request for it I will release it....
Logged

Aron Parsons

  • Archived User
  • Sr. Member
  • *
  • Posts: 299
Feature Request: Wake On Lan
« Reply #1 on: December 01, 2003, 08:04:00 AM »

I had this idea as well, just never said anything about it (for XBMC, it's now almost fully taken over my media on the Xbox due to AC3 passthrough).  However, I can't access the script file from your link (can't contact the server).  Any help?
Logged

lusken

  • Archived User
  • Newbie
  • *
  • Posts: 11
Feature Request: Wake On Lan
« Reply #2 on: December 02, 2003, 07:16:00 AM »

CODE

# 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, ('', 9))
 s.close()

# Example use
WakeOnLan('0:3:93:81:68:b2')

-------------------------------
Logged

Drpiety

  • Archived User
  • Jr. Member
  • *
  • Posts: 82
Feature Request: Wake On Lan
« Reply #3 on: December 02, 2003, 06:42:00 PM »

i doubt that the box can be waked by lan, would be nice though...
Logged

lusken

  • Archived User
  • Newbie
  • *
  • Posts: 11
Feature Request: Wake On Lan
« Reply #4 on: December 03, 2003, 02:37:00 AM »

smile.gif   (Read the first post in this tread)

Short version: It works!

(Just to avoid misunderstandings. I want to wake up my PC from the xbox using xbmp - I can do it using xbmc)
Logged

Aron Parsons

  • Archived User
  • Sr. Member
  • *
  • Posts: 299
Feature Request: Wake On Lan
« Reply #5 on: December 03, 2003, 08:44:00 AM »

I'm at work right now, but do you supply the MAC address or the IP (looks like MAC)?
Logged

Aron Parsons

  • Archived User
  • Sr. Member
  • *
  • Posts: 299
Feature Request: Wake On Lan
« Reply #6 on: December 03, 2003, 08:45:00 PM »

wink.gif

Thanks for the code.
Logged

kaylapuppy

  • Archived User
  • Full Member
  • *
  • Posts: 182
Feature Request: Wake On Lan
« Reply #7 on: December 13, 2003, 02:51:00 PM »

Hey Lusken,

You said that this script works for you right ? What setup do you have at home ? Is your xbox directly attached to your PC or are you going through a router ? I have a network with 2 PC's and an XBOX all through a router. Both of my PC's will respond fine to a wol call, so I know they both work, but using this script, I cannot get my xbox to wake them up. I have tried pasting my mac address from my PC into the script, and it doesn't work. I have the latest version of XBMC. Is there something else I have to do to get this working ? Can you paste the exact script you are using, but just put xx:xx:xx:xx:xx:xx in for your MAC.

Regards,
KP
Logged

kaylapuppy

  • Archived User
  • Full Member
  • *
  • Posts: 182
Feature Request: Wake On Lan
« Reply #8 on: December 14, 2003, 06:37:00 AM »

OK thanks. I tried that but it didn't seem to work for me. The WOL proggie I use to wake my PC's on the network, or over the internet requires that the IP also be supplied in addition to the MAC address. I'm not sure if maybe the router is causing a problem, and i why this xbox script is not seeing the pc simply based on the mac. Perhaps if there was another script that sent the magic packet out based on MAC and IP, it might work in my setup.

Thanks again, I'll try and play around with it.

Regards,
KP
Logged