hasanoa
Posts: 13
Joined: Mon Jan 12, 2015 12:51 pm

Disable RTC and reinstall NTP client

Tue Sep 08, 2015 6:20 am

I want to disable RTC and reinstall ntp client (default version of the pi has ntp client) so as to getting time from the Internet...

How can i do that?

User avatar
PeterO
Posts: 5878
Joined: Sun Jul 22, 2012 4:14 pm

Re: Disable RTC and reinstall NTP client

Tue Sep 08, 2015 9:03 am

If it is set up properly you can used both RTC and NTP. Pi will use RTC at boot to set the time, then use NTP to keep the time correct while running, and save the correct time back to the RTC during shutdown.

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

hasanoa
Posts: 13
Joined: Mon Jan 12, 2015 12:51 pm

Re: Disable RTC and reinstall NTP client

Wed Sep 09, 2015 7:56 am

I'm a novice at these things.
RTC didn't work properly and NTP service stopped...

Could you please add links about using both RTC and NTP at the same time?

I applied commands as follows:
# Remove the module blacklist entry so it can be loaded on boot
sudo sed -i 's/blacklist i2c-bcm2708/#blacklist i2c-bcm2708/' /etc/modprobe.d/raspi-blacklist.conf
# Load the module now
sudo modprobe i2c-bcm2708
# Notify Linux of the Dallas RTC device
echo ds1307 0x68 | sudo tee /sys/class/i2c-adapter/i2c-1/new_device
# Test whether Linux can see our RTC module.
sudo hwclock
That's it! You can also add the i2c initialisation command to rc.local which means it will be run at every boot up;

# Add the RTC device on boot
sudo sed -i 's#^exit 0$#echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device#' /etc/rc.local
echo exit 0 | sudo tee -a /etc/rc.local



Thank you

Return to “Beginners”