Log in

View Full Version : Roborio and Real Time Clock


phurley67
15-12-2016, 15:14
So from our RoboRIO image in /etc/init.d/bootmisc.sh

I see this little nugget:

# Set the system clock from hardware clock
# If the timestamp is more recent than the current time,
# use the timestamp instead.
test -x /etc/init.d/hwclock.sh && /etc/init.d/hwclock.sh start

I don't have a /etc/init.d/hwclock.sh, but I wish I did :-). It would be nice if our log files had real date/time stamps if for no other reason than to keep things organized. Is anyone currently using RTC? Also double checking that the RIO does not have one and I just need to go buy a battery or something :-)

wireties
15-12-2016, 15:19
I am not sure, ssh to the roboRio and type 'date'. If it is working the system clock is present. The relative timer in the kernel is required and sometimes, in embedded Linux systems, a virtual RTC is created using the jiffy clock to progress the time.

Joe Ross
15-12-2016, 15:29
The roboRIO does not have a battery powered RTC. However, the DS sends the time when it connects, which the roboRIO uses to set the system time. If you wait until the DS connects, you can have correct timestamps, without a RTC.

phurley67
15-12-2016, 18:37
Ahh that make sense. I have been doing all my testing with QDriverStation, which apparently does not do the time update (at least not from my Mac :-). But I remember seeing fairly accurate time data in the past -- it was actually driving me nuts.

Thanks

gerthworm
15-12-2016, 22:28
the DS sends the time when it connects, which the roboRIO uses to set the system time..

Can confirm. Had some weird timestamps on logs last year, took us waaaay too long to figure out what was going on.