Anton TETERIN d0250eef32 * organizing /A | 1 year ago | |
---|---|---|
.. | ||
README.md | 1 year ago |
#
#
sudo nano /etc/modules
i2c-bcm2708
i2c-dev
nano /etc/modprobe.d/raspi-blacklist.conf
#
#
#
# apt install i2c-tools i2cdetect -y 1 modprobe rtc-ds1307 echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device
hwclock -r
hwclock -w
nano /etc/init.d/hwlock.sh
do
echo ds1307 0x68 >> $bus/new_device;
if [ -e /dev/rtc0 ];
then
log_action_msg "RTC found on bus `cat $bus/name`";
break; # RTC found, bail out of the loop
else
echo 0x68 >> $bus/delete_device
fi
done
}
case "$1" in
start)
# If the admin deleted the hwclock config, create a blank
# template with the defaults.
if [ -w /etc ] && [ ! -f /etc/adjtime ] && [ ! -e /etc/adjtime ]; then
printf "0.0 0 0.0\n0\nUTC" > /etc/adjtime
fi
init_rtc_device
# Raspberry Pi doesn't have udev detectable RTC
#if [ -d /run/udev ] || [ -d /dev/.udev ]; then
update-rc.d hwclock.sh enable update-rc.d fake-hwclock remove
sudo su apt-get -y remove fake-hwclock update-rc.d -f fake-hwclock remove systemctl disable fake-hwclock
Books:
Books: