Remotely Wake Up MythTV to Schedule a Recording
or How I missed "Must See TV"
I was out with friends one evening, when one of them started talking about a new sci-fi TV show that was premiering that same evening. I looked at my watch and saw that it was due to start in less than an hour. I had anxiously anticipated this new show for months, however it had slipped my mind, and now I regretted that I did not program the DVR to pick it up for me. Should I have acted like the geek that I am, and excuse myself so that I could rush home to see it? Well, in the end, I didn't, but I sorely missed the opportunity to fulfill the needs of my inner geek.
I pondered the problem for most of the evening. Surely I could have remotely commanded my DVR to record the program for me. Any web enabled cell phone, or wifi connected laptop would have done the trick. Of course, my DVR, which is little more than a computer running MythTV, was powered off at the time. I would have had to find a way to remotely power it up, and then schedule the desired TV recording.
The next day, after coffee and Ibuprofen for a hangover, I started investigating the problem. I surely didn't want to miss any more earth shattering, important tv shows in the future. A quick Google for Wake-On-Lan (WOL) revealed that a little Linux program called ethtool was all that was needed to enable my computer to be turned on from any remote location. The ethtool command:
ethtool -s eth0 wol g
sets the ethernet device (eth0) so that it wakes up the computer when a MagicPacket is received from the network. Simple huh? All I needed now was a program that would send the MagicPacket from another computer. There are many utilities such as wol, wakeonlan, and etherwake that equally serve this purpose. They all work basically the same way. The command is run with a parameter representing the MAC address of the machine that is to be woke up. For wol, the command syntax would be:
wol 00:11:22:33:44:66
I powered down the MythTV box after running the ethtool command. Spinning my chair around to face another computer terminal I quickly entered the wol command to wake up my MythTV box, and anxiously awaited the flashing blue lights ... and there was nothing, crap. Ok, I must have forgot something.
Ah yes, I needed to enable the WOL support in the BIOS. I powered up
the machine manually, and hit the Del key to enter the BIOS
setup screen. and chose Power Management from the main
menu. And there it was; Power on PME was set to
disable. A quick toggle of the option set it to
enable, and then to power down the machine again. Here
we go .... sending the wol command once again, and viola!
... my MythTV box is spinning up!
Again, I shutdown the box and then issued the wol command.
This attempt revealed that life just isn't so simple. It seems that the
work done by the ethtool command only works for one boot. So I
decided to add the ethtool command to /etc/rc.local
file. That way the command gets executed upon each boot. The command
could be easily appended to the file as simple as:
echo "ethtool -s eth0 wol g" >> /etc/rc.local
but I just started up the vi editor and made the addition by hand. Now that I have a way to remotely power up my MythTV box, all I need to do is point my favorite web browser to MythWeb and I am in TV scheduling nirvana. Or so I thought ...
It occurred to me that I need to shut the MythTV box off once I am done scheduling programs. Otherwise I could be wasting hours, or days, of electricity. For this I'll need to use the MythWelcome utility to help manage startup and shutdown.

