Adafruit PiRTC - PCF8523 RTC: hwclock: ioctl(RTC_RD_TIME) to /dev/rtc0 to read the time failed: Invalid argument
Posted: Tue May 14, 2024 8:23 am
"If you are getting an error message like this when trying to read/write to the RTC, make sure you have a good coin cell battery installed."
I have use five different "Energizer CR1220 Low Drain 3V lithuim Batteries" - all have had a minimum of 3.2 Volts.
No Luck - PLEASE ADVISE!
OS: Raspbian GNU/Linux 12 (bookworm)
--- /lib/udev/hwclock-set
--- DOES NOT HAVE ALL INFORMATION SHOWN IN TUTORTIAL "https://learn.adafruit.com/adding-a-real-time-clock-to-raspberry-pi/set-rtc-time"
#!/bin/sh
# Reset the System Clock to UTC if the hardware clock from which it
# was copied by the kernel was in localtime.
dev=$1
#if [ -e /run/systemd/system ] ; then
# exit 0
#fi
#/sbin/hwclock --rtc=$dev --systz
/sbin/hwclock --rtc=$dev --hctosys
____________________________________________________
COMMAND LINE: sudo hwclock -r --verbose
hwclock from util-linux 2.38.1
System Time: 1715689241.189133
Trying to open: /dev/rtc0
Using the rtc interface to the clock.
Last drift adjustment done at 1715687826 seconds after 1969
Last calibration done at 1715687826 seconds after 1969
Hardware clock is on UTC time
Assuming hardware clock is kept in UTC time.
Waiting for clock tick...
ioctl(4, RTC_UIE_ON, 0): Invalid argument
Waiting in loop for time from /dev/rtc0 to change
hwclock: ioctl(RTC_RD_TIME) to /dev/rtc0 to read the time failed: Invalid argument
...synchronization failed
I have use five different "Energizer CR1220 Low Drain 3V lithuim Batteries" - all have had a minimum of 3.2 Volts.
No Luck - PLEASE ADVISE!
OS: Raspbian GNU/Linux 12 (bookworm)
--- /lib/udev/hwclock-set
--- DOES NOT HAVE ALL INFORMATION SHOWN IN TUTORTIAL "https://learn.adafruit.com/adding-a-real-time-clock-to-raspberry-pi/set-rtc-time"
#!/bin/sh
# Reset the System Clock to UTC if the hardware clock from which it
# was copied by the kernel was in localtime.
dev=$1
#if [ -e /run/systemd/system ] ; then
# exit 0
#fi
#/sbin/hwclock --rtc=$dev --systz
/sbin/hwclock --rtc=$dev --hctosys
____________________________________________________
COMMAND LINE: sudo hwclock -r --verbose
hwclock from util-linux 2.38.1
System Time: 1715689241.189133
Trying to open: /dev/rtc0
Using the rtc interface to the clock.
Last drift adjustment done at 1715687826 seconds after 1969
Last calibration done at 1715687826 seconds after 1969
Hardware clock is on UTC time
Assuming hardware clock is kept in UTC time.
Waiting for clock tick...
ioctl(4, RTC_UIE_ON, 0): Invalid argument
Waiting in loop for time from /dev/rtc0 to change
hwclock: ioctl(RTC_RD_TIME) to /dev/rtc0 to read the time failed: Invalid argument
...synchronization failed