I have put RTC (Model is SHIM RTC Realtime Clock Accessory Board) at my RPI.
I need to test if it is working or not.
Is there any command which is checking if it is working or not?
I am using RPI 3B+ and Raspbian Buster.
Googling "SHIM RTC Realtime Clock Accessory Board" we can find a picture and tell that there is a MCP7940N RTC chip onboard, with connects via I2C. So first, related: Using the MCP7940N RTC with the Pi 3B+
To check if it's detected by the Pi, you should be able to use the
i2cdetect -y 1 command and see 'UU' for the address 0x6f.
To use it with Rasbian, following these directions you should add
# Enable i2c real-time clock dtoverlay=i2c-rtc,mcp7940x
/boot/config.txt. You may also need to run
sudo sh -c "echo mcp7940x 0x6f > /sys/class/i2c-adapter/i2c-1/new_device" after a reboot. Then run
hwclock --systohc to set the clock. On reboot it should automatically use the date and time from the RTC.
To test if it's working correctly start up the Pi without any internet access (unplugging Ethernet and disabling WiFi). The time should be set correctly.
timedatectl will show the current status of the clock and RTC (if fitted)
Local time: Tue 2019-10-01 12:16:29 AEST Universal time: Tue 2019-10-01 02:16:29 UTC RTC time: Tue 2019-10-01 02:16:30 Time zone: Australia/Sydney (AEST, +1000) Network time on: yes NTP synchronized: yes RTC in local TZ: no
If the RTC is missing or not correctly installed it will show
RTC time: n/a