Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 3556

Beginners • Re: Real Time Clock on Pi 5

$
0
0
If you are planning to shut the Pi 5 down and have it boot up again automatically at a pre-determined time, then that is possible with the addition of the RTC battery.

There is a simple method (documented somewhere) of writing an Epoch time (seconds since 00:00 01/01/1970) into a file to set the RTC wakeup. I think the file is /sys/class/rtc/rtc0/wakealarm.

For example, to set the alarm to 8am on Christmas day this year:

Code:

date -d "2024-12-25 06:00" "+%s" >/sys/class/rtc/rtc0/wakealarm
You'd need to run that as root.

Then do a normal shutdown/poweroff.

Or you could leave the Pi on all the time (if not using batteries) and use cron or a systemd timer to start your data collection at appropriate times. No RTC needed for that.

Statistics: Posted by rpdom — Fri Aug 30, 2024 8:21 pm



Viewing all articles
Browse latest Browse all 3556

Trending Articles