Difference between revisions of "Wake On LAN Router"

From MythTV Official Wiki
Jump to: navigation, search
(Additional Packages for OpenWRT)
(Install wol on Router and and Test it)
Line 86: Line 86:
 
use the poweroff command to power off the mythbackend.
 
use the poweroff command to power off the mythbackend.
  
then from the router do
+
shell to the router using scp. At the prompt do this:
 +
 
 +
 
 +
wol -p 65535 -h 192.168.1.255  00:15:33:4D:C6:28
 +
 
 +
 
 +
the last part is your MythBackend ethernet MAC id or MAC address. You can get this from a shell prompt on your Mythbackend like this:
 +
 
 +
 
 +
ifconfig eth0
 +
 
 +
 
 +
The first line should end with the mac id:
 +
 
 +
eth0      Link encap:Ethernet  HWaddr 00:15:33:4D:C6:28
 +
 
 +
The -h 192.168.1.125 assumes that your network is set up in the default linksys way, with the router having the address 192.168.1.1 and the rest of the machines in the network having addresses such as 192.168.1.100 etc. Try it and see if your machine wakes up.  If not, you may have to use ethtool to set your nic to wakeup.  [[http://www.mythtv.org/wiki/index.php/Wake-on-LAN See this doc on the Myth wiki for setting up ethtool.]]

Revision as of 20:08, 10 December 2006

WAKE-ON-LAN HOWTO with Linksys WRT54G Router (not finished, will be done by dec 15, k?)

Many MythTV users would prefer to have their Myth Backend shutdown when not recording. Attempting to use NVRAM Wakeup and ACPI may have failed. An easy alternative is to use Wake On Lan, in which another computer (or the router) sends a packet over ethernet to the Myth backend machine waking it up. The benefit is almost no extra packages or difficult configs to set up on the Myth box. Another bonus is that you can convert your Linksys router into something more familiar and usefull, a little Linux box.


This HOWTO covers setting up the MythBackend system, using MythWelcome, and a Linksys router or other that supports OpenWRT, to shutdown the Myth Backend when it is idle, and to wake it up again in time for the next recording. You can do something similar with any other 24/7 box you may have on your network. This HOWTO will not duplicate the other HOWTOs about waking up Myth and using MythWelcome, and will only partially cover installing OpenWRT on a router. You should read about all of these on your own.

Understanding Mythtv Wakeup Support and MythWelcome

You may want to read these first:

Myth Official Doc on Shutdown/Wakeup

Wiki entry on using Shutdown/Wakeup with NVRAM wakeup

MythWelcome HOWTO . MythWelcome will shutdown your box when not in use. We will hook into Mythwelome in this HOWTO.

ACPI Wakeup An alternative to this method and to to NVRAM Wakeup

OpenWRT

OpenWRT is a Linux distribution for embedded devices. You can flash it to overwrite the firmware on several different routers by Buffalo, Linksys, Asus and others. See the OpenWRT page for details:

OpenWRT main page


I already had a Linksys WRT54G Version 1.1, which can be flashed to OpenWRT. You can still buy supported routers from on line retailers such as Egghead, or try your local Craigslist.

If you decide to install OpenWRT, it is quite easy to set up, but please spend some time reading a few different sources before you do it to avoid turing your router into a $50 paperweight.

Once OpenWRT is installed you first telnet to it to set up a password, after the initial telnet, you will use ssh to connect to it like a normal linux box. In the shell you will use commands to set up cron jobs, or install new packages. OpenWRT comes with ipkg, similar to apt or yum, for managing installs.

Make sure you install the correct package for your router, and I recommend squash fs since it may later help you if mess up your installation and need to recover.

Install instructions for OpenWRT and the main docs are here:

[White Russion 5 by router]

[OpenWrt docs]

Additional Packages for OpenWRT

In addition to the standard OpenWRT (White Russian 5) you need to install the wol package and the ntp client package. This is simple to do using the package manager ipkg. You will need to configure a cron job, ntp, and copy a public key from your Myth backend to the router for password-less scp copying. These are very easy using the following HOWTOs from the OpenWRT wiki.


Additional package from OpenWRT are found here:

[http://downloads.openwrt.org/whiterussian/packages/]

from this page download:

wol_0.7.1-1_mipsel.ipk

ntpclient_2003_194-2_mipsel.ipk

You can use ipkg to install from the url or copy the ipk files to your router and install locally.

Please read this for setting up NTP client and set your timezone before installing the ntp client.

[Please read this for setting up NTP client and set your timezone ]

Set up cron and verify that it works:

[Cron Instructions on the OpenWRT wiki]


and finally, setting up the key for scp/open ssh. You generate the keys on the Myth box and then you copy the key to the router and add them to dropbear:

[How to generate and add keys]


Optional, but good to have, a very nice web interface for the router.

[WebIf2 for openWRT ]]

Install wol on Router and and Test it

wol is an official additonal/optional package. You can install WOL on the router from the shell. do:

ipkg install http://downloads.openwrt.org/whiterussian/packages/wol_0.7.1-1_mipsel.ipk

The download page for other packages is http://downloads.openwrt.org/whiterussian/packages/

Once wol is installed on your router you might as well test it. On your Myth Backend, use ifconfig eith0 to see the mac id of you ethernet card.

use the poweroff command to power off the mythbackend.

shell to the router using scp. At the prompt do this:


wol -p 65535 -h 192.168.1.255 00:15:33:4D:C6:28


the last part is your MythBackend ethernet MAC id or MAC address. You can get this from a shell prompt on your Mythbackend like this:


ifconfig eth0


The first line should end with the mac id:

eth0 Link encap:Ethernet HWaddr 00:15:33:4D:C6:28

The -h 192.168.1.125 assumes that your network is set up in the default linksys way, with the router having the address 192.168.1.1 and the rest of the machines in the network having addresses such as 192.168.1.100 etc. Try it and see if your machine wakes up. If not, you may have to use ethtool to set your nic to wakeup. [See this doc on the Myth wiki for setting up ethtool.]