On Wednesday, 15 July 2020 16:29:55 UTC+3, jaka.k...@gmail.com wrote: > > Current Beaglebone Black images offer support for high resolution timers > in Linux kernel. They are controlled by ktime.h library and depend on > system's clocks (CLOCK_MONOTONIC, CLOCK_REALTIME,...). The clocks can be > looked up from userspace programs with commands clock_gettime > <https://linux.die.net/man/2/clock_gettime>, clock_settime and > clock_getres from time.h library. > What I would like to do is make/write a protocol in c that would > synchronize realtime clocks between two boards over ethernet cable > connection or internet. My goal is testing how accurately two clocks can be > set to the same global time under different protocols. I'm planning to > start with ntp, would using an existing library or client make sense here? > I read BBB sometimes comes with daemons for ntp, in that case how would I > set one board to act as a server in protocol? >
Note that the Beaglebone Debian images use a small systemd service called systemd-timesyncd to set the system RTC. This service queries current time via SNTP (on boot, and periodically while the system is running) and updates /dev/rtc0 with the received time. Perhaps you can get started with that simple, out-of-box feature? https://wiki.archlinux.org/index.php/systemd-timesyncd https://www.freedesktop.org/software/systemd/man/systemd-timesyncd.service.html -- Kind regards, Tarmo Kuuse -- 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 beagleboard+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/f6e9aae0-eff2-4b88-ba30-44f79d428a0do%40googlegroups.com.