Suspend and Wakeup at specific times

Is there any way to suspend and wakeup at specific times the N2 via command line?

I want to suspend it everyday at 11:00PM and wake up it every day at 8:00AM.

It should be possible to switch off or suspend via a crontab, but waking again is not so easy.

Shoog

Oh yes, I know it possible, but how?

The real question is why bother ?
If the N2 goes idle it consumes less than 2W of power.

There are write ups on setting up crontabs within Libreelec and Coreelec, its not that tricky - but its a long while since I ever had any need to do it.

Google is your friend:

Shoog

I know crontab is an option, but my original question is what the command to suspend and what to wake it up at specific time?

There is no mechanism to wake from suspend via a script. The only way it can be done is by sending a wol signal from an external source. This would require a timer on another device or your router.

The best solution is to leave it on a let it go idle.

Shoog

There is:

It will work with the included setwakeup.sh too.

2 Likes

I think that the Kodi Settings / PVR & Live TV / Power Saving is not working.

I set it to wakeup daily at 08:00:00 but, after shutdown Kodi it always set the wakeup time to 02:59:59

Jun 19 10:10:00 CoreELEC systemd[1]: Stopping Kodi Media Center...
Jun 19 10:10:03 CoreELEC setwakeup.sh[14744]: ### Setting system wakeup time ###
Jun 19 10:10:03 CoreELEC setwakeup.sh[14746]: ### rtc_time        : 13:10:03
                                              rtc_date        : 2020-06-19
                                              alrm_time        : 02:59:59
                                              alrm_date        : 2020-06-20
                                              alarm_IRQ        : yes
                                              alrm_pending        : no
                                              update IRQ enabled        : no
                                              periodic IRQ enabled        : no
                                              periodic IRQ frequency        : 1
                                              max user IRQ frequency        : 64
                                              24hr                : yes ###

My settings.xml

    <setting id="pvrpowermanagement.backendidletime">0</setting>
    <setting id="pvrpowermanagement.dailywakeup">true</setting>
    <setting id="pvrpowermanagement.dailywakeuptime">08:00:00</setting>
    <setting id="pvrpowermanagement.enabled">true</setting>
    <setting id="pvrpowermanagement.prewakeup" default="true">15</setting>
    <setting id="pvrpowermanagement.setwakeupcmd">/usr/bin/setwakeup.sh</setting>

Something is wrong. Probably UTC time. Do you live somewhere -5h to utc?

No. I’m living in -3 UTC. The clock is set correctly.

See this line in the log above:
Jun 19 10:10:03 CoreELEC setwakeup.sh[14746]: ### rtc_time : 13:10:03

Note that “### rtc_time : 13:10:03” is (UTC time) while in the log message my current date/time using local time: “Jun 19 10:10:03 CoreELEC setwakeup.sh…”

10:10

Are you using it for recordings? Otherwise when it’s always wakeup time at 8am use the script I posted

Nevermind, already solved with your script. Just for knowledge and bug report for future versions.