In this recipe, we will set a wake-up time to 1 minute in advance and put the system to sleep:
- Log in to any Linux system that has an RTC clockâany Linux laptop can work. Unfortunately, Raspberry Pi does not have an onboard RTC, and cannot be woken up without additional hardware.
- Get root permissions using sudo:
$ sudo bash
#
- Instruct RTC to wake up the system in 1 minute:
# date '+%s' -d '+1 minute' > /sys/class/rtc/rtc0/wakealarm
- Put the system to sleep:
# echo freeze > /sys/power/state
- Wait for a minute. Your system will wake up.