Pin NTP to NICT, set Tokyo timezone; add time sync report

timesyncd now uses ntp.nict.jp (stratum 1), with the JP pool and Ubuntu
as fallback, over whichever uplink holds the default route. Timezone
moves from Asia/Yakutsk to Asia/Tokyo: same offset, right place.

Records that the RTC loses time at power-off (the cold boot came up at
June 4 until NTP synced), and the planned chrony + gpsd setup once
GNSS has a fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mikkeli
2026-10-08 09:24:33 +09:00
parent 65a5bb995f
commit 1d405a6b91
+51
View File
@@ -0,0 +1,51 @@
---
type: report
date: 2026-10-08
---
# Time Sync and Timezone
## Result
| Item | State |
|------|-------|
| Network time | `systemd-timesyncd`, primary `ntp.nict.jp` (stratum 1), synced over whichever uplink holds the default route (Ethernet / WiFi / LTE) |
| Timezone | `Asia/Tokyo` (was `Asia/Yakutsk`: same +09:00 and no DST either, but the wrong place) |
| Clock across power-off | **Not kept.** The RTC has no backup battery (see below) |
| GPS time | Not yet. Waiting on a GNSS fix (see [SIM7600 report](SIM7600-SETUP.md)) |
## RTC loses time when powered off
On the 2026-10-08 cold boot, the kernel set the system clock from `rtc0` (`nvvrs-pseq-rtc`, `hctosys=1`) to **June 4**.
Then the clock was corrected in two steps:
1. ~12 s: timesyncd stepped forward to its last saved timestamp (`/var/lib/systemd/timesync/clock`). This is close, but behind by however long the board was off.
2. ~43 s: first NTP sync corrected the rest. The kernel then writes the synced time back to the RTC, which only lasts until the next power-off.
Until step 2, timestamps are wrong, and with no uplink (in the car, out of coverage) they stay wrong. The fix is hardware:
an RTC backup battery (see [BOM](../../BOM.md#rtc-backup-battery)). `rtc1` (`tegra_rtc`) isn't used for boot time and reads 1970.
## Configuration
```
sudo timedatectl set-timezone Asia/Tokyo
```
`/etc/systemd/timesyncd.conf.d/10-servers.conf`:
```
# Japan-local primary (NICT, national time standard), global pool as backup.
[Time]
NTP=ntp.nict.jp
FallbackNTP=ntp.ubuntu.com 0.jp.pool.ntp.org 1.jp.pool.ntp.org 2.jp.pool.ntp.org
```
`sudo systemctl restart systemd-timesyncd`, then check with `timedatectl timesync-status` (server, stratum, offset).
## Later: GPS as a time source
timesyncd only speaks NTP. Once GNSS has a fix, replace it with `chrony`, configured with:
- the same NTP servers as above, which remain the default whenever any uplink exists, and
- a gpsd refclock (`refclock SHM 0`), which takes over when offline.
NMEA over the USB serial port carries no PPS signal, so GPS time alone is only good to tens of milliseconds. That is plenty for log timestamps.