Keep receiver timesync fast and extend sender fast window

- Receiver now sends time sync every 60s indefinitely (mains powered)
- Sender stays in fast timesync listen mode for first 60s even with RTC
This commit is contained in:
2026-02-03 22:28:36 +01:00
parent 532a9154b1
commit e7318f2e71
2 changed files with 4 additions and 5 deletions

View File

@@ -123,7 +123,7 @@ void receiver_loop() {
}
if (time_to_send_timesync()) {
time_send_timesync(self_short_id); // 60s for first 10 min, then hourly
time_send_timesync(self_short_id); // always every 60s (receiver is mains-powered)
}
mqtt_loop();
@@ -299,8 +299,10 @@ inline constexpr uint16_t EXPECTED_SENDER_IDS[NUM_SENDERS] = { 0xF19C };
- Defaults: `pool.ntp.org` and `time.nist.gov`.
## RTC (DS3231)
- Optional DS3231 on the I2C bus. Connect SDA to GPIO21 and SCL to GPIO22 (same bus as the OLED).
- Enable/disable with `ENABLE_DS3231` in `include/config.h`.
- Receiver time sync packets set the RTC.
- On boot, if no LoRa time sync has arrived yet, the sender uses the RTC time as the initial `ts_utc`.
- Receiver keeps sending time sync every 60 seconds.
## Build Environments
- `lilygo-t3-v1-6-1`: production build (debug on)