Solved [OpenElec] Daily Wakeup doesn't work - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111) +---- Forum: Linux (https://forum.kodi.tv/forumdisplay.php?fid=52) +---- Thread: Solved [OpenElec] Daily Wakeup doesn't work (/showthread.php?tid=206971) |
[OpenElec] Daily Wakeup doesn't work - ReinholD - 2014-10-21 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: 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 ] Sources: http://www.computerhope.com/unix/udate.htm http://www.dreamsyssoft.com/unix-shell-scripting/ifelse-tutorial.php RE: [OpenElec] Daily Wakeup doesn't work - wsnipex - 2014-10-22 why are you trying to wake up _localhost_? I recon that it must be up and running to execute this script You will need to set a wakeup in your BIOS. RE: [OpenElec] Daily Wakeup doesn't work - ReinholD - 2014-10-22 (2014-10-22, 08:57)wsnipex Wrote: why are you trying to wake up _localhost_? I recon that it must be up and running to execute this script The way I understand is, that the command is run AFTER the system have been woken up, but maybe I've misunderstood.. Unfortunately, there is no option to set in the BIOS. Under ACPI configurations there is: Code: Option: Current state The system is a Zotac ZBOX ID36 http://www.zotac.com/products/mini-pcs/zbox-blu-ray/product/zbox/detail/zbox-blu-ray-3d-id36-2/sort/starttime/order/DESC/amount/10/section/specifications.html RE: [OpenElec] Daily Wakeup doesn't work - black_eagle - 2014-10-22 +1 for what wsnipex said. The machine in my bedroom is set in the BIOS to wake up each morning at 6.59AM. The Alarm Clock addon is set to start playing a radio station at 7.00AM. You could use a similar method to trigger the library update by setting the URL to contain the JSON call, or you could set up a CRON job to call your setwakeup.sh script at a set time, knowing the machine will be running. EDIT If your machine does not have settings in the BIOS for Wake on RTC Alarm, try reading here http://www.mythtv.org/wiki/ACPI_Wakeup RE: [OpenElec] Daily Wakeup doesn't work - ReinholD - 2014-10-22 Hmm. The CRON job was a good idea, but I'm having trouble. The CRON job Code: */5 * * * * date >>/tmp/cron-date.log but the job Code: */5 * * * * xbmc-send --action="UpdateLibrary(video)" >>/tmp/cron.log RE: [OpenElec] Daily Wakeup doesn't work - ReinholD - 2014-10-22 Okay, I found a (kinda shitty) workaround, but now it works. By connecting the system via ethernet cable and not wireless, I was able to get Wake On LAN working. I then used my Synology's cron job to execute a wake command, followed by a Update Library command. The file /etc/crontab ended like this: Code: #minute hour mday month wday who command Marking thread as SOLVED. If anyone have any questions about the method, feel free to post a reply here. RE: [OpenElec] Daily Wakeup doesn't work - wsnipex - 2014-10-22 both can be only a single line/at the same time. just seperate both commands with ";" or "&&" edit: you might need a sleep as well to give the host some time to come up. RE: [OpenElec] Daily Wakeup doesn't work - ReinholD - 2014-10-22 (2014-10-22, 12:34)wsnipex Wrote: both can be only a single line/at the same time. I am not sure what you are refering to..? |