Files
ZephCore/zephcore
Dan TheisenandClaude Opus 5 3d5fb9461c Fix GPS duty interval read before loadPrefs() on repeater/room server
main_repeater.cpp and main_room_server.cpp applied the GPS duty interval
~55 lines before data_store.loadPrefs() ran, so getNodePrefs()->gps_interval
still held the initNodePrefs() value of 300 s.

That 300 is the *companion* default. loadPrefs() is not a pure read on these
roles: its first-boot path is the only place the 48 h repeater/room-server
default is established, and it persists that to flash so later code can treat
flash as authoritative. A stored value is likewise only in the struct after
loadPrefs() returns. Reading gps_interval before that call therefore cannot
see either the role default or the operator's setting -- only the companion
constant.

Two consequences, on every boot:

  - A stock GPS-equipped repeater duty-cycled its GPS every 5 minutes instead
    of every 48 hours, ~576x more wakeups than intended. On battery nodes this
    is a straight power regression.

  - Any operator value never reached the hardware. "set gps duty 0" (always-on)
    persisted to flash correctly, and `get gps duty` reports the manager's
    now-effective value, so it answered 300 -- readable as a stale default
    rather than as the setting being ignored.

The GPS manager itself is correct: gps_start_acquiring(), the fix-done
callback, gps_enable() and the fresh-fix request all guard standby on
gps_duty_cycling(), so the always-on invariant holds once the manager is
actually told the interval is zero.

Same ordering class as the two bugs already documented in these files -- radio
frequency binding and the LED master switch -- where CLI readback looked right
and the hardware disagreed. main_companion.cpp has always had the correct
order (loadPrefs() at 1461, gps_set_poll_interval_sec() at 1616) and is
unaffected.

Move the interval and the mode switch that starts acquisition to just after
loadPrefs(). Callback registration stays where it was: it has no prefs
dependency and must precede acquisition.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-19 10:29:54 +00:00
..
2026-09-04 12:14:05 +02:00
2026-09-04 09:23:18 +02:00
2026-09-04 12:14:05 +02:00
2026-08-30 22:29:21 +02:00
2026-08-21 20:28:03 +02:00
2026-09-04 12:14:05 +02:00
2026-09-03 22:47:26 +02:00
2026-08-14 14:18:27 +02:00
2026-08-30 22:29:21 +02:00
2026-08-04 16:04:05 +02:00
2026-09-03 15:44:47 +02:00
2026-08-30 09:27:20 +02:00
2026-06-07 22:47:17 +02:00
2026-07-18 20:30:43 +02:00
2026-02-22 13:09:18 +01:00
2026-09-02 10:01:34 +02:00