clonetrooper9494 Posted September 6, 2010 Share Posted September 6, 2010 I am trying to setup Wake on LAN for a computer of mine. I read that you need a wireless adapter that supports it, so instead of going out and buying one, I have decided to hook two computers up with an ethernet cable. The other computer uses a wireless adapter, and stays on most of the time because its old and quiet. Now comes the hard part.I know a decent bit about sending TCP/UDP, so I thought I will just have the other computer send the magic packet to 192.168.1.xxx, but as I run that through my head I am finding that might not work... The computer that's turned off gets its internet through the wireless adapter, so if the other computer tries to send it a packet, won't it still be trying to do it via the adapter? Is there a way to direct the packet to be sent through the ethernet cable? Link to comment Share on other sites More sharing options...
jaclaz Posted September 6, 2010 Share Posted September 6, 2010 How BIG is your home network? Last time I checked, WOL used MAC addresses.... Just in case, these may come useful to you :http://www.matcode.com/wol.htmhttp://users.telenet.be/jbosman/poweroff/poweroff.htmjaclaz Link to comment Share on other sites More sharing options...
clonetrooper9494 Posted September 6, 2010 Author Share Posted September 6, 2010 (edited) Yes, I know that is uses MAC addresses, and I was planning on writing my own script to send the magic packet. I guess I am a little confused with how UDP works then? Say the IP of the computer thats off is 192.168.1.123, would I just send a UDP message "FF FF FF FF FF FF [6-byte MAC address of ethernet cable 16 times]" to 192.168.1.123 on port 9? Edited September 6, 2010 by clonetrooper9494 Link to comment Share on other sites More sharing options...
clonetrooper9494 Posted September 6, 2010 Author Share Posted September 6, 2010 (edited) OK, i just tested a script that sent a UDP packet to the ip on the computer that is asleep. The computer didnt wake up... i am not sure what to do now, help? Edited September 6, 2010 by clonetrooper9494 Link to comment Share on other sites More sharing options...
VideoRipper Posted September 7, 2010 Share Posted September 7, 2010 You don't use the receving (sleeping) computer's IP address, you'll have to send its MAC-address (16 times) inside that magic packet over using a (UDP) datagramas a network broadcast (IP address 255.255.255.255).In pseudo (Delphi) Pascal-code:Type TMACAddress = Array[0..5] Of Byte; TWakeRecord = Packed Record Header : Array[0..15] Of Byte; // These are all $FF's MAC : Array[0..15] Of TMACAddress; End;Procedure WakeComputer(Const AMAC : TMACAddress);Var I : Integer; WR : TWakeRecord;Begin FillChar(WR.Header, SizeOf(WR.Header), $FF); For I := 0 To 15 Do WR.MAC := AMAC; SendPacket('udp', '255.255.255.255', SomePort, WR);End;Greetz,Peter. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now