It appears that if BBB is not connected to internet, i can set the date and time with date command. this should take care of the issue for me. i was following steps on : https://learn.adafruit.com/adding-a-real-time-clock-to-beaglebone-black/wiring-the-rtc but that did not add the DS1307 to the system, so my plan B is writing a script to read DS1307 directly and update the system in case of no internet.
On Tuesday, October 9, 2018 at 3:09:31 PM UTC-6, Bill Fleming wrote: > > Currently we use the following to set the timezone for when the BBB is > connected to the internet, as the GUI tool doesn't work (or you don't have > GUI anyway in some cases). > This sets the US Central timezone as an example. > > cd /etc/ > sudo rm localtime > sudo ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime > ls -al|grep localtime > > Once you set that if the BBB is always online your time will automatically > be correct, at least until there is some major change to DST or something > that would require an update. > > If you disconnect from the internet then you can use the following to set > the time, we use separate time/date commands currently. > > sudo -kS date --set year-MM-DD > > sudo -kS date --set HH:MM:SS > > > Note that you have to run this on every reboot, as the BBB does not have a > battery backed RTC. > If you need that functionality, the Andice labs power cape (now back in > stock after parts shortage) has an RTC feature that can be used. > I have not tried to use the RTC battery backed feature on it myself, but I > did test the time set/get commands and they appear to work correctly. > (battery part tested and it works ok) > So then to use the battery RTC you would just need to add a time set on > bootup service. (run once type service) > > Note that to use this manual timeset when online, or use the battery > backed RTC time set software from an I2C chip, you need to go on the > command line and remove/disable the network time service. > I haven't tried that myself but one of the following should work: > > sudo timedatectl set-ntp off > sudo systemctl stop ntp.service > > > If you make a GUI tool like I did to set the time when offline, you need > to add the corresponding NTP service enable (when online) for completeness. > > Bill > > > > On Tuesday, October 9, 2018 at 1:22:06 PM UTC-5, [email protected] wrote: >> >> So as long as Beaglebone is connected to internet, there is no way to >> manually set time and date? >> By the way, i didn't see any cronjob sync time periodically, how is it >> getting sync after boot (if any)? >> >> On Tuesday, October 9, 2018 at 10:06:05 AM UTC-6, Dennis Lee Bieber wrote: >>> >>> On Tue, 9 Oct 2018 05:48:22 -0700 (PDT), >>> [email protected] declaimed the following: >>> >>> >>> >now if I run a command it says that date is changed: >>> > >>> >root@beaglebone:/etc# date --set "2018/10/2 18:20:10" >>> > >>> >Tue Oct 2 18:20:10 UTC 2018 >>> > >>> > >>> >but if if run date command again, it still shows original time >>> > >>> >root@beaglebone:/etc# date >>> > >>> >Tue Oct 9 12:42:13 UTC 2018 >>> > >>> > >>> >is there any other process for setting up time date on beaglebone? >>> >>> If you are connected to the Internet, the BBB runs an NTP >>> synchronization. >>> >>> >>> -- >>> Wulfraed Dennis Lee Bieber AF6VN >>> [email protected] HTTP://wlfraed.home.netcom.com/ >>> >>> -- 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/a7075405-617b-4daa-bab7-4529cbd1f1ad%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
