You can wake up any PC linked to the Raspberry Pi remotely. It can be done on the local network as well as from the internet. This means you no longer have to keep your PC on, to access the files remotely. You can wake up the PC within seconds when needed, saving a lot of power in the process.
Why ?
Running a LAN cable may not always be a feasible solution. If your PC is connected to the internet via WIFI, and the card does not support Wake on LAN, you have no other options of waking up the PC remotely. RPI as WOL server solves this.
How ?
The RPI is constantly awake and is able to receive a request to wake the PC through the LAN interface. When the Magic Packet is received by the PC via LAN cable, it wakes up. Simple as that.
Requirements :
- a Raspberry Pi with the ethernet port and WIFI connectivity
- a Raspbian Jessie image
- an ethernet cable
- a PC which has a LAN port with Wake On Lan support (most of them)
- an ethernet cable
- 10 min of your time
a Raspberry Pi B or B+, with the latest version of Raspbian, or our MIcroSD Card 8GB Class 10 Raspbian preinstalled.
Step 1: Physical Setup
This is important because we have to force the Magic Packet to go through the eth0 instead of WIFI. The best way to do this is to use the etherwake:
sudo apt-get install etherwake
Once this is installed, you have to go to the PC and note the MAC address of the LAN adapter the RPI is connected to. (click on the details of that connection to reveal the IP and MAC listed as AA:BB:CC:DD:EE:FF in the example ). The command to wake your PC up is:
sudo etherwake -i eth0 AA:BB:CC:DD:EE:FF
This method requires sudo, but allows you to specify the interface, which is what we need. You will have to issue this command via SSH (or type in terminal) each time you want to wake up the PC. You could save it also as a bash file (save it as wol.sh):
#!/bin/bash<br>sudo etherwake-i eth0 AA:BB:CC:DD:EE:FF
And open the file with
sudo bash /path/to/file/wol.sh