[mythtv-users] Help Using Linksys router and OpenWRT to wakeup my Myth box

come se fosse antani antani at gmail.com
Mon Dec 4 10:00:49 UTC 2006


On 12/3/06, McNally <mcnallychris at pobox.com> wrote:
> I need some help / scripts to run on my router to receive the next
> wakeup time from MythTV.
>
> I flashed my Linksys WRT54G to run Linux/OpenWRT instead of the standard
> Firmware. Adding WebIf  (browser UI) and wol and now I can wake up my
> MythTv box using Wake-On-LAN. I've tested this by shutting down the Myth
> Backed (Fedora Core 4) using the 'poweroff' command and I have been able
> to start it by SSH shelling to my router and issuing the wol command to
> start the Myth box and it works!
>
> All of that was quite easy. I really want to be able to wake up the
> MythBox and let it shutdown when it's not recording. What I assume I
> need is some command that can be issued from the Myth box as part of its
> "set wakeuptime command" which would schedule a cron job on my Router.
> This command would tell the router to send the wol command at the
> specified time. I assume someone on this list has written shell scripts
> to do this. I don't have a clue where to start. The way I imagine it,
> the myth "set wakeup time command" would have to start ssh, shell to the
> router, and insert a cron job to wake up at the appointed time to run
> the wol command.

I solved that issue on my environment using:
- a combination of "cron" and "at" on my 24x7 box
- setting a really simple command in mythtv-setup

You' ve to tell mythtv to create pre shutdown a file in an nfs shared
dir on your router: in that file you've to write the wakeup time with
this syntax (hh:mm MM/DD/YYYY).
Please note that:
- the hour and time format is case sensitive (for mythtv, I think that
was hh:MM mm/DD/YYYY) and you've to insert it in mythtv-setup
- the set wakeup time command is: echo $time (defined as above) >
/mnt/nfs_shared_partition_on_the_router/wakeuptime

then, on your router:
insert a cron job that check for the "wakeuptime" file created from
the mythbox, for example every 30 minutes, and queue the "wakeonlan"
command, with at

*/30 * * * * root echo 'wakeonlan MACAddressMythBox' | at 'cat /mnt/wakeuptime'

please note that the ' quotes ' used with "at" are not the same showed
above, but the "backquotes"... I've an italian keyboard now and I
don't know how to type it!

If you've problems, I can have more details later; now I don't have my
mythbox here.

Hope this helps,
antani


More information about the mythtv-users mailing list