easyVDR Kopie des easyVDR-Forums zum Nachschlagen
[SOLVED. Script modified] How to configure automatic boot?

easyVDR - >VARforumsname - >[SOLVED. Script modified] How to configure automatic boot?

jb  30.Nov.2016 11:47:36
Hi.

I was used to have vdr configured to boot the computer automatically at 6:30 am, in order to have it available in case I need to connect remotelly (I turn off the computer every day at night), but I have not achieved that with easyvdr. May be, some of you, can help me to configure properly the right files.

In easyVDR-Webportal, in settings/System, we can configure the automatic boot job:
Wakeup Methode: ACPI
Wakeup Interval: 1 †(I guess this number is to awake every day, in yaVDR I had configured like this "1 2 3 4 5 6 7"
Wakeup Time: 06:30
Wakeup x min bevor timer begin: 5

This configuration can be changed by OSD in System-Setup/Setup/System-Einstellungen/WakeUp/Poweroff-Einstellungen and we can change the same options as before.

I have this configuration done, but the computer does not start at 6:25, it keeps turned off.

I have checked the file
/etc/vdr/easyvdr-addon-acpi-wakeup.conf
And it seems to be correct:
# Activate/deactivate ACPIWakeup with yes/no:
ENABLED="yes"

# How many minutes should the machine wake up before the timer starts:
START_AHEAD="5"

# If you want your VDR machine to wakeup in regular intervals (i.e. for
# updating EPG data), specify a day interval and a wakeup time:
#
REGULAR_DAYS="1"
REGULAR_TIME="06:30"
but it does not work.

May be the shutdown scripts that check the scheduled recordings or the sheculed job (for the scheduler plugin) do not check also the setup of the easyvdr-addon-acpi-wakeup.conf file in order to schedule next boot? or I am not able to configure properly the files?

Thanks and regards.
Javier B.
VDR 1: Intel NUC6i5SYK || SSD 128Gb M.2 2242 ADATA PREMIER || External HD: W.D. Elements 5 Tb || RAM: 4 Gb KINGSTON HYPERX IMPACT ? DDR4† || Remote compatible Microsoft Media Center || 3 tuners pctv nanoStick || [url=http://www.easy-vdr.de/index.php]easyVdr 3.0††
VDR 2: Xtreamer Ultra || HD 2 Tb || RAM: 4 Gb || Remote compatible Microsoft Media Center || 3 tuners pctv nanoStick || [url=http://www.vdr-portal.de/board16-video-disk-recorder/board99-distributionen/board96-yavdr/]yaVdr 0.6†
VDR 3: Siemens Gigaset M740 AV + HD Western Digital "My Book Essential-2, 1Tb" (6 partitions ext2) || [url=http://vdr-m7x0.foroactivo.com.es]VDR-NG-EM 0.6 Pro - Rev 844
Bleifuss2  30.Nov.2016 13:36:24
Hello Javier

First chek your hardware/bios

=http://www.easy-vdr.de/thread-12382-post-108599.html#pid108599]

1. disable hpet
2. disable EuP Support

3. start the skript an wait for poweron.

hwclock --systohc --utc
DEV=/sys/class/rtc/rtc0/wakealarm
now=`date +%s`
nextboot=`echo "$now + 5 * 60" | bc` #Systemtime + 5*60sec
echo 0 > $DEV
echo $nextboot > $DEV†
##echo $nextboot > $DEV† # nur wenns nicht geht auskommentieren,manche Boards brauchen zwei Aufrufe.
echo "Aktuelle Zeit:† † † †††"`date "+%Y-%m-%d %H:%M:%S"`
cat /proc/driver/rtc†††#show the bios wakeup time
sudo /sbin/poweroff


Regards
Bleifuss
Produktiv-VDR:
Board GA H77-DS3H, Intel Intel(R) Core(TM) i5-3470, Cine S2 DVB, WD 3TB Green, WDC WD20EARS-00J† 2TB, Geforce 750Ti oder Intel HD
Easyvdr 3.0
jb  30.Nov.2016 14:12:36
[quote='Bleifuss2' pid='173195' dateline='1480509384']
First chek your hardware/bios


Hi.

I forgot to say that, if there are a sheduled recording or a job scheduled (from the scheduler plugin), the computer boots fine 5 minutes before the time scheduled for recording or the scheduled task (the problem is that after finishing the recording or the task it shuts down again).

It only does not boot with the boot time established in "/etc/vdr/easyvdr-addon-acpi-wakeup.conf", that is why I think is not a BIOS config problem, but I will check.

Regards.
Javier B.
VDR 1: Intel NUC6i5SYK || SSD 128Gb M.2 2242 ADATA PREMIER || External HD: W.D. Elements 5 Tb || RAM: 4 Gb KINGSTON HYPERX IMPACT ? DDR4† || Remote compatible Microsoft Media Center || 3 tuners pctv nanoStick || [url=http://www.easy-vdr.de/index.php]easyVdr 3.0††
VDR 2: Xtreamer Ultra || HD 2 Tb || RAM: 4 Gb || Remote compatible Microsoft Media Center || 3 tuners pctv nanoStick || [url=http://www.vdr-portal.de/board16-video-disk-recorder/board99-distributionen/board96-yavdr/]yaVdr 0.6†
VDR 3: Siemens Gigaset M740 AV + HD Western Digital "My Book Essential-2, 1Tb" (6 partitions ext2) || [url=http://vdr-m7x0.foroactivo.com.es]VDR-NG-EM 0.6 Pro - Rev 844
jb  30.Nov.2016 23:56:25
[quote='Bleifuss2' pid='173195' dateline='1480509384']
3. start the skript an wait for poweron.
hwclock --systohc --utc
DEV=/sys/class/rtc/rtc0/wakealarm
now=`date +%s`
nextboot=`echo "$now + 5 * 60" | bc` #Systemtime + 5*60sec
echo 0 > $DEV
echo $nextboot > $DEV†
##echo $nextboot > $DEV† # nur wenns nicht geht auskommentieren,manche Boards brauchen zwei Aufrufe.
echo "Aktuelle Zeit:† † † †††"`date "+%Y-%m-%d %H:%M:%S"`
cat /proc/driver/rtc†††#show the bios wakeup time
sudo /sbin/poweroff


Hi Bleifuss2.

I have run the script, and the computer shuted down.
The output of the script was:
hwclock: select () a /dev/rtc para esperar que se agote el tiempo del ciclo del reloj: No existe el archivo o el directorio
Aktuelle Zeit: 2016-11-30 23:43:24
rtc_time : 22:43:24
rtc_date : 2016-11-30
alrm_time : 22:48:24
alrm_date : 2016-11-30
alarm_IRQ : yes
alrm_pending : no
update IRQ enabled : no
periodic IRQ enabled : no
periodic IRQ frequency : 1024
max user IRQ frequency : 64
24hr : yes
periodic_IRQ : no
update_IRQ : no
HPET_emulated : yes
BCD : yes
DST_enable : no
periodic_freq : 1024
batt_status : okay

Emitiendo mensajes desde easyvdr@easyvdr
(/dev/pts/1) en 23:43 ...

°El sistema se apagarŠ AHORA!


After 5 minutes it booted again. So, the alarm clock works. Why do not work fine the script [/usr/share/vdr/shutdown-hooks/10_shutdown.acpi] with the "IsRegularDayOfWeek()" routine?

Regards.
Javier B.
VDR 1: Intel NUC6i5SYK || SSD 128Gb M.2 2242 ADATA PREMIER || External HD: W.D. Elements 5 Tb || RAM: 4 Gb KINGSTON HYPERX IMPACT ? DDR4† || Remote compatible Microsoft Media Center || 3 tuners pctv nanoStick || [url=http://www.easy-vdr.de/index.php]easyVdr 3.0††
VDR 2: Xtreamer Ultra || HD 2 Tb || RAM: 4 Gb || Remote compatible Microsoft Media Center || 3 tuners pctv nanoStick || [url=http://www.vdr-portal.de/board16-video-disk-recorder/board99-distributionen/board96-yavdr/]yaVdr 0.6†
VDR 3: Siemens Gigaset M740 AV + HD Western Digital "My Book Essential-2, 1Tb" (6 partitions ext2) || [url=http://vdr-m7x0.foroactivo.com.es]VDR-NG-EM 0.6 Pro - Rev 844
jb  01.Dec.2016 14:51:52
Hi.

I think that there are some error in "/usr/share/vdr/shutdown-hooks/10_shutdown.acpi"

after this line:
. /usr/lib/vdr/easyvdr-config-loader


I think that should be added the line:
. /etc/vdr/easyvdr-addon-acpi-wakeup.conf

in order to check the next boot scheduled according with ghe file "easyvdr-addon-acpi-wakeup.conf"
Another problem is that in this part of the script:
if [ $REGULAR_DAYS -gt 0 ]; then
REGULAR_TIMER=$((`date -d "$REGULAR_TIME" +%s` + $REGULAR_DAYS * 24 * 60 * 60))

# when no vdr timer is set or vdr timer starts later than regular timer:
if [ $TIMER -eq 0 ] || [ $TIMER -gt 0 -a $REGULAR_TIMER -lt $TIMER ] ; then
TIMER=$REGULAR_TIMER
fi
fi

the boot is always scheduled for the next day ($REGULAR_DAYS=1), and in case that the local time when the script is run, is minor than the scheduling hour, the boot is scheduled, not for today but to tomorrow.

May be I do not explain very well the issue. I do not know I someone can check the script to verify if I am wrong or not.

Regards.
Javier B.
VDR 1: Intel NUC6i5SYK || SSD 128Gb M.2 2242 ADATA PREMIER || External HD: W.D. Elements 5 Tb || RAM: 4 Gb KINGSTON HYPERX IMPACT ? DDR4† || Remote compatible Microsoft Media Center || 3 tuners pctv nanoStick || [url=http://www.easy-vdr.de/index.php]easyVdr 3.0††
VDR 2: Xtreamer Ultra || HD 2 Tb || RAM: 4 Gb || Remote compatible Microsoft Media Center || 3 tuners pctv nanoStick || [url=http://www.vdr-portal.de/board16-video-disk-recorder/board99-distributionen/board96-yavdr/]yaVdr 0.6†
VDR 3: Siemens Gigaset M740 AV + HD Western Digital "My Book Essential-2, 1Tb" (6 partitions ext2) || [url=http://vdr-m7x0.foroactivo.com.es]VDR-NG-EM 0.6 Pro - Rev 844
jb  01.Dec.2016 16:46:37
Hi.

Hi think that this part of the script:

if [ $REGULAR_DAYS -gt 0 ]; then
† † † † † † † †REGULAR_TIMER=$((`date -d "$REGULAR_TIME" +%s` + $REGULAR_DAYS * 24 * 60 * 60))

† † † † † † † †# when no vdr timer is set or vdr timer starts later than regular timer:
† † † † † † † †if [ $TIMER -eq 0 ] || [ $TIMER -gt 0 -a $REGULAR_TIMER -lt $TIMER ] ; then
#******************************************************************************************************************
† † † † † † † † † † † †TIMER=$REGULAR_TIMER
#******************************************************************************************************************
† † † † † † † fi
† † † †fi

Should be:
if [ $REGULAR_DAYS -gt 0 ]; then
† † † † † † † †REGULAR_TIMER=$((`date -d "$REGULAR_TIME" +%s` + $REGULAR_DAYS * 24 * 60 * 60))

† † † † † † † †# when no vdr timer is set or vdr timer starts later than regular timer:
† † † † † † † †if [ $TIMER -eq 0 ] || [ $TIMER -gt 0 -a $REGULAR_TIMER -lt $TIMER ] ; then
#******************************************************************************************************************
† † † † † † † † † † † †TIMER=$((`date -d "$REGULAR_TIME" +%s`))
††††††††††††††† else
††††††††††††††††††††††† TIMER=$REGULAR_TIMER
#*******************************************************************************************************************
† † † † † † † †fi
† † † †fi

Regards.
Javier B.
VDR 1: Intel NUC6i5SYK || SSD 128Gb M.2 2242 ADATA PREMIER || External HD: W.D. Elements 5 Tb || RAM: 4 Gb KINGSTON HYPERX IMPACT ? DDR4† || Remote compatible Microsoft Media Center || 3 tuners pctv nanoStick || [url=http://www.easy-vdr.de/index.php]easyVdr 3.0††
VDR 2: Xtreamer Ultra || HD 2 Tb || RAM: 4 Gb || Remote compatible Microsoft Media Center || 3 tuners pctv nanoStick || [url=http://www.vdr-portal.de/board16-video-disk-recorder/board99-distributionen/board96-yavdr/]yaVdr 0.6†
VDR 3: Siemens Gigaset M740 AV + HD Western Digital "My Book Essential-2, 1Tb" (6 partitions ext2) || [url=http://vdr-m7x0.foroactivo.com.es]VDR-NG-EM 0.6 Pro - Rev 844
jb  02.Dec.2016 11:31:14
Hi.

The change did not work as I expected, because the shutdown of the computer was done at 2:00 am of friday and next boot was scheduled at 6:30 am on saturday instead of friday.

I am going to try another change.

The original part of the script is:
† † †if [ $REGULAR_DAYS -gt 0 ]; then
† † † † † † † REGULAR_TIMER=$((`date -d "$REGULAR_TIME" +%s` + $REGULAR_DAYS * 24 * 60 * 60))

† † † † † † † # when no vdr timer is set or vdr timer starts later than regular timer:
† † † † † † † if [ $TIMER -eq 0 ] || [ $TIMER -gt 0 -a $REGULAR_TIMER -lt $TIMER ] ; then
† † † † † † † † † † † TIMER=$REGULAR_TIMER
† † † † † † † fi
† † † fi

And the modified part of the script is:

† † † †if [ $REGULAR_DAYS -gt 0 ]; then
† † † † † † † †#Check if the REGULAR_TIME of boot should be today or tomorrow
† † † † † † † †if [ $((`date +%s`)) †-lt †$((`date -d "$REGULAR_TIME" +%s`)) ]; then
† † † † † † † † † † † †DAYS_AFTER_TODAY="0" #VDR should start today.
† † † † † † † †else
† † † † † † † † † † † †DAYS_AFTER_TODAY=$REGULAR_DAYS #VDR should start next day according with REGULAR_DAYS, not today
† † † † † † † †fi

† † † † † † † †REGULAR_TIMER=$((`date -d "$REGULAR_TIME" +%s` + $DAYS_AFTER_TODAY * 24 * 60 * 60))

† † † † † † † †# when no vdr timer is set or vdr timer starts later than regular timer:
† † † † † † † †if [ $TIMER -eq 0 ] || [ $TIMER -gt 0 -a $REGULAR_TIMER -lt $TIMER ] ; then
† † † † † † † † † † † †TIMER=$REGULAR_TIMER
† † † † † † † †fi
† † † †fi

I let you know if it works.

Regards.
Javier B.
VDR 1: Intel NUC6i5SYK || SSD 128Gb M.2 2242 ADATA PREMIER || External HD: W.D. Elements 5 Tb || RAM: 4 Gb KINGSTON HYPERX IMPACT ? DDR4† || Remote compatible Microsoft Media Center || 3 tuners pctv nanoStick || [url=http://www.easy-vdr.de/index.php]easyVdr 3.0††
VDR 2: Xtreamer Ultra || HD 2 Tb || RAM: 4 Gb || Remote compatible Microsoft Media Center || 3 tuners pctv nanoStick || [url=http://www.vdr-portal.de/board16-video-disk-recorder/board99-distributionen/board96-yavdr/]yaVdr 0.6†
VDR 3: Siemens Gigaset M740 AV + HD Western Digital "My Book Essential-2, 1Tb" (6 partitions ext2) || [url=http://vdr-m7x0.foroactivo.com.es]VDR-NG-EM 0.6 Pro - Rev 844
jb  03.Dec.2016 09:18:01
Hi.

The script seems to have worked fine today, the recordings stopped about 03:00 am and the computer booted again at 6:30, as you can see in the syslog:
Dec †3 03:03:43 easyvdr easyvdr-runvdr: Terminating by request
Dec †3 03:03:43 easyvdr vdr: stopping plugin: setup
Dec †3 03:03:43 easyvdr vdr: stopping plugin: softhddevice
Dec †3 03:03:43 easyvdr vdr: stopping plugin: text2skin
Dec †3 03:03:43 easyvdr vdr: stopping plugin: systeminfo
Dec †3 03:03:43 easyvdr vdr: stopping plugin: streamdev-server
Dec †3 03:03:43 easyvdr lircd-0.9.0: removed client
Dec †3 03:03:53 easyvdr nmbd: [2016/12/03 03:03:53.330174, †0] ../source3/nmbd/nmbd.c:58(terminate)
Dec †3 03:03:53 easyvdr nmbd: † Got SIGTERM: going down...
Dec †3 03:03:53 easyvdr rsyslogd: [origin software="rsyslogd" swVersion="7.4.4" x-pid="1158" x-info="http://www.rsyslog.com"] exiting on signal 15.
Dec †3 06:25:30 easyvdr rsyslogd: [origin software="rsyslogd" swVersion="7.4.4" x-pid="1018" x-info="http://www.rsyslog.com"] start
Dec †3 06:25:30 easyvdr rsyslogd: rsyslogd's groupid changed to 104
Dec †3 06:25:30 easyvdr rsyslogd: rsyslogd's userid changed to 101
Dec †3 06:25:30 easyvdr kernel: [ † †0.000000] Initializing cgroup subsys cpuset
Dec †3 06:25:30 easyvdr kernel: [ † †0.000000] Initializing cgroup subsys cpu
Dec †3 06:25:30 easyvdr kernel: [ † †0.000000] Initializing cgroup subsys cpuacct
Dec †3 06:25:30 easyvdr kernel: [ † †0.000000] Linux version 4.4.0-45-generic (buildd@lcy01-08) (gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3) ) #66~14.04.1-Ubuntu SMP Wed Oc$
Dec †3 06:25:30 easyvdr kernel: [ † †0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.4.0-45-generic.efi.signed root=UUID=9d4df23d-e3dc-4baf-a608-5edc512dd47d ro quiet splash v$
Dec †3 06:25:30 easyvdr kernel: [ † †0.000000] KERNEL supported cpus:
Dec †3 06:25:30 easyvdr kernel: [ † †0.000000] † Intel GenuineIntel
Dec †3 06:25:30 easyvdr kernel: [ † †0.000000] † AMD AuthenticAMD
Dec †3 06:25:30 easyvdr kernel: [ † †0.000000] † Centaur CentaurHauls


The script of the file:
/usr/share/vdr/shutdown-hooks/10_shutdown.acpi

that works fine with the changes is (changes marked with "***************" ):


#!/bin/bash

#
# VDR shutdown hook for ACPI - Tobias Grimm
# --------------------------
#
# This shutdown hook sets the wakeup time for the next timer using
# ACPI.
#

. /usr/lib/vdr/easyvdr-config-loader
#********************************Changes made by jb start_01*******************************************************************
. /etc/vdr/easyvdr-addon-acpi-wakeup.conf
#********************************Changes made by jb end_01*******************************************************************
##########

AcpiError() {
† † † †$LOG "No writeable $WAKEALARM found. ACPI needed!!!"
† † † †echo "ABORT_MESSAGE=\"ACPI not installed, shutdown aborted!\""
† † † †exit 1
}

ResetWakeupTime() {
† † † †$LOG "Resetting ACPI alarm time"
† † † †if [ -w $WAKEALARM ]; then
† † † † † † † †$LOG "Writing 0 to $WAKEALARM"
† † † † † † † †echo 0 >$WAKEALARM || AcpiError
† † † †else
† † † † † † † †AcpiError
† † † †fi
}

SetWakeupTime() {
† † † †$LOG "Setting ACPI alarm time to: $1"
† † † †if [ -w $WAKEALARM ]; then
† † † † † † † †if ResetWakeupTime; then
† † † † † † † † † † † †$LOG "Writing 1st time $1 to $WAKEALARM"
† † † † † † † † † † † †echo $1 > $WAKEALARM || AcpiError
† † † † † † † † † † † †# remember wakeup time for stop script
† † † † † † † † † † † †echo $1 > $WAKEUP_FILE
† † † † † † † † † † † †return
† † † † † † † †fi
† † † †fi
† † † †AcpiError
}

IsRegularDayOfWeek() {
† †local day
† †for day in $ACPI_REGULAR_DAYS ; do
† † † †if [ "$day" = "`date -d \"@$1\" +%u`" ] ; then
† † † † † †return 0
† † † †fi
† †done
† †return 1
}


nop() {
† † † †# No Operation
† † † †echo -n ""
}

if [ "`basename $0`" != "testwakeup" ] ; then
† † † †# read arguments for acpi-wakeup from conf-file
† † † †/etc/vdr/easyvdr-addon-acpi-wakeup.conf

† † † †WAKEUP_FILE="/var/cache/vdr/acpiwakeup.time"

† † † †# take care of UTC setting
† † † †if ; then
† † † † † † † †UTC=$(egrep "^[^#]*UTC=" /etc/default/rcS | tail -n1 | cut -d= -f2)
† † † †fi

† † † †LOG="logger -t easyvdr-addon-acpi-wakeup"
else
† † † †UTC=$UTC
† † † †WAKEUP_FILE=$WAKEUP_FILE
† † † †LOG="nop"
fi


if [ "$UTC" = "yes" ]; then
† †TIME_FUNCTION="gmtime"
else
† †TIME_FUNCTION="localtime"
fi

# Defaults:
[ -z "$ENABLED" ] && export ENABLED="yes"
[ -z "$REGULAR_DAYS" ] && export REGULAR_DAYS="0"
[ -z "$REGULAR_TIME" ] && export REGULAR_TIME="00:00"
[ -z "$START_AHEAD" ] && export START_AHEAD="5"
[ -z "$WAKEALARM" ] && export WAKEALARM="/sys/class/rtc/rtc0/wakealarm"

TIMER=$1

if [ $ENABLED = "yes" ]; then

† † † †if [ $REGULAR_DAYS -gt 0 ]; then
#********************************Changes made by jb start_02*******************************************************************
† † † † † † † †#Check if the REGULAR_TIME of boot should be today or tomorrow
† † † † † † † †if [ $((`date +%s`)) †-lt †$((`date -d "$REGULAR_TIME" +%s`)) ]; then
† † † † † † † † † † † †DAYS_AFTER_TODAY="0" #VDR should start today.
† † † † † † † †else
† † † † † † † † † † † †DAYS_AFTER_TODAY=$REGULAR_DAYS #VDR should start next day according with REGULAR_DAYS, not today
† † † † † † † †fi
#********************************Changes made by jb end_02*******************************************************************
#*****************Line deleted**************REGULAR_TIMER=$((`date -d "$REGULAR_TIME" +%s` + $DAYS_AFTER_TODAY * 24 * 60 * 60))
#********************************Changes made by jb start_03*******************************************************************
† † † † † † † †REGULAR_TIMER=$((`date -d "$REGULAR_TIME" +%s` + $DAYS_AFTER_TODAY * 24 * 60 * 60))
#********************************Changes made by jb end_03*******************************************************************
† † † † † † † †# when no vdr timer is set or vdr timer starts later than regular timer:
† † † † † † † †if [ $TIMER -eq 0 ] || [ $TIMER -gt 0 -a $REGULAR_TIMER -lt $TIMER ] ; then
† † † † † † † † † † † †TIMER=$REGULAR_TIMER
† † † † † † † †fi
† † † †fi

† † † †if [ $TIMER -gt 0 ]; then
† † † † † † † †MIN_START_AHEAD=$((`date +%s` + 60 * $START_AHEAD))
† † † † † † † †if [ $MIN_START_AHEAD -gt $TIMER ]; then
† † † † † † † † † † † †$LOG "Can not set wakeup time less than $START_AHEAD minutes ahead."
† † † † † † † † † † † †echo "ABORT_MESSAGE=\"Wakeup in less than $START_AHEAD minutes, aborting!\""
† † † † † † † † † † † †exit 1
† † † † † † † †fi

† † † † † † † †# adjust wakeup time by START_AHEAD
† † † † † † † †TIMER=$(($TIMER - 60 * $START_AHEAD))
† † † †fi

† † † †if [ $TIMER -eq 0 ]; then
† † † † † † † †ResetWakeupTime
† † † †else
† † † † † † † †SetWakeupTime "$TIMER"
† † † †fi
else
† † † †$LOG "ACPIWakeup functionality is disabled"
fi


I have verified that the script is ready to check by mean the "IsRegularDayOfWeek()" routine, if REGULAR_DAYS are "1 2 3 4 5 6 7", that means 1 for monday, 2 for tuesday... 7 for sunday. So you can choose the day of the week that you can wake up vdr by itself. But, for the moment, if "1" means all the days, that is good for me.

Is it possible that the changes can be added for futures updates?.

Regards.
Javier B.
VDR 1: Intel NUC6i5SYK || SSD 128Gb M.2 2242 ADATA PREMIER || External HD: W.D. Elements 5 Tb || RAM: 4 Gb KINGSTON HYPERX IMPACT ? DDR4† || Remote compatible Microsoft Media Center || 3 tuners pctv nanoStick || [url=http://www.easy-vdr.de/index.php]easyVdr 3.0††
VDR 2: Xtreamer Ultra || HD 2 Tb || RAM: 4 Gb || Remote compatible Microsoft Media Center || 3 tuners pctv nanoStick || [url=http://www.vdr-portal.de/board16-video-disk-recorder/board99-distributionen/board96-yavdr/]yaVdr 0.6†
VDR 3: Siemens Gigaset M740 AV + HD Western Digital "My Book Essential-2, 1Tb" (6 partitions ext2) || [url=http://vdr-m7x0.foroactivo.com.es]VDR-NG-EM 0.6 Pro - Rev 844
jb  03.Dec.2016 18:27:18
Hi.

I have realized that the first change is not needed if a dot is added in this if-then:


if [ "`basename $0`" != "testwakeup" ] ; then
† † † †# read arguments for acpi-wakeup from conf-file
#*************************************************************************************Dot needed in next line, like this:
† † † †. /etc/vdr/easyvdr-addon-acpi-wakeup.conf
#*************************************************************************************

† † † †WAKEUP_FILE="/var/cache/vdr/acpiwakeup.time"

† † † †# take care of UTC setting
† † † †if ; then
† † † † † † † †UTC=$(egrep "^[^#]*UTC=" /etc/default/rcS | tail -n1 | cut -d= -f2)
† † † †fi

† † † †LOG="logger -t easyvdr-addon-acpi-wakeup"
else
† † † †UTC=$UTC
† † † †WAKEUP_FILE=$WAKEUP_FILE
† † † †LOG="nop"
fi



Regards.
Javier B.
VDR 1: Intel NUC6i5SYK || SSD 128Gb M.2 2242 ADATA PREMIER || External HD: W.D. Elements 5 Tb || RAM: 4 Gb KINGSTON HYPERX IMPACT ? DDR4† || Remote compatible Microsoft Media Center || 3 tuners pctv nanoStick || [url=http://www.easy-vdr.de/index.php]easyVdr 3.0††
VDR 2: Xtreamer Ultra || HD 2 Tb || RAM: 4 Gb || Remote compatible Microsoft Media Center || 3 tuners pctv nanoStick || [url=http://www.vdr-portal.de/board16-video-disk-recorder/board99-distributionen/board96-yavdr/]yaVdr 0.6†
VDR 3: Siemens Gigaset M740 AV + HD Western Digital "My Book Essential-2, 1Tb" (6 partitions ext2) || [url=http://vdr-m7x0.foroactivo.com.es]VDR-NG-EM 0.6 Pro - Rev 844
jb  05.Dec.2016 09:14:04
Hi.

Changing the if then that I have modified for this:

if [ $ACPI_ENABLED = "yes" ]; then
# check if we should wake up before the next timer:
if [ "$ACPI_REGULAR_DAYS" != "0" ]; then
REGULAR_TIMER=$(date -d "$ACPI_REGULAR_TIME" +%s)
if [ $REGULAR_TIMER -lt $(date +%s) ] ; then
REGULAR_TIMER=$(($REGULAR_TIMER + 24 * 60 * 60))
fi
while ! IsRegularDayOfWeek $REGULAR_TIMER ; do
REGULAR_TIMER=$(($REGULAR_TIMER + 24 * 60 * 60))
done

if [ $TIMER -eq 0 ] || [ $TIMER -gt 0 -a $REGULAR_TIMER -lt $TIMER ] ; then
TIMER=$REGULAR_TIMER
fi
fi
if [ $TIMER -gt 0 ]; then
MIN_START_AHEAD=$((`date +%s` + 60 * $ACPI_START_AHEAD))
if [ $MIN_START_AHEAD -gt $TIMER ]; then
$LOG "Can not set wakeup time less than $ACPI_START_AHEAD minutes ahead."
echo "ABORT_MESSAGE=\"Wakeup in less than $ACPI_START_AHEAD minutes, aborting!\""
exit 1
fi

# adjust wakeup time by ACPI_START_AHEAD
TIMER=$(($TIMER - 60 * $ACPI_START_AHEAD))
fi

if [ $TIMER -eq 0 ]; then
ResetWakeupTime
else
SetWakeupTime "$TIMER"
fi

else
$LOG "ACPIWakeup functionality is disabled"
fi

VDR checks if the chain REGULAR_TIME has this format "1 2 3 4 5 6 7", to start VDR in 1(monday), 2(tuesday)...till 7(sunday). So you can start VDR by itself for example only at weekends (REGULAR_TIME="6 7") or only from monday to friday (REGULAR_TIME="1 2 3 4 5") or the whole week (REGULAR_TIME="1 2 3 4 5 6 7").

Will be possible to change the wrong file "/usr/share/vdr/shutdown-hooks/10_shutdown.acpi" for futures updates?

Regards.
Javier B.
VDR 1: Intel NUC6i5SYK || SSD 128Gb M.2 2242 ADATA PREMIER || External HD: W.D. Elements 5 Tb || RAM: 4 Gb KINGSTON HYPERX IMPACT ? DDR4† || Remote compatible Microsoft Media Center || 3 tuners pctv nanoStick || [url=http://www.easy-vdr.de/index.php]easyVdr 3.0††
VDR 2: Xtreamer Ultra || HD 2 Tb || RAM: 4 Gb || Remote compatible Microsoft Media Center || 3 tuners pctv nanoStick || [url=http://www.vdr-portal.de/board16-video-disk-recorder/board99-distributionen/board96-yavdr/]yaVdr 0.6†
VDR 3: Siemens Gigaset M740 AV + HD Western Digital "My Book Essential-2, 1Tb" (6 partitions ext2) || [url=http://vdr-m7x0.foroactivo.com.es]VDR-NG-EM 0.6 Pro - Rev 844
jb  08.Dec.2016 10:28:44
Hi.

Apologies, I do not want bother you. Just, I wanted to know if you have planed to update this script in the future?


Regards.
Javier B.
VDR 1: Intel NUC6i5SYK || SSD 128Gb M.2 2242 ADATA PREMIER || External HD: W.D. Elements 5 Tb || RAM: 4 Gb KINGSTON HYPERX IMPACT ? DDR4† || Remote compatible Microsoft Media Center || 3 tuners pctv nanoStick || [url=http://www.easy-vdr.de/index.php]easyVdr 3.0††
VDR 2: Xtreamer Ultra || HD 2 Tb || RAM: 4 Gb || Remote compatible Microsoft Media Center || 3 tuners pctv nanoStick || [url=http://www.vdr-portal.de/board16-video-disk-recorder/board99-distributionen/board96-yavdr/]yaVdr 0.6†
VDR 3: Siemens Gigaset M740 AV + HD Western Digital "My Book Essential-2, 1Tb" (6 partitions ext2) || [url=http://vdr-m7x0.foroactivo.com.es]VDR-NG-EM 0.6 Pro - Rev 844
Martin  08.Dec.2016 20:46:43
Hi,

i can check it until tomorrow...

CU
GrŁŖe
Martin
-----------------------------------------------------------------------------------------------------------
[url=http://wiki.easy-vdr.de/index.php/Hilfe]Du brauchst Hilfe? Wir brauchen Daten!†English-Version: Don't eat yellow snow!
Meine VDRs (Spoiler klicken)†
VDR1: ASROCK Q1900M, 4GB, SSDs als Bootplatte,†Bild+Ton aus Geforce 720, easyVDR3.x als Streamdev- und SatIP†Client
VDR2: Esprimo, 2GB, NVIDIA Ausgabe per HDMI, kein GraphTFT am VGA Anschluss,†easyVDR3.x als Streamdev-Client
VDR3: Activy350; SW: Gen2VDR Activy-Edition
SERVER: Asrock Q170M vPro, Core i5-6600K,†Cine S2 V4 mit 4 S2-Tunern,†16GB Corsair, 4*4TB WD-RED, 240 GB SSD,††19" Gehšuse

Clients:†Motorola VIP 19xx, Handys und Tablets†


Bleifuss2  08.Dec.2016 22:11:26
Hello Javier

I'm ill.

Thank you for your Bugfix, i look at it when i'm healthy.
And yes the dot is missing

Regards

Bleifuss
Produktiv-VDR:
Board GA H77-DS3H, Intel Intel(R) Core(TM) i5-3470, Cine S2 DVB, WD 3TB Green, WDC WD20EARS-00J† 2TB, Geforce 750Ti oder Intel HD
Easyvdr 3.0
jb  08.Dec.2016 23:43:10
[quote='Bleifuss2' pid='173363' dateline='1481231486']
I'm ill.

Hi.

I am sorry to hear it. I hope you get better soon.

Thanks and regards.
Javier B.
VDR 1: Intel NUC6i5SYK || SSD 128Gb M.2 2242 ADATA PREMIER || External HD: W.D. Elements 5 Tb || RAM: 4 Gb KINGSTON HYPERX IMPACT ? DDR4† || Remote compatible Microsoft Media Center || 3 tuners pctv nanoStick || [url=http://www.easy-vdr.de/index.php]easyVdr 3.0††
VDR 2: Xtreamer Ultra || HD 2 Tb || RAM: 4 Gb || Remote compatible Microsoft Media Center || 3 tuners pctv nanoStick || [url=http://www.vdr-portal.de/board16-video-disk-recorder/board99-distributionen/board96-yavdr/]yaVdr 0.6†
VDR 3: Siemens Gigaset M740 AV + HD Western Digital "My Book Essential-2, 1Tb" (6 partitions ext2) || [url=http://vdr-m7x0.foroactivo.com.es]VDR-NG-EM 0.6 Pro - Rev 844
Martin  09.Dec.2016 12:53:38
Hi,

i built it in 3-base-unstable ppa.

The diff is:


martin@martin-ws ? ~/src/trusty-ng/e/easyvdr-addon-acpi-wakeup/debian ? ? master ? diff 10_shutdown.acpi 10_shutdown.acpi.old
10,11d9
< # 20161209 javier: Some fixes for easyvdr
< #
64c62
< . /etc/vdr/easyvdr-addon-acpi-wakeup.conf
---
> /etc/vdr/easyvdr-addon-acpi-wakeup.conf
99,106c97
< #Check if the REGULAR_TIME of boot should be today or tomorrow
< † † † † † † † † if [ $((`date +%s`)) †-lt †$((`date -d "$REGULAR_TIME" +%s`)) ]; then
< † † † † † † † † † † † † DAYS_AFTER_TODAY="0" #VDR should start today.
< † † † † † † † † else
< † † † † † † † † † † † † DAYS_AFTER_TODAY=$REGULAR_DAYS #VDR should start next day according with REGULAR_DAYS, not today
< † † † † † † † † fi
<
< REGULAR_TIMER=$((`date -d "$REGULAR_TIME" +%s` + $DAYS_AFTER_TODAY * 24 * 60 * 60))
---
> REGULAR_TIMER=$((`date -d "$REGULAR_TIME" +%s` + $REGULAR_DAYS * 24 * 60 * 60))

I can't test it because i use no wakeup.
GrŁŖe
Martin
-----------------------------------------------------------------------------------------------------------
[url=http://wiki.easy-vdr.de/index.php/Hilfe]Du brauchst Hilfe? Wir brauchen Daten!†English-Version: Don't eat yellow snow!
Meine VDRs (Spoiler klicken)†
VDR1: ASROCK Q1900M, 4GB, SSDs als Bootplatte,†Bild+Ton aus Geforce 720, easyVDR3.x als Streamdev- und SatIP†Client
VDR2: Esprimo, 2GB, NVIDIA Ausgabe per HDMI, kein GraphTFT am VGA Anschluss,†easyVDR3.x als Streamdev-Client
VDR3: Activy350; SW: Gen2VDR Activy-Edition
SERVER: Asrock Q170M vPro, Core i5-6600K,†Cine S2 V4 mit 4 S2-Tunern,†16GB Corsair, 4*4TB WD-RED, 240 GB SSD,††19" Gehšuse

Clients:†Motorola VIP 19xx, Handys und Tablets†


jb  09.Dec.2016 13:11:21
[quote='Martin' pid='173369' dateline='1481284418']
i built it in 3-base-unstable ppa.

I can't test it because i use no wakeup.


Hi.

I will try. Is it enough to do an apt-get dist-upgrade to have the new script?

Regards.
Javier B.
VDR 1: Intel NUC6i5SYK || SSD 128Gb M.2 2242 ADATA PREMIER || External HD: W.D. Elements 5 Tb || RAM: 4 Gb KINGSTON HYPERX IMPACT ? DDR4† || Remote compatible Microsoft Media Center || 3 tuners pctv nanoStick || [url=http://www.easy-vdr.de/index.php]easyVdr 3.0††
VDR 2: Xtreamer Ultra || HD 2 Tb || RAM: 4 Gb || Remote compatible Microsoft Media Center || 3 tuners pctv nanoStick || [url=http://www.vdr-portal.de/board16-video-disk-recorder/board99-distributionen/board96-yavdr/]yaVdr 0.6†
VDR 3: Siemens Gigaset M740 AV + HD Western Digital "My Book Essential-2, 1Tb" (6 partitions ext2) || [url=http://vdr-m7x0.foroactivo.com.es]VDR-NG-EM 0.6 Pro - Rev 844
Martin  09.Dec.2016 13:21:46
Only If in /etc/apt/sources.list base3-unstable is activated...

But be carefull: Saver is only to install the needed package from this source. Today you possibly get a new graphic driver:
https://launchpad.net/~easyvdr-team/+archive/ubuntu/3-base-unstable/+packages

Tomorrow maybe PC burns down or so :-)


PS: But we need more opinions and then testers if we want to get it ever to the stable PPA...
GrŁŖe
Martin
-----------------------------------------------------------------------------------------------------------
[url=http://wiki.easy-vdr.de/index.php/Hilfe]Du brauchst Hilfe? Wir brauchen Daten!†English-Version: Don't eat yellow snow!
Meine VDRs (Spoiler klicken)†
VDR1: ASROCK Q1900M, 4GB, SSDs als Bootplatte,†Bild+Ton aus Geforce 720, easyVDR3.x als Streamdev- und SatIP†Client
VDR2: Esprimo, 2GB, NVIDIA Ausgabe per HDMI, kein GraphTFT am VGA Anschluss,†easyVDR3.x als Streamdev-Client
VDR3: Activy350; SW: Gen2VDR Activy-Edition
SERVER: Asrock Q170M vPro, Core i5-6600K,†Cine S2 V4 mit 4 S2-Tunern,†16GB Corsair, 4*4TB WD-RED, 240 GB SSD,††19" Gehšuse

Clients:†Motorola VIP 19xx, Handys und Tablets†


jb  09.Dec.2016 13:41:19
[quote='Martin' pid='173371' dateline='1481286106']
Only If in /etc/apt/sources.list base3-unstable is activated...

But be carefull: Saver is only to install the needed package from this source. Today you possibly get a new graphic driver:
https://launchpad.net/~easyvdr-team/+archive/ubuntu/3-base-unstable/+packages

Tomorrow maybe PC burns down or so :-)


PS: But we need more opinions and then testers if we want to get it ever to the stable PPA...


Ok, I have only the stable package, so† as I have the file already modified and working, I will wait till other testers say if it is ok.


Edited: I have checked the content of the script after the changes, it is exactly the same that the one I have in my computer, so it should work fine.

Regards, and thank you all.

Javier B.
VDR 1: Intel NUC6i5SYK || SSD 128Gb M.2 2242 ADATA PREMIER || External HD: W.D. Elements 5 Tb || RAM: 4 Gb KINGSTON HYPERX IMPACT ? DDR4† || Remote compatible Microsoft Media Center || 3 tuners pctv nanoStick || [url=http://www.easy-vdr.de/index.php]easyVdr 3.0††
VDR 2: Xtreamer Ultra || HD 2 Tb || RAM: 4 Gb || Remote compatible Microsoft Media Center || 3 tuners pctv nanoStick || [url=http://www.vdr-portal.de/board16-video-disk-recorder/board99-distributionen/board96-yavdr/]yaVdr 0.6†
VDR 3: Siemens Gigaset M740 AV + HD Western Digital "My Book Essential-2, 1Tb" (6 partitions ext2) || [url=http://vdr-m7x0.foroactivo.com.es]VDR-NG-EM 0.6 Pro - Rev 844