2014-10-21, 19:42
System: OpenElec Generic x86_64 version 4.2.1 (latest stable), XBMC 13.2
Hi. I'm trying to do an automatic wake-up each night to update the movie library, but it doesn't seem to work.
I set the "Wakeup Daily" ind Settings>PVR>Power Management, and set the time in the format HH:MM:RR (like 14:05:00) .. I've only done it in the testing fase so far, so the time have been set 5 minutes into the future or so.
The FIRST time i tested this, it worked fine, but it hasn't worked since. The system simply won't wake up from S5 state. I get this error in the log:
I've set the "Wakeup Command" to /storage/.config/setwakeup.sh which contains:
The command works fine in SSH, and it was executed the first and only succesful time the system woke up. but the command is executed every time the system is turned on, even if it is turned on by the remote.
SO my questions are:
1. How do I make the OpenElec/XBMC system wake up at a specific time every night?
2. How do I make a script that only runs when the system has been woken up by the timer, and not anything else?
I though of a timebased workaround in setwakeup.sh, that would only trigger the command if the system was woken up at a specific hour, like:
But I'm not fully into linux syntaxes, so I might need a little help there.
Sources:
http://www.computerhope.com/unix/udate.htm
http://www.dreamsyssoft.com/unix-shell-s...torial.php
Hi. I'm trying to do an automatic wake-up each night to update the movie library, but it doesn't seem to work.
I set the "Wakeup Daily" ind Settings>PVR>Power Management, and set the time in the format HH:MM:RR (like 14:05:00) .. I've only done it in the testing fase so far, so the time have been set 5 minutes into the future or so.
The FIRST time i tested this, it worked fine, but it hasn't worked since. The system simply won't wake up from S5 state. I get this error in the log:
Code:
14:50:02 T:140344538003328 ERROR: SetWakeupCommand - failed to execute wakeup command '/storage/.config/setwakeup.sh 1413899100': Unknown error 512 (512)
I've set the "Wakeup Command" to /storage/.config/setwakeup.sh which contains:
Code:
curl --data-binary '{ "jsonrpc": "2.0", "method": "VideoLibrary.Scan", "id": "mybash"}' -H 'content-type: application/json;' http://localhost:80/jsonrpc
The command works fine in SSH, and it was executed the first and only succesful time the system woke up. but the command is executed every time the system is turned on, even if it is turned on by the remote.
SO my questions are:
1. How do I make the OpenElec/XBMC system wake up at a specific time every night?
2. How do I make a script that only runs when the system has been woken up by the timer, and not anything else?
I though of a timebased workaround in setwakeup.sh, that would only trigger the command if the system was woken up at a specific hour, like:
Code:
if [ "date +%H" > 5 ] && [ "date +%H" < 8 ]
curl --data-binary '{ "jsonrpc": "2.0", "method": "VideoLibrary.Scan", "id": "mybash"}' -H 'content-type: application/json;' http://localhost:80/jsonrpc
fi
Sources:
http://www.computerhope.com/unix/udate.htm
http://www.dreamsyssoft.com/unix-shell-s...torial.php