Power Saving (Suspend) and KODI: Success story
#1
Hi folks,

Since a long time I want to run KODI without switching off Suspend Mode on operating system level. This was not possible under Mac OS X El Capitan (at least not at the beginning of this version) since a bug on OS level prevent that the network link (cable) restart again after waking up from Suspend Mode.

I give it now another - successfully - try after updating the OS to macOS Sierra 10.12.3. On OS level I configured that after 2h the monitor go into sleep and with him the whole computer (Suspend mode).

What I need on KODI level is the mechanism that just before a scheduled PVR recording the host awakes an so KODI.

I referenced in KODI at PVR & TV -> Energy Saving -> Wakup command a shell script called:

/usr/local/bin/wakeMeUp.sh

with following content

Code:
#!/bin/zsh -f

OFFSET=15
alias set_wake_time='/bin/date -r $1 "-v+${OFFSET}S" "+%D %T"'
/usr/bin/sudo /usr/bin/pmset schedule wake "`set_wake_time`" || exit 1

STAMP=/tmp/wakeMeUp
echo $1 > $STAMP
echo `set_wake_time` >> $STAMP
exit 0

Note that $1 is an automatically filled parameter of the start time of the next recoding (in epoch seconds) minus the time which you specify at PVR & TV -> Energy Saving -> WakeUp before recoding

Note additionally that the script requires that you can use the commmand /usr/bin/pmset without entering your password due to sudo authorization.

This must be configured in the global sudoers file (sudo visudo) with e.g. following entry at the end (assuming that you member of admin group, which is a prerequisite)

Code:
%admin ALL=(ALL) NOPASSWD: /usr/bin/pmset

You can control the operations with the entries in a kind of temporary log file on /tmp/wakeMeUp

The whole post is only a summary of valuable other post in the past, e.g.:
http://forum.kodi.tv/showthread.php?tid=...ght=wakeup
http://apple.stackexchange.com/questions...ral-waking
Reply

Logout Mark Read Team Forum Stats Members Help
Power Saving (Suspend) and KODI: Success story0