Commit Graph
152 Commits
Author SHA1 Message Date
liquidraver 3a2f9f5a0a fix 1byte/2byte weirdnesses 2026-09-20 11:13:59 +02:00
liquidraver 946b871d46 boot reset cause: plain-English hints in the restart notice, fix nrf52840 vbus wake docs 2026-09-19 21:35:22 +02:00
Pieter ViljoenandClaude Opus 5 6ec31e7b7f capture the reset cause at boot instead of consuming it in main()
hwinfo_get_reset_cause() reads a latched register. It was read inline in
main_companion.cpp and cleared there, so the repeater, room server and
observer never read it and never cleared it: their flags carried into the next
boot, and whichever role read first defined what any later reader would see.

helpers/boot_info.c reads it once in a SYS_INIT at POST_KERNEL, logs it,
stores it and clears the register. That runs before main() on every role.
zephcore_boot_reset_cause() hands out the stored copy and reports false where
the platform has no support, which a caller can distinguish from a cause of 0.

The clear's return is discarded deliberately: ESP32 has no
hwinfo_clear_reset_cause() implementation, so the weak stub returns -ENOSYS.
The capture is still correct there; only the next boot's reading is not.

Logging in boot_info_init() rather than only in the consuming role matters
because the clear now happens everywhere. Without it a repeater that rebooted
on WATCHDOG or LOCKUP would have the evidence cleared and recorded nowhere,
where before it survived in the register for whoever read it over SWD.

main_companion.cpp reads the stored copy and renders through a table with one
row per RESET_* bit, so a cause with no label is no longer logged as bare hex.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-19 11:58:01 -07:00
liquidraver a5a67e9ea6 boot_prefs shared helper 2026-09-19 20:42:47 +02:00
liquidraver 3055ae9269 Merge pull request #90 from mepholic/fix/gps-duty-boot-ordering
Fix GPS duty interval read before loadPrefs() on repeater/room server
2026-09-19 20:15:09 +02:00
liquidraver edcc40a884 track zephyr main 3e8f38faf93: rebase patches, lora 0.9 api, nrf clock split, s3 heap, lr11xx/lr20xx dc preamble guard, usb kick loop fix 2026-09-19 16:46:14 +02:00
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
liquidraver 39b9584b20 .editorconfig and .gitattributes 2026-09-18 21:25:19 +02:00
liquidraver 1c2c942849 command reply buffer and tcp oversize fix 2026-09-17 10:59:13 +02:00
liquidraver da0450e511 upstream sync + wio tracker 1w 2026-09-16 11:29:45 +02:00
liquidraver 69cc148fbe properly reset CAD offset when needed 2026-09-10 21:56:52 +02:00
liquidraver bdf7348208 CAD offset safety net 2026-09-03 22:47:26 +02:00
liquidraver 7ae467305a transmit airtime fix 2026-09-03 19:02:51 +02:00
liquidraver 1633274e4f leds refactor/improvement 2026-09-03 14:34:12 +02:00
liquidraver 355ce04b21 numerous more cad fixes and improvements 2026-09-02 22:39:40 +02:00
liquidraver ba33cebf6a cad improvements 2026-09-01 22:05:29 +02:00
liquidraver ccb7fc748d command fixes 2026-08-30 09:27:20 +02:00
liquidraver 7331ca6c58 sync with upstream but held off the companion CLI 2026-08-29 22:08:59 +02:00
liquidraver 6258b2264c refactor CRLF de-duplicator 2026-08-28 11:11:26 +02:00
liquidraver 27ea7e41a5 flash cleaning improvements 2026-08-28 09:41:43 +02:00
liquidraver 2e3f5f3f59 display/input rotate 2026-08-25 15:19:11 +02:00
liquidraver dc5b5c2594 radio driver fixes v1 2026-08-23 22:49:17 +02:00
liquidraver 7d695872d4 implement radio.fem.rxgain 2026-08-22 17:32:41 +02:00
liquidraver 9ba23afbe2 vcontact improvements 2026-08-22 10:50:02 +02:00
liquidraver 9fc3ab7f7e PR70 fix 2026-08-20 21:13:15 +02:00
liquidraver 5c4ac21bd4 refactor patches and bump to 1.17.2 2026-08-20 17:50:48 +02:00
liquidraver 9ab9a9b950 lr2021 cleanup 2026-08-16 22:56:28 +02:00
liquidraver 4473b261ee rx path fixes, dc.restart wired in to lr chips,
TX timeout magic number is gone
2026-08-14 13:27:54 +02:00
liquidraver aac97f7ade vcontact and cad fixes 2026-08-12 15:36:51 +02:00
liquidraver ee90693c89 lr20xx: add freq-error summary log and get freqerr CLI 2026-08-12 15:12:43 +02:00
liquidraver 3494411f83 x1 debug 2026-08-10 19:15:26 +02:00
liquidraver 41cc786496 the repo is radiating seeed X1 vibes 2026-08-08 15:19:20 +02:00
liquidraver d1093bfc5e gps "fiddling" v2 and some debug log fixes 2026-08-05 11:48:33 +02:00
liquidraver 4e880df81a set leds on/off 2026-07-31 08:27:10 +02:00
liquidraver a705d5b5ce refactor / unify probes 2026-07-29 12:30:47 +02:00
liquidraver fe6e585eb6 get rid of housekeeping tick and AGC reset 2026-07-28 14:12:40 +02:00
liquidraver 13b5e2fcf3 scrub APC and bump to 1.16.6 2026-07-20 09:55:32 +02:00
liquidraver 434a49375e try to improve APC 2026-07-17 08:35:08 +02:00
liquidraver c571bae013 fix contact sync freeze on cold boot 2026-07-16 11:30:25 +02:00
liquidraver 432336867b add cad.busycap knob for hilltop repeaters 2026-07-13 10:29:50 +02:00
liquidraver 9eb33e27dc cad, meshamerica flasher and other polishes 2026-07-13 09:00:14 +02:00
liquidraver 51a807a957 vcontact polishing 2026-07-12 15:53:00 +02:00
liquidraver dc1239537e SmartCAD p1 2026-07-12 10:48:37 +02:00
liquidraver 0d70256d2e vcontact p2 2026-07-11 21:21:47 +02:00
liquidraver 0e7a9b7285 vcontact p1 2026-07-11 16:28:27 +02:00
liquidraver a03856cb34 gps cli commands fix and e-ink sats count clear 2026-07-08 09:16:47 +02:00
liquidraver 38b8ff07cf rework refresh display 2026-07-04 14:15:31 +02:00
liquidraver 74aa3810ee Merge pull request #47 from matthew73210/master
Reworked the screen pages
2026-07-04 12:51:15 +02:00
Matthew Burton d5efd3351a fixed apc text on screen 2026-07-04 07:42:10 +02:00
liquidraver 6ef03fb10e Merge branch 'master' into dev 2026-07-03 19:58:07 +02:00