1. Sync time
The problem is to synchronize time on bbb. My device, after power on, querry time from server and set up linux time:
system( "date 061621252015.42" );
But time(NULL) results UTC time (i think). Well, the answer is set TZ variable to UTC before setup time:
setenv("TZ", "UTC", 1);
system( dateCommand.c_str() );
Well, this is working propertly.
2. Drift? time
Almost ;)
This time lags about 10 min for 1 hour.
Experiment:
1. set hwclock from sysclock
2. wait 30 minutes
Result: diff = 11 +- 2 sec
root@beaglebone:~# hwclock -u
Tue Jun 16 21:33:15 2015 0.000000 seconds
root@beaglebone:~# date
Tue Jun 16 21:33:04 UTC 2015
3. wait 55 min
Result: diff = 2:30 !!
roo
...
Читать дальше »