I had a laptop at home that I didn’t really use much. I realized that I could save some power if I only power it on only when I need it.
Wake On LAN
I remember that I can use Wake On LAN (WOL) to power on a machine over the network, only if the NIC supports that. I checked out the model of the old machine:
Then after checking out the specs of the laptop luckily it had this option available. So I enabled that in the BIOS:
Supports Wake-on: pumbg Wake-on: g Current message level: 0x00000007 (7) drv probe link Link detected: yes after manual configuration: ethtool -s enp0s25 speed 100 duplex full autoneg on mdix on interface still invalid. Than i try this: ethtool -s enp0s25 speed 10 duplex full autoneg on mdix on Magic, it acquired IP address.
WOL NIC Support
Then after I powered it on, I confirmed it’s enabled on the NIC:
We can see the Supports Wake-on and Wake-on options are set appropriately.
Using a WOL Client to the Send Magic Packet
Supports Wake-on: pumbg Wake-on: g ubuntu@tegra-ubuntu:$ Then I putting the TK1 into LP1. Cd /sys/power echo lp1 suspend/mode echo mem state I try to send the magic packet from another machine using wakeonlan, but the TK1 doesn't seem to wake up. I am wondering if I'm missing a step. The target computer's motherboard and Network Interface Controller have to support Wake-on-LAN. The target computer has to be physically connected (with a cable) to a router or to the source computer for WoL to work properly. Some wireless cards have support for Wake on Wireless (WoWLAN or WoW). Configuring Wake-on-LAN is a simple process on Alpine Linux. First, check if your network card supports Wake-on-LAN (WOL): # apk add ethtool # ethtool eth0 grep -i wake Supports Wake-on: pumbg Wake-on: d Supports Wake-on: pumbg means that WOL is supported, Wake-on: d means that it is currently. Supports Wake-on: pumbg Wake-on: g Current message level: 0x00000007 (7) drv probe link Link detected: yes after manual configuration: ethtool -s enp0s25 speed 100 duplex full autoneg on mdix on interface still invalid.
I figure out what the MAC address is:
Then I just powered off the machine:
Then on my mac, I went ahead and installed the WOL client:
Then I went ahead and sent the magic packet:
and I kept a ping going and after some time the machine booted up:
On my CentOS machine I just ended using ether-wake which is part of thenet-tools rpm:
And executing the following accomplished the same thing:
WOL Over a Router
I was running the command from machines that were on the same subnet as thedestination host. If you are traversing a switch or a router make sure those devices support passing the magic packet across and allow directed broadcasts.Here are some nice steps laid outfor dd-wrt. I will stick with local subnets :)
If you have a network card that supports wake-on-lan (wol), you can powerup your mythbox by sending it a 'magic packet' over the network.
- 1Setting up
- 2Sending 'magic packet' to wake up your mythbox
- 4Wake-on-LAN supported but just won't wake up
Setting up
First, find out whether your network card supports wol:
The 'g' in Supports Wake-on: pumbg indicates that wake-on-lan by using a 'magic packet' is indeed supported. Next, you need to make sure that wake-on-lan support is enabled in the BIOS (although, this does not seem to be necessary for my motherboard). In addition, you need to tell your network card to enable wake-on-lan:
When you run `sudo ethtool eth0` again you will see that 'Wake-on: d' (disable; wake on nothing) has changed to 'g' (wake on magic packet)
Since after rebooting Wake-on will be reset, you will want to add this setting somewhere in your boot up.
Supports Wake-on D
Ubuntu 10.04/12.04
Before making manual additions, see:
/usr/lib/pm-utils/power.d/disable_wol
. If the ethtool
program exists, WOL will be turned on automatically.To make this setting permanent edit
/etc/network/interfaces
, in the auto eth0
section (or you might have an auto lo
section) add at the end:Other Linux
To make this setting permanent edit /etc/rc.local:
Add
ethtool -s eth0 wol g
above the 'exit 0' line.Now turn off you mythbox and send it a 'magic packet'.
Sending 'magic packet' to wake up your mythbox
You will need a wake-on-lan client to send 'magic packets' over your network. First, determine the MAC address of the machine you want to power on:
Linux Wake On Lan
Turn off your mythbox and from another computer execute the following command (replacing the MAC address with the one you just found). Kubota st30 manual parts. I used a wake-on-lan client from Sourceforge.
If all went well, your mythbox will boot up now! There are other clients for Windows, Mac OS X and iPhone as well.
Via Python one-liner
Maybe not as clean, but works on all systems where Python is available, replace the 'x00x1Ax92x9Dx69x85' with the numbers of your backend's MAC address:
Send automatically from a frontend
By adding one or two scripts into a remote frontend, it will automatically start the backend, and then wait until the backend is ready to accept a client connection. Ideally the frontend and backend would boot concurrently, however that's difficult to arrange without building a special environment (e.g. to boot rapidly from flash memory), so the practical solution is simply to use an /etc/init.d script in the frontend, and wait while the frontend and backend boot serially.
The purpose of the first script is to issue the WOL packet as early as possible. If the overall bootup time is not considered to be an issue, this script can be omitted and the wakeonlan command can be issued from the script which runs from the user's auto-started sessions (called mythfestart.sh, further down). These scripts use 'wakeonlan' from Ubuntu package repos, but wol or ether-wake would work just as well.
After the above script has been placed in /etc/init.d/ (and marked executable with chmod +x .), it can be made to run at bootup by issuing:
Now we need a script which waits until the backend is ready to accept client connections, before starting mythfrontend. That way, the frontend will start cleanly without any error panels such as 'no UPnP backends found', etc. Ghost files memory of a crime. This script can be added to the user's autostarted sessions (in place of the normal 'mythfrontend' script).
Both scripts must of course be made executable with chmod +x <script-filename>
Password 'protection'
Wake-on-lan has a SecureON password feature. Here's an example of how to use ethtool and wol with SecureON (note that the password contains 6 hexadecimal numbers):
Proxmox Enable Wake On Lan
Wake-on-LAN supported but just won't wake up
At this writing, the Marvell Gigabit Ethernet controller on the Asus A8V and some other motherboards, using skge driver under Debian Etch may not wake at all while connected at Gigabit speeds to a Gigabit switch. The same hardware may wake correctly when shutdown with Windows in a dual-boot system.
A variety of workarounds have been suggested, from modifying the halt binary to using the NIC at 100 Mbps speeds, to placing calls to ethtool in various startup/network/shutdown scripts, but the simplest path to solution is probably to disable the motherboard network controller in BIOS and replace with a known-good PCI Gigabit NIC (such as the US Robotics 7902 Gigabit NIC).
Wake On LAN, Fedora 11 and Realtek RTL8111/8168 (etc)
This chip seems to be pretty common, along with a lot of problems getting WOL to work..I suspect this will apply to the following NICs chips
Finally, after much headache, this is the fairly simple solution (based on much crawling around on the web and some considerable testing)..Go to the Realtek Site, download the driver from there (http://www.realtek.com.tw/downloads/downloadsView.aspx?Langid=1&PNid=13&PFid=5&Level=5&Conn=4&DownTypeID=3&GetDown=false) Follow the instructions in the README and make and install yourself a new kernel mod (this will be r8168).
Now, edit /etc/modprobe.d/blacklist.conf and add
this stops the r8169 module loading after reboot, this is the one that ships with the kernel, and WOL won't work (except for physical activity), which means it will happily use your shiney new r8168 module instead.
It also appears to be necessary to place the following lines into /etc/init.d/halt
The above lines need to be the penultimates ones, just above
General remarks
Some motherboards allow a large set of events to wake-up the machine via ACPI. These can be toggled via
/proc/acpi/wakeup
. Examples of ACPI wakeup events related to Wake-on-LAN:- 'LAN0', 'LANC' - The ethernet card
- 'P0P2', 'PCI0' - The PCI bridge may need to be allowed to wakeup your machine before WOL works. You can find out which is your PCI bridge by matching the first column of
lspci
output with the last column ofcat /proc/acpi/wakeup
.
One-liner to enable a wakeup event (ex: LAN0):
Supports Wake-on: Pubg
'NOTE:' Using
/proc/acpi/wakeup
is a legacy system. It is in the process of being split into /sys/devices/[.]/power/wakeup
per device. Use echo enabled > power/wakeup
on each device node you want to use to wake up the machine. Shortcuts may be available, like /sys/class/net/eth0/device/power/wakeup
for your eth0 network device.Tested with
- Epia M10k with Fedore Core 4
- M2NPV-VM with Ubuntu 10.04
- MacPro 1,1 with Arch Linux
- Asus M3N78-EM mobo with Mythbuntu 12.04
Supports Wake On Pumbg
Useful links
- http://ahh.sourceforge.net/wol/ (wake-on-lan client + additional information)
- http://dag.wieers.com/packages/wol/ (wol packages for RedHat and Fedora)
- http://www.die.net/doc/linux/man/man8/ethtool.8.html (man page for ethtool)
- http://www.sourceforge.net/projects/gkernel/ (gkernel package that contains ethtool)
Retrieved from 'http://www.mythtv.org/wiki?title=Wake-on-LAN&oldid=60232'