diff --git a/PiRTC/install.sh b/PiRTC/install.sh new file mode 100755 index 0000000..c09277a --- /dev/null +++ b/PiRTC/install.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +# software +sudo apt-get install python-smbus i2c-tool + +# check +sudo i2cdetect -y 1 + +# config +cp /boot/config.txt /boot/config.bak +echo "" >> /boot/config.txt +echo "dtoverlay=i2c-rtc,ds3231" >> /boot/config.txt + diff --git a/PiRTC/setup.sh b/PiRTC/setup.sh new file mode 100755 index 0000000..895c48a --- /dev/null +++ b/PiRTC/setup.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +# check +sudo i2cdetect -y 1 + +# remove fake +sudo apt-get -y remove fake-hwclock +sudo update-rc.d -f fake-hwclock remove +sudo systemctl disable fake-hwclock + +# device +cp hwclock-set /lib/udev/hwclock-set + +# set +sudo hwclock -r +sudo hwclock -w +sudo hwclock -r