WOL (Wake on LAN) script - start a computer remotly

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
mjhodgson Offline
Junior Member
Posts: 1
Joined: Jan 2006
Reputation: 0
Post: #11
hi

usually the pc has to be shutdown in a state that allows it to listen for wake-on-lan packets. this means that in windows (2000 and xp) you need to tell the driver to do this. if you have let windows use it's driver (a microsoft provided one) when you installed the pc/network card, then you probably won't have this option. i had to install the ones from the 3com site. this will allow you to go to (roughly) control panel - computer management - device manager - network adapters - properties. on the 3com drivers i have under the advanced tab "rwu magic packet", this needed to be set to enable (plus a reboot) for wol to work. you may have something similar under your network drivers.

under linux, i believe a tool called ethtool can set this up, but i've never got it to work with my network cards.


mjh
find quote
dragonneus Offline
Junior Member
Posts: 11
Joined: Jan 2006
Reputation: 0
Star    Post: #12
ahhh coolt he info ive been looking for, ill try it and let you all know what ive found
find quote
sCAPe Offline
Fan
Posts: 441
Joined: Mar 2005
Reputation: 0
Location: Germany
Post: #13
(asteron @ jan. 10 2006,19:32 Wrote:the magic packet shouldnt care about port...  looking at the code it looks like this

Quote:    # broadcast it to the lan.
   sock = socket.socket(socket.af_inet, socket.sock_dgram)
   sock.setsockopt(socket.sol_socket, socket.so_broadcast, 1)
   sock.sendto(send_data, ('<broadcast>', 7))

can be changed to something like
Quote:    # send to specific computer
   sock = socket.socket(socket.af_inet, socket.sock_dgram)
   sock.sendto(send_data, ('host_ip', 'port_number'))
replace those last two fields with the pc's local address.
this makes the script less general of course.  try setting the router to forward the port to the correct ip.

i have a broadcom onboard network card, and changed the settings in windows xp device manager to wake on lan = magic frame and i also tried wake on lan = wake up frame. nothing works.

but you suggested to forward the port in my router config. but how will that work, because if the pc is off, then the router cannot contact any ip-adress. it has to use the mac-adress like the script does.

so, before i am doing more on trying this out i would like to know if this script is already working for somebody ??

My XBOX built into a Sony Hifi CD-Player Case
XBOX Hifi Media Center Picture Gallery

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
Asteron Offline
"Skilled" Python Coder
Posts: 933
Joined: Feb 2004
Reputation: 0
Post: #14
the pc should show up on the router if it has wol even if it is off. even when off the nic is somewhat powered to listen for the packet. i dont actually have experience with wol but am just saying how i understand it to work.
find quote
jepper Offline
Member
Posts: 52
Joined: Nov 2006
Reputation: 0
Post: #15
hi all

i made remote wol as an experiment since wake on lan doenst work for me.
i thought the router was a problem so i wrote a script that connects to a site an d that site (writen by myself, source included) that send the magic packet

it has a few advantages over the wol script:
- wake any pc you want (doenst have to be in your lan)
- can bypass routers if you use NAT-forwarding


but it didnt work for me, my router thinks its an attack and whatever i tried it keeps killing the waking packet

so here's the project. Its not done yet but maybe some python devver likes this script and wants to make this into something usefull!

NOTE ! there is no readme and no fancy settings menu. I cant even try if it works!

link:
http://test.familie-gerbers.nl/RemoteWOL.zip


peace out

Jasper
find quote
jepper Offline
Member
Posts: 52
Joined: Nov 2006
Reputation: 0
Post: #16
ow and it has a really ugly icon Tongue
find quote
JoJa15 Offline
Junior Member
Posts: 2
Joined: Feb 2007
Reputation: 0
Post: #17
I am working on an advanced Wake On Lan script for XBMC. So far the WOL function is working and I would like to add the ability to show if a machine is up or off (I figured I would do so by pinging the machine and seeing if I get a response). I would also like to add the ability to remotely shutdown a computer from the XBMC script. Does anyone have a code snippet for pinging an IP, a code snippet for shutting down a remote Windows machine, and a code snippet for sending a HTTP request?

Here is my current setup:

Latest XBMC
FreeNAS (media server running on FreeBSD. Can be shutdown from web interface so I planned on just sending that same web button click from XBMC to shutdown the FreeNAS server)
Windows XP machine with folder share (What packet is sent over the network to remotely shutdown a Windows XP machine?)

My hope is to have a script then when you start it will list all your remote computers/servers and show if they are currently on/off. Then you can select a server and turn it off if it is on or turn it on if it is off.

Thank you in advance for any help provided.

- John
find quote
timdog82001 Offline
Posting Freak
Posts: 1,137
Joined: Mar 2006
Reputation: 0
Post: #18
I don't know if its completely necessary, but I know the shutdown on lan script already on xbmcscripts uses a client that you have to run on the computer in order to to tell it to shutdown...Would be great if you could do it without it though
find quote
mwg47x Offline
Junior Member
Posts: 1
Joined: Apr 2007
Reputation: 0
Post: #19
JoJa15,
Did you ever get this working the way you wanted?
I'd be interested in seeing it if you wouldn't mind.
find quote
wigwam Offline
Member
Posts: 52
Joined: Apr 2007
Reputation: 0
Post: #20
i would also like to try this so anyone who has it working please tell us what to do!

Xbox Ver 1.0; XBMC 2.0.1; PMIII Skin
find quote