OpenSprinkler Forums Hardware Questions OpenSprinkler Beagle (OSBo) NOOB needs help with RTC service Re: Re: NOOB needs help with RTC service

#25859

iDoug
Participant

Here is my addition to the /etc/rc.local file:

#	Get date-time from Internet (Write to BeagleBone Black BBB).
ntpdate -b -s -u pool.ntp.org
# Write date-time to the RTC on OpenSprinkler OSBo.
sudo hwclock -w

# Write the date-time from the OSBo to BBB.
# (Just in case the Internet is not available and the battery
# is working.)
echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device
sudo hwclock -s

exit 0

Please, let me know if you see any potential issues. This does seem to work, even on a OSBo that does not have the date-time initially.