At Tue, 18 Aug 2020 02:40:41 -0700 (PDT) [email protected] wrote:
> > > > Hi, > > I am using beagle Bone Black with debian image. Could any please suggest > how to automatically set the system time (on every reboot) by external RTC > module DS3231. Once internet is connected, i want to update both system > time and DS3231 with the network time. > > I am controlling a relay based on system time, my application should take > DS3231 time and run perfectly even if internet is disconnected and not > available for so many days. > > Few things i have tried, the following content has been kept in the script > and running @reboot script in crontab. The system time has been changed if > we enter this command manually after boot but not in auto start script. > Please advice. > > *echo ds3231 0x68 > /sys/class/i2c-adapter/i2c-1/new_device* > > *hwclock -r -f /dev/rtc1* Well, the simple / dumb option would be to put the above two lines in /etc/rc.local, which will restore the system clock from the RTC. The other option is to create a proper RTC service. A properly setup RTC service will restore the system clock from the RTC early in the boot process and save the system clock late in the shutdown process. > > Best regards, > > NK > -- Robert Heller -- Cell: 413-658-7953 GV: 978-633-5364 Deepwoods Software -- Custom Software Services http://www.deepsoft.com/ -- Linux Administration Services [email protected] -- Webhosting Services -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/20200818114505.C4361223A2E%40sharky4.deepsoft.com.
