Kodi Community Forum

Full Version: Daily wakeup via PVR settings
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Last week I openend a ticket on trac:

http://trac.xbmc.org/ticket/13560

Quote:The setting to wake up the PC daily via the PVR power management settings does not seem to work.

In guisettings the following is set:

<pvrpowermanagement>

<backendidletime>0</backendidletime> <dailywakeup>true</dailywakeup> <dailywakeuptime>21:40:00</dailywakeuptime> <enabled>true</enabled> <prewakeup>2</prewakeup> <setwakeupcmd>/usr/bin/setwakeup.sh</setwakeupcmd>

</pvrpowermanagement>

The next recording is scheduled for 22:00 so wakeup time is 21:58.

When I suspend XBMC at 21:22 the following is logged in the debug log:

21:22:05 T:3015878400 DEBUG: CAnnouncementManager - Announcement: OnScreensaverActivated from xbmc 21:22:05 T:3015878400 DEBUG: GOT ANNOUNCEMENT, type: 4, from xbmc, message OnScreensaverActivated 21:22:05 T:3015878400 DEBUG: ------ Window Init () ------ 21:22:05 T:3015878400 ERROR: SetWakeupCommand - failed to execute wakeup command '/usr/bin/setwakeup.sh 1353013080': Unknown error -1 (-1) 21:22:05 T:3015878400 DEBUG: CAnnouncementManager - Announcement: OnSleep from xbmc 21:22:05 T:3015878400 DEBUG: GOT ANNOUNCEMENT, type: 8, from xbmc, message OnSleep 21:22:05 T:3015878400 NOTICE: OnSleep: Running sleep jobs 21:22:05 T:3015878400 NOTICE: OnSleep: Stopping lirc 21:22:05 T:3015878400 INFO: LIRC setUsed: disabled 21:22:05 T:2913618752 DEBUG: ### [XBMC LCD/VFD] - Clearing display contents 21:22:06 T:3015878400 DEBUG: UPower: Recieved an unknown signal NotifySleep 21:22:07 T:2854726464 ERROR: AddOnLog: Tvheadend HTSP Client: ReadMessage - Failed to read packet size (Connection reset by peer) 21:22:07 T:3015878400 ERROR: Previous line repeats 100 times. 21:22:07 T:3015878400 INFO: LIRC setUsed: disabled 21:22:07 T:3015878400 DEBUG: CAnnouncementManager - Announcement: OnScreensaverDeactivated from xbmc 21:22:07 T:3015878400 DEBUG: GOT ANNOUNCEMENT, type: 4, from xbmc, message OnScreensaverDeactivated

Although it reports a -1 error, the correct time is written to the wakeup timer in /sys/class/rtc/rtc0/wakealarm

That 1353013080 epoch time that is being passed to setwakeup.sh is

GMT: Thu, 15 Nov 2012 20:58:00 GMT Your time zone: Thu Nov 15 2012 21:58:00 GMT+1

So the time of the recording, not the daily wakeup that is set.

The same happens with any time I set, I would like to wake up the PC daily at 3am but it always writes the time of the next recording in the wakealarm.

I am wondering if this can be picked up still before the gold status; it makes no sense to keep the settings in the GUI if they are not working.

Or is there somebody who has seen this functionality working?
I've had a quick look at the code and everything seems to be fine. I'll try it out tomorrow to make sure if it's ok...
Thanks, so far I seem to be the only one who is trying this functionality... curious what your results will be!
I tested this just now...

With the same settings as you (dailywakeup at 21:40:00, next recording 22:00, idletime 0, prewakeup 2):
10:26:32 T:140346765662080 ERROR: SetWakeupCommand - failed to execute wakeup command '/usr/bin/wakeupcommand.sh 1353530400': Unknown error -1 (-1)

If you convert the above timestamp to a human readable form you'll see that it's correct (20:40 GMT)...

If I change the dailywakeup to 22:40:00 and leave everything else as it is I get the following:
10:30:54 T:140453235353472 ERROR: SetWakeupCommand - failed to execute wakeup command '/usr/bin/wakeupcommand.sh 1353531480': Unknown error -1 (-1)

If you convert the above timestamp to a human readable form you'll see that it's also correct because the recording occurs at an earlier time (20:58 GMT)...

But I found another bug (I'm not really sure if it's intended like this)... if there is no recording scheduled the dailywakeup will never occur (because the uninitialsed time for the next recording is always lower than the current time). I can provide a fix for this one if @opdenkamp and the other xbmc team members would like...

10:34:30 T:139737022089088 ERROR: SetWakeupCommand - failed to execute wakeup command '/usr/bin/wakeupcommand.sh 1240428288': Unknown error -1 (-1)
Interesting. I will do some more testing again to see if I can replicate your results!
It is still setting the time for the next recording as in post #1, unfortunately. Maybe more people will report on this in the future, I hope.
(2012-11-21, 11:36)mikrohard Wrote: [ -> ]But I found another bug (I'm not really sure if it's intended like this)... if there is no recording scheduled the dailywakeup will never occur (because the uninitialsed time for the next recording is always lower than the current time). I can provide a fix for this one if @opdenkamp and the other xbmc team members would like...

10:34:30 T:139737022089088 ERROR: SetWakeupCommand - failed to execute wakeup command '/usr/bin/wakeupcommand.sh 1240428288': Unknown error -1 (-1)
yes please, fixes are always welcome
Sure... no problem... will do. I just wasn't sure if it was intended or not.
With beta 2 I still can't get this working, rather frustrating...

mikrohard, what is your timezone setting? I'm trying to grasp anything that could explain why my behaviour is different from yours...

If I don't have any recording timers set, it always writes 23:59:59, so midnight...

ERROR: SetWakeupCommand - failed to execute wakeup command 'setwakeup.sh 1354661999': Unknown error -1 (-1)

GMT: Tue, 04 Dec 2012 22:59:59 GMT
Your time zone: Tue Dec 04 2012 23:59:59 GMT+1


Could Openelec be an issue here maybe?
you need to provide the full path to the script
Yes tried that too, I can post logs of that if you'd like.

So to summarize:

Recording timer set: setwakeup gets the proper time for that, wakeup works but never the daily wakeup
No timers set: setwakeup gets 1 sec before midnight as time, but I always have recordings set

dushmaniac, are you using this on OE/ OE+pulse?
If your daily wakeup time is always midnight there might be a problem with your settings (if I recall correctly that's the default value)... did you try a full guisettings reset (but first make a backup of the old settings)?
My settings are in the first post and I have tried many different times...

Can you post your guisettings here with the PVR power management section?
I installed Ubuntu and XBMC and now it works as it should. I guess it is an OpenELEC issue.

Thanks for helping me though. Finally my htpc will wakeup in the night for some housekeeping Smile
I get a similar problem on Debian Wheezy 32-bit. (XBMC compiled from trunk: c47e925c8e, Date: Thu Jan 3 13:40:38 2013)

Error from the xbmc.log:
ERROR: SetWakeupCommand - failed to execute wakeup command '/usr/bin/setwakeup 1357499400': Unknown error 4294967295 (-1)

The '/usr/bin/setwakeup' command works in my setup correctly, when I execute it manually.

Trying arround to solve the problem, I noticed that any command configured as SetWakeupCommand gets evaluated by the relevant system() call in PVRManager.cpp to (-1). The problem persists even if a simple command such as "echo" is directly hardcoded in PVRManager.cpp. Well that's strange...
Pages: 1 2