Raspberry PI with Real Time Clock: Difference between revisions
Jump to navigation
Jump to search
(Created page with "== DS3231 I2C RTC chip == See https://nicegear.co.nz/blog/using-an-i2c-real-time-clock-rtc-with-a-raspberry-pi/ . Open the RPI and plugin the clock module. Plug it as shown...") |
No edit summary |
||
| (One intermediate revision by one other user not shown) | |||
| Line 1: | Line 1: | ||
[[category:Rpi]] | |||
== DS3231 I2C RTC chip == | == DS3231 I2C RTC chip == | ||
See https://nicegear.co.nz/blog/using-an-i2c-real-time-clock-rtc-with-a-raspberry-pi/ . | See https://nicegear.co.nz/blog/using-an-i2c-real-time-clock-rtc-with-a-raspberry-pi/ . | ||
| Line 6: | Line 8: | ||
https://nicegear.co.nz/obj/images/raspberry-pi-real-time-clock-rtc-ds3231-3.jpg | https://nicegear.co.nz/obj/images/raspberry-pi-real-time-clock-rtc-ds3231-3.jpg | ||
Run raspi-config and enable the Enable automatic loading of I2C kernel module. | Run raspi-config and enable the 'Enable automatic loading of I2C kernel module' option in the advanced settings. | ||
raspi-config | raspi-config | ||
Latest revision as of 02:57, 25 February 2016
DS3231 I2C RTC chip
See https://nicegear.co.nz/blog/using-an-i2c-real-time-clock-rtc-with-a-raspberry-pi/ .
Open the RPI and plugin the clock module. Plug it as shown in the image, into the inner row all the way to the end.
https://nicegear.co.nz/obj/images/raspberry-pi-real-time-clock-rtc-ds3231-3.jpg
Run raspi-config and enable the 'Enable automatic loading of I2C kernel module' option in the advanced settings.
raspi-config
Reboot
sudo reboot
sudo su # Remove the module blacklist entry so it can be loaded on boot sed -i 's/blacklist i2c-bcm2708/#blacklist i2c-bcm2708/' /etc/modprobe.d/raspi-blacklist.conf # Add the RTC device on boot sed -i 's#^exit 0$#echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device#' /etc/rc.local echo hwclock -s | tee -a /etc/rc.local echo exit 0 | tee -a /etc/rc.local reboot
These two command should show the current time now
# clock module's time hwclock # OS time date
To force updating the time of OS and clock module simply restart the ntp service:
sudo /etc/init.d/ntp restart