I have two machines, a Rpi4 and Ubuntu PC. The two machines are offgrid and connected to their network. The idea is to sync the RPi4 time with the Ubuntu machine. The NTP aproach failed because port and firewall issues. So I used htpdate
instead. I've noticed however that I can not set the correct system time of the Rpi4. Regardless of the command I can not get rid of the offset.
I looked elsewhere on how to sync without success:
- synchronising-time-between-two-linux-machines
- how-to-sync-raspberry-pi-system-clock
- how-to-know-if-htpdate-has-synchronized-system-clock
- htpdate.8.en.html
- htpdate.php
The problem is I can not get rid of the offset. The output of my sessions are:
pi@CMPL01-003-21:~ $ sudo htpdate -qd 10.42.0.1
burst: 1 try: 1 when: 500000
10.42.0.1 80 14 Feb 2023 13:37:24 GMT (0.003) => 38
burst: 1 try: 2 when: 500000
10.42.0.1 80 14 Feb 2023 13:37:25 GMT (0.006) => 38
#: 1 mean: 38 average: 38.000
Offset 38.000 seconds
poll 1800 s
pi@CMPL01-003-21:~ $ sudo htpdate -xqd 10.42.0.1
burst: 1 try: 1 when: 500000
10.42.0.1 80 14 Feb 2023 13:39:25 GMT (0.003) => 38
burst: 1 try: 2 when: 500000
10.42.0.1 80 14 Feb 2023 13:39:26 GMT (0.003) => 38
#: 1 mean: 38 average: 38.000
Adjusting 38.000 seconds
poll 1800 s
pi@CMPL01-003-21:~ $ sudo htpdate -sd 10.42.0.1
burst: 1 try: 1 when: 500000
10.42.0.1 80 14 Feb 2023 13:40:26 GMT (0.003) => 38
burst: 1 try: 2 when: 500000
10.42.0.1 80 14 Feb 2023 13:40:27 GMT (0.005) => 38
#: 1 mean: 38 average: 38.000
Setting 38.000 seconds
Set: Tue Feb 14 14:40:27 2023
poll 1800 s
Is there a missing hidden htpdate parameter or some rules to apply to a folder maybe to clear the offset?