Ubuntu 9.10 & Via Epia-M1000B: Setup NVRAM-WakeUp to wake up VDR


In this howto I will give a step by step instruction how I configured NVRAM WakeUp to enabled my VDR system to wake up automatically. Since the configuration is mainboard specific (Via Epia-M1000B) you may have to adapt the configurations to your needs. Nevertheless this howto will give you an overview of the basic steps. In a nutshell, the steps to take for the VIA Epia-M1000B are:

  1. Enable “Power on by RTC Alarm” in the BIOS
  2. Configure GRUB 2 for extra reboots
  3. Setup NVRAM-WakeUp

1. Enable “Power on by RTC Alarm” in the BIOS

Enable “Power on by RTC Alarm” in your BIOS settings and set the RTC alarm to a default value:

RTC Alarm Resume [Enable]
Date (of Month) [1]
Resume Time (hh:mm:ss) 1:1:1

2. Configure GRUB 2 for extra reboots

Since the Via Epia-M1000B (like some other mainboards) needs an extra reboot after the NVRAM-WakeUp sets the RTC-Alarm you have to create a special GRUB 2 boot entry that is used for this reboots:

  1. Download the 50_nvram_wakeup script form this bug report and save the file as /etc/grub.d/50_nvram_wakeup.
  2. Update your GRUB configuration:
    # sudo update-grub

3. Setup NVRAM-WakeUp

  1. Install the NVRAM-WakeUp package:
    # sudo apt-get install nvram-wakeup
  2. Create the file /etc/nvram-wakeup.conf with the following content:
    ################################################
    ##  Mainboard autodetection information:
    ##
    ##    - Mainboard vendor:   ""
    ##    - Mainboard type:     "EPIA-M"
    ##    - Mainboard revision: ""
    ##    - BIOS vendor:        "Award Software International, Inc."
    ##    - BIOS version:       "6.00 PG"
    ##    - BIOS release:       "05/19/2004"
    
    addr_stat        = 0x4B
    shift_stat       = 3
    addr_day         = 0x4C
    addr_hour        = 0x4D
    addr_min         = 0x4E
    addr_chk_h       = 0x4F
    addr_chk_l       = 0x6E
    need_reboot = ON_ANY_CHANGE
  3. Edit /etc/vdr/vdr-nvram-wakeup.conf to configure the VDR to use the NVRAM-WakeUp configuration and to do an extra reboot:
    ENABLED="yes"
    COMMANDLINE="-A -C /etc/nvram-wakeup.conf"
    SPECIALSHUTDOWN="/usr/bin/grub-editenv /boot/grub/grubenv set nvram_halt_once=1; shutdown -r now"

To test your configuration just use the following commands to set an wake-up alarm 10 minutes in the future and reboot the system:

# sudo nvram-wakeup -A -C /etc/nvram-wakeup.conf -s $((`date +%s` + 600))
# sudo /usr/bin/grub-editenv /boot/grub/grubenv set nvram_halt_once=1
# sudo shutdown -r now

The reboot will use the new grub entry that shuts down the system automatically. Now wait 10 minutes to see if the RTC alarm will wake up the system.

Appendix A: Time synchronization

A fundamental prerequisite to enable your VDR to wake up automatically is, that the system clock and the hardware clock are set correctly. Here are the basic steps I used for time synchronization:

  1. Install the ntp package:
    # apt-get install ntp
  2. Configure some ntp servers in /etc/ntp.conf:
    server ptbtime1.ptb.de
    server time-a.nist.gov
    server pool.ntp.org
    server ntp.ubuntu.com
  3. Set UTC=no in /etc/default/rcS.
  4. Configure a cronjob that sets the hardware clock every 15 minutes:
    */15 * * * *    /sbin/hwclock --systohc >> /var/log/messages 2>&1

Appendix B: Enable VDR to shutdown automatically

If the VDR system wakes up automatically to start recordings it could be useful to enable the system to shutdown automatically to save energy costs. This is done by editing /etc/default/vdr:

ENABLE_SHUTDOWN=1

Appendix C: Links

For other mainboards, you can find some useful configuration information in the German VDR Wiki:


One response to “Ubuntu 9.10 & Via Epia-M1000B: Setup NVRAM-WakeUp to wake up VDR”

  1. […] Ubuntu 9.10 & Via Epia-M1000B: Setup NVRAM-WakeUp to wake up VDR …Mar 14, 2010 … In this howto I will give a step by step instruction how I configured NVRAM WakeUp to enabled my VDR system to wake up automatically. […]

Leave a Reply

Your email address will not be published. Required fields are marked *