It’s nice to have a RTC on the Rockpi4, but it does not seem to support wakealarms.
It is possible to set the alarm with
date -d "tomorrow 08:00" '+%s' > /sys/class/rtc/rtc0/wakealarm
but this does not seem to have any effect. Is this a hardware limitation (i.e. is the IRQ-line of the rtc-chip connected) or something missing in the driver?
The hardware should have the ability to power on with alarm. Check the schematic and the datasheet of pmic rk808, there are three condition to trigger the boot:
thanks for this info. I didn’t even know that suspend works, I will try this with my setup (Armbian headless). Nevertheless, have you tested the wakealarm with a real shutdown (halt -p) as well? Suspend is fine, but requires constant power supply. In contrast, after shutdown the RTC backup battery should keep the alarm-time in the registers of the RTC.
Another question: I read the datasheet of the pmic. Is it correct that the registers of the RTC are accessible using I2C?
I remember seeing option to turn on RockPi without replugging power after shutdown with GPIO, but now can’t find it, can anyone provide information on it?
@jack sorry to ping you, but I’m unsure maybe i heared it from another place and spread wrong info. Were there any experiments with turning rock pi on without replugging power supply?
RTC alarm should do that but we haven’t tested it so far. As @Stephen explained above, only works in suspend mode currently. The other way is to assert the power_on signal several seconds with DC on to start booting, but we don’t have power_on signal exported on the GPIO header.
The capability to suspend to RAM and wakeup on an RTC alarm is working great on my Rockpi4
If I understand correctly, it is not possible to wake up the board from shutdown mode with an external signal (GPIO header does not expose it), but is it possible to get out of suspend mode from an external signal?
@Stephen, sorry for ping, but I’m still interested in any other way go wake up RockPi from suspend mode other than wakeup alarm, any information on this?
Hello, I am using the Rock Pi Penta SATA HAT kit with a real time clock (because it does not support wake on LAN). It is running on Armbian 21.02.2 and has OMV installed.
systemctl suspend
does not reliably suspend the Rock Pi. First the fan is starting to run at full speed, then it might suspend or not, i.e. the fan just continues to run at full speed. It also has the tendency to start up again in less than a minute.
date -d “today 20:26” ‘+%s’ | sudo tee /sys/class/rtc/rtc0/wakealarm
seems to work, but a lot of times the system is already up and running again before the wakealarm is executed.
echo mem | sudo tee /sys/power/state
also does not suspend the system.
What needs to be done to reliably suspend the system and that start it up with wakealarm?
Thanks in advance!
Since I got tired of wakealarms, because of needing to plan before hand when i will need my NAS - maybe my advice will help, if you are looking for not fully suspend (i.e. deacrese electricity consumption to minimum watts amout) and you wanna to stop noises coming from nas:
Create a bash script that will spindown HDD and stop fan and add it to cron (with stopping all the services that may spin them back, like deluged or find checks) and create script that should spin them all back, in case of smb - it will spin drives back on access, so you will always have access even in the middle of the night, and fan with services could be added to cron job
Of course wakealarms are not ideal, if you nee to use the system at other times, but why does the RockPi 4c behave like that if the the penat SATA hat is attached?
Well, in case of Fan - it’s because there still voltage on GPIO, so it’s race between stop script and suspend. (my guess).
In case why it’s wakes up soon after -
Well, this one is strange, because for me it’s always working for suspend
Ok, I tried the wakeup from suspend with
rockpi4c_ubuntu_focal_minimal_arm64_20200820_1207-gpt
This has kernel 4.4.x in it.
Now, does anybody know if it is the 4.4 kernel, that makes it work, since with armbian buster 5.10.x it doesn’t work, or is there a module in Armbian with kernel 5.10 so that it would also work?