RoboticsGeneral

Question) DS1307 RTC Module for Raspberry Pi

userHead Account cancelled 2017-02-16 21:55:02 1852 Views0 Replies
I bought a DFR0386 (DS1307 RTC Module for Raspberry Pi).
A DFR0386 is used for Raspberry Pi 3.

I refer to the following site.
 - dfrobot.com/wiki/index.php/Raspberry_Pi_RTC_Module_SKU:_DFR0386
 - cdn-learn.adafruit.com/downloads/pdf/adding-a-real-time-clock-to-raspberry-pi.pdf

1. sudo raspi-config => Open Raspberry Pi I2C interface
2. sudo nano /etc/modules => add "i2c-bcm2708, i2c-dev" device
3. sudo i2cdetect -y 1 => checking -0x68
4. sudo bash
4-1. modprobe i2c-dev
4-2. echo "ds1307 0x68" >/sys/class/i2c-adapter/i2c-1/new_device
5. sudo hwclock -w => write current time to RTC module
6. sudo apt-get --purge remove fake-hwclock => remove fake-hwclock
7. sudo nano /lib/udev/hwclock-set => comment out these three lines
  #if [ -e /run/systemd/system ] ; then
  # exit 0
  #fi
8. sudo nano /etc/rc.local => add two lines
  echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device
  sudo hwclock -s
  exit 0

But,,,,
If you reboot a few minutes after setting the current time, another time will be displayed.
Time synchronization doesn't work

give me advise. plz...