Search the web
Sign In
New User? Sign Up
OpenTurbostation · Open Turbostation
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Wake On LAN utility   Message List  
Reply | Forward Message #1035 of 1088 |
Re: Wake On LAN utility

Hi,

I had the same problem and solved it using the builtin python.

<code>
#!/mnt/ext/usr/bin/python
import socket, sys

def createmagicpacket(mac):
packet = "\xFF\xFF\xFF\xFF\xFF\xFF"
i = 16;
while (i):
packet+=mac
i-=1
return packet

host = '' # Bind to all interfaces
port = 51423

s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
s.bind((host, port))
s.connect(('192.168.178.255',10000))

wakeupmac=sys.argv[1]
s.send(createmagicpacket(wakeupmac))
s.close()
</code>

The MAC address has to be passed in this form
"\x01\x23\x45\x67\x89\xab".

In a php webpage it can be used like this
<code>
function wakeWithPython($host) {
exec('/path/to/your/pythonscript/wol.py '.$host,$output,$retval);
if ($retval == 0) {
echo $host. " is waking up";
} else {
echo $host. " not waken up";
}
}
</code>


Works well for me.

Greetings,

Endo

--- In OpenTurbostation@yahoogroups.com, "Ewald Muessig" <ewald@...>
wrote:
>
> Hi,
>
> I have a TS-101 and want to use it to wake my PC's via the web
browser.
>
> I found a php script using the "socket_create()" function but the
php
> from the TS-101 doesn't support that function.
>
> So I would like to know if any from has a command line tool for the
TS-
> 101 to send a WOL packet.
>
> Or, if any of you know how to enable the "socket_create()" function
on
> the built-in PHP.
>
>
> thanks!
> Ewald
>





Wed Apr 16, 2008 5:48 pm

endosoft_com
Offline Offline
Send Email Send Email

Forward
Message #1035 of 1088 |
Expand Messages Author Sort by Date

Hi, I have a TS-101 and want to use it to wake my PC's via the web browser. I found a php script using the "socket_create()" function but the php from the...
Ewald Muessig
emuessig
Offline Send Email
Apr 16, 2008
1:22 pm

Hi, I had the same problem and solved it using the builtin python. <code> #!/mnt/ext/usr/bin/python import socket, sys def createmagicpacket(mac): packet =...
endosoft_com
Offline Send Email
Apr 16, 2008
5:48 pm

Works well for me, too :) Thanks, Endo ________________________________ From: OpenTurbostation@yahoogroups.com [mailto:OpenTurbostation@yahoogroups.com] On...
Ewald Mussig
emuessig
Offline Send Email
Apr 17, 2008
10:52 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help