#De-Blacklist the RTC
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
sudo bash
echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device
exit
# Test whether Linux can see our RTC module.
sudo hwclock
# Use to see if the RTC shows on the i2c bus
sudo i2cdetect -y -a
# Set the time on the RTC
sudo hwclock --systohc
# Update config to get time from RTC on boot
sudo nano /etc/rc.local
# Add the following lines, before the "Exit"
sudo modprobe i2c-bcm2708
echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device
hwclock -s
# Check the RTC Vs Local Time (After a reboot)
sudo hwclock -r
date
No comments:
Post a Comment