This article describes how to wake up the device via the network in the case of a computer device shutdown, before the power S stateComputer Power Power State - Tang, Song, Yuan, Ming, Qing 2188 - Blogland () There is an introduction to the remote wake-up device, behind the two days to understand a little more so add a separate essay
Prerequisites for using Wake on Network if the device is turned off:
1. The woken device needs to support the WakeOnLine.
To confirm, you can check through the BIOS-Power Management page, as follows, there is Wake by Lan, and it is turned on.
2. Connect to a wired network (wireless network card is not supported, because the wireless network card is powered off when the device is turned off), and the device that initiates the wake-up at the other end needs to be on the same LAN as the device being woken up.
The wired network interface is a blinking yellow light in the off state.
I tested and verified by wiring the big screen device to a router and then the laptop connecting to the router's wifi. the ip of the big screen device is 192.168.2.9 and the ip of the laptop is 192.168.2.6.
Get the IP of the target device as well as the wired Mac address (which can be viewed in the properties of the device's connected network):
Then you can use the send package tool (download:MAGPAC) Try Wake Up and send a packet with the device turned off to automatically turn it on Configure the following, enter the IP as well as the Mac address:
1 private void TestButton_OnClick(object sender, RoutedEventArgs e) 2 { 3 string ip = "192.168.2.9"; 4 string macAddress = "EC:D6:8A:A6:4B:7B"; 5 SendWakeOnLan(ip,macAddress); 6 } 7 8 private static void SendWakeOnLan(string ipAddress, string macAddress) 9 { 10 try 11 { 12 // Convert MAC addresses to byte arrays 13 byte[] macBytes = (':').Select(x => (x, 16)).ToArray(); 14 // Create a magic package 15 byte[] magicPacket = new byte[6 + 16 * ]; 16 for (int i = 0; i < 6; i++) 17 { 18 magicPacket[i] = 0xFF; 19 } 20 for (int i = 0; i < 16; i++) 21 { 22 (macBytes, 0, magicPacket, 6 + i * , ); 23 } 24 // Send magic packets using UDP 25 UdpClient client = new UdpClient(); 26 (ipAddress, 9); // 9 is the default port for WoL 27 (magicPacket, ); 28 (); 29 30 ($@"The wakeup packet has been sent to: {ipAddress},{macAddress}"); 31 } 32 catch (Exception ex) 33 { 34 ("Error sending wakeup packet:" + ); 35 } 36 }
Directly wake up the shutdown device remotely, pro-tested to work!
1. Remove the separator character (":") from the MAC address, the magic packet consists of 6 bytes of 0xFF followed by the destination MAC address 16 times.
2. Send packets via UDP protocol to specified IP and destination port 9
Note that it's not broadcasting but specifying the IP to send the packet, some on the internet say to use the broadcast address (255.255.255.255), I verified that it doesn't work.
Keywords: power state, remote wake-up, packet-sending tool