fredrlw
Posts: 2
Joined: Thu Nov 10, 2016 11:21 pm

disconnected RTC

Thu Jan 05, 2017 12:32 am

I use my RPi for research and don't allways have acces to the internet which is crucial, especially when my data logging requires time stamps. I will therefore use a RTC but i am wondering if it has to be connected to the RPi all the time, or could i just plug it in when i need it? (after the first configuration ofc).
I have a breadboard which i mount temporary sensors and modules on which is connected with a 40 pin breakout which i disconnect when i travel, so the RTC won't be connected at all time

User avatar
DougieLawson
Posts: 39303
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: disconnected RTC

Thu Jan 05, 2017 12:50 am

An RTC is designed to keep the system clock right when it's not connected.

When it is connected to the internet run sudo hwclock --systohc to resync the RTC to the ntp time (assuming you're running ntpd).

I've also got a script in /etc/cron.daily/adjhwc

Code: Select all

#!/bin/sh
/sbin/hwclock --adjust
which gets run at 06:25 local time every morning.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Return to “Compute Module”