Commit Graph
1755 Commits
Author SHA1 Message Date
mikecarper c2998ae8d9 Preserve regulator recovery through planned resets and storage failures 2026-10-18 21:17:44 -07:00
mikecarper c4a1d485ff Add saved regulator modes and battery-gated crash recovery 2026-10-18 21:10:58 -07:00
mikecarper 9c78ccde57 Unify optional hardware variants and add runtime R8 TFT rotation 2026-10-18 20:25:13 -07:00
mikecarper 1ce3f0cdd7 Make T114 screen detection the default firmware and picker choice 2026-10-18 16:20:27 -07:00
mikecarper 22ab02caf7 Fix G3 gain transitions, slot commands and radio restore 2026-10-18 14:29:19 -07:00
mikecarper cd02e55824 Share the saved admin password across ESP32 management services
Use the committed node credential for setup WiFi, WebConfig and browser OTA. Add persistent ESP32 WiFi Companion management credentials without changing preferences layouts, revoke stale browser sessions on rotation, retain scoped save receipts, and coordinate credential changes with flash uploads. Keep external-service credentials and trusted TCP protocol compatibility independent. Update live join QR codes, failure handling and documentation.

Validated 51 native cases, 158 related host and browser methods, and serial Full V4 Companion, Station G3 Repeater, ESP32-C6 Room Server and V4 Sensor firmware builds.
2026-10-18 13:09:48 -07:00
mikecarper 6ce784bbd6 Fit all STM32 Companions with checked fractional preferences
Stage STM32 preference prefixes and checked footers in one atomic image, reject declared tails that encounter premature EOF, and share the typed CLI rollback helper. Use the proven Wio Mini code-layout flags on Wio E5 and Tiny Relay without changing features or memory boundaries. All four STM32 targets and RAK4631 Full pass at the full 1.18.0.1 release version length.
2026-10-18 09:11:51 -07:00
mikecarper 59b0ab93d0 Keep fractional timezones within constrained flash budgets
Deduplicate validation and preserve the published preference bytes and transactional saves. Correct Ikoka Handheld Companion flash bounds and document QSPI Room migration. Qualify STM32 and RAK4631 at the full 1.18.0.1 release version length.
2026-10-18 08:46:20 -07:00
mikecarper 7088096abf Merge upstream dev through 428a95c64
Integrate fractional Companion timezones and conditional Bluetooth pages while preserving the existing preference byte layout, transactional saves, and Full transport selector. Add migration, rollback, invalid-value, and UI profile regressions.
2026-10-18 08:30:50 -07:00
mikecarper 48bad8ddfb Reduce room board recovery stack use under sustained reads 2026-10-18 00:00:47 -07:00
mikecarper f88b9e65ed Expose broker acknowledgment diagnostics on Full Companion 2026-10-17 23:54:15 -07:00
mikecarper 68f45e5cf5 Fix room browser stack overflow and bound response bodies 2026-10-17 23:31:24 -07:00
mikecarper 040182e8ec Merge remote-tracking branch 'origin/pr-21' into codex/integrate-open-prs-17-21 2026-10-17 21:13:27 -07:00
mikecarper 69a15f0fa1 Merge remote-tracking branch 'origin/pr-20' into codex/integrate-open-prs-17-21 2026-10-17 21:13:27 -07:00
mikecarper 24653842e8 Merge remote-tracking branch 'origin/pr-18' into codex/integrate-open-prs-17-21 2026-10-17 21:13:27 -07:00
nullrouten0andClaude Opus 5.5 618c18d385 Keep whole contact records ahead of a partial trailing record
Upstream MeshCore, and this fork up to v1.17.1.6 except ESP32 Full
builds, rewrote /contacts3 in place, one record after another. A reset
or a full volume during that save leaves whole records followed by part
of the next one. Upstream reads such a file up to the short read. Here
readableContactFile() treats any size that is not a multiple of 152
bytes as unreadable, and since 2311160a9 the bounded recovery then
deletes /contacts3. On the first boot after an upgrade, three whole
records plus one stray byte became zero contacts.

Invariant: on ESP32, RP2040 and STM32, when /contacts3 holds at least
one whole record followed by part of one, and /contacts3.bak does not
exist, the whole records load and nothing is written or deleted at
boot. The next ordinary save publishes only whole records through the
existing transaction. Unchanged: whole-record images; a backup still
wins over an incomplete primary, including a backup that is unreadable
or of unknown presence at boot, which keeps its retry at the recovery
boundary; read errors keep the bounded recovery; a file with no whole
record is still discarded; nRF52 is not touched.

selectContactFile() makes this check only after the strict checks of
both names fail, through a new partial_tail mode of
readableContactFile(). loadContacts() drops its own size check; its
whole-record loop bound already stops before the tail.

Add test_companion_contact_partial_tail.py, which runs the real load,
recovery and save paths on the uncached ESP32, RP2040 and STM32
harness and on the ESP32 Full cache harness under ASan/UBSan. On the
old code all four fail with zero contacts and /contacts3 deleted. It
catches 14 of 15 mutations of this change, including a full revert;
the other drops a guard whose value is read only when the file handle
is valid. Two cases in the uncached storage fixture used a one-byte
truncation as their unreadable image; they now use a file shorter than
one record, so they still exercise the discard path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 03:57:09 +00:00
nullrouten0andClaude Opus 5.5 a6f49e2b63 Limit wrong passwords on the room browser
POST /api/room checked the room password on every request with no failure
limit, and a browser may send a new identity token each time. Any host that
reached WebConfig could guess the room admin password, which is also the
radio and /api/login admin password, at main-loop speed.

One budget now covers all browser tokens, with /api/login's numbers: at most
five distinct wrong passwords in each thirty-second window. After that, a
request carrying a password is refused without checking it until the window
ends. Wrong passwords count in read-only rooms too. Empty passwords are never
counted or refused, so public read-only access keeps working. The last four
wrong passwords are remembered by 8-byte SHA-256 digest and not counted
again, so a tab still polling with an old or mistyped password cannot use up
the budget. Successful sign-ins do not refund failures. Radio login is
unchanged.

test_room_web_service.py gains PASSWORD_LIMIT, which runs the real
processRoomRequest: refusal after five failures from five tokens; identical
replies for wrong, guest and admin passwords while refused, with no password
check (calls to authorizeRoomLogin are counted); no lock extension from 300
refused requests; the 29999/30000 ms boundary and the first window after
boot; read-only and empty-password cases; no refund on success; repeated,
rotating and read-only stale passwords; slow distinct failures ageing out;
and a guard that the digest ring stays in bounds. It fails on the previous
processRoomRequest at the sixth guess.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 03:57:09 +00:00
nullrouten0andClaude Opus 5.5 09435b049d Use the node's admin password for the migration bridge AP
The Wi-Fi, LoRa first-stage and Partition Expander bridges serve an
unauthenticated /update behind an AP whose password was fixed and published,
so anyone in range during a migration could upload firmware while the private
key is staged. Use the old node's saved admin password as the WPA2
passphrase, read from /com_prefs or /node_prefs at offset 56 as the firmware
loads it. The operator already used that password to start the old updater.

Fall back to the published password, with a serial warning, when the saved
admin password is missing, unreadable, shorter than 8 characters or not
printable ASCII, so no node becomes unreachable. The legacy filesystem is
mounted without formatting and the password is never printed. Migration
admission, flash sequencing, /update gating and the USB bridge are unchanged.
Update both guides and the package README.

Add a sanitizer-backed host test that compiles the bridge's actual Wi-Fi
block against fake SPIFFS and WiFi: both boots, file precedence, WPA2 length
and terminator bounds, printable characters, stock 1.10/1.11 file sizes,
truncated fields, and mount, seek and partial-read failures. It fails 8 of 8
on the previous code and catches 27 of 27 code mutations. Verified 13 related
host test files and the esp32_s3_4mb_partition_migrator build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 03:57:09 +00:00
nullrouten0andClaude Opus 5.5 6b61e28404 Keep guest-password room logins out of the durable replay store
On a room server the guest password grants Read/Write, which the login
replay store treats as a role that needs a durable record. Every new
guest-password identity therefore took one of the 128 permanent slots,
and once they were used up the store failed closed for every new
identity, including a new administrator device, until the filesystem was
erased. Rooms often publish the guest password.

A guest-password Read/Write session (one without explicitly assigned
permissions) now uses the policy public readers already use: it must
beat its in-boot timestamp and any record the identity already has,
which is still advanced, but it never creates a new record.
Administrator logins and explicitly assigned roles keep the durable
reservation and still fail closed on a full store.

Tests: test_room_login_replay_capacity.py runs the real room login
handler against the real ClientACL replay store with ASan/UBSan: guest
churn cannot lock out a new admin or assigned writer, a former admin's
record still binds guest-password logins, and a store full of privileged
records still refuses a new admin. It fails 2 of 3 on the previous code.
Two expectations in test_room_login_integration.py and the login profile
contract follow the new policy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 03:57:09 +00:00
mikecarper 55f67f9062 Fit Mini Repeater with approved optional service cuts 2026-10-17 19:35:05 -07:00
mikecarper ff548d2481 Expose read-only RX power-saving diagnostics through framed CLI 2026-10-17 15:56:43 -07:00
mikecarper f1d281a766 Allow safe nRF52 MCU idle between radio2 scan deadlines 2026-10-17 13:21:05 -07:00
mikecarper 2fb4d2e793 Preserve millisecond power-saving deadlines across roles 2026-10-17 11:21:48 -07:00
mikecarper 55354c7fbe Keep sub-second RS232 standby interrupt-idle eligible 2026-10-17 11:03:43 -07:00
mikecarper dd7a10f9aa Sleep between noise-floor samples and reduce idle refreshes 2026-10-17 10:18:14 -07:00
mikecarper 8a5f735bba Reuse active Sensor tracker wake deadlines 2026-10-17 02:25:37 -07:00
mikecarper 629557fcfe Fix nRF52 idle sleep event and CryptoCell handling 2026-10-17 02:22:26 -07:00
mikecarper 756d887bad Add on-demand power-saving diagnostics 2026-10-17 01:15:54 -07:00
Liam Cottle 428a95c643 Merge pull request #3606 from amdoolittle/feature/ble-conditional-display
Remove BLE screen when BLE not available
2026-10-17 15:38:18 +13:00
liamcottle 0e63c183a8 tz_offset should be treated as float when down casting calculation result to int32 2026-10-17 15:22:46 +13:00
liamcottle 7a0fde2912 timezone offset is now stored as float to allow half hour offsets 2026-10-17 15:16:38 +13:00
mikecarper 4348fdcc56 Keep UI startup and rescue windows closed after observed expiry 2026-10-16 19:00:45 -07:00
mikecarper 8e13fccdd1 Retire expired tracker awake leases before foreground deferrals 2026-10-16 18:37:24 -07:00
mikecarper eda70c832b Format infrastructure startup version labels without allocating 2026-10-16 18:27:08 -07:00
mikecarper a24f9d5ef8 Keep sensor UI polling and refresh working across uptime rollover 2026-10-16 17:56:45 -07:00
amdoolittle 6e1f474f7d Update UITask.cpp
Housekeeping: removed unnecessary space
2026-10-16 17:30:19 -07:00
mikecarper 9684e410e3 Keep RGB Companion status timing working across rollover 2026-10-16 17:21:44 -07:00
mikecarper ec2bf83882 Keep Companion backlight button polling working across rollover 2026-10-16 17:04:33 -07:00
mikecarper b483a917f6 Keep monochrome Companion LED timing working across rollover 2026-10-16 16:54:08 -07:00
mikecarper eec1caa170 Keep Companion sensor polling running across timer rollover 2026-10-16 16:43:54 -07:00
mikecarper 4c3a5691e1 Keep Companion UI deadlines working across rollover and long idle 2026-10-16 16:28:58 -07:00
mikecarper 9b4d3350df Drive every RGB LED channel for Companion notifications 2026-10-16 15:50:38 -07:00
mikecarper 4b81a9d5e0 Persist unchanged Companion channel route SETs before OK
Require a real raw-table save for same-value channel SETs. This repairs the false acknowledgement after successful constructor recovery of an older backup followed by a failed candidate write.

Keep resolved alias keys, raw AUTO policy and runtime generation untouched. Preserve GET and unchanged contact behavior, changed-policy validation and indeterminate-publication quarantine.

Cover real stale-backup creation, failure/retry, reboot and exact old-skip controls. Add actual alias/BaseChatMesh and raw app-key regression tests on all four backends. Verified 117 related host tests, 16 final caller rechecks, four firmware qualifications and linked nRF52 crypto checks.
2026-10-16 11:34:51 -07:00
mikecarper 24b1264a0e Fence Companion channel writes after uncertain publication
Latch only channel storage on Indeterminate writer outcomes, including failed transaction setup. Preserve ordinary failure retries, confirmed rollback, contacts and the live accepted channel keys.

Exercise actual CLI and binary callers with all four storage backends, reboot behavior and exact missing-latch negative controls. Share TX storage failure diagnostics to retain the strict Wio-E5 Mini flash gate.

Verified 103 related host tests, four platform firmware qualifications and linked nRF52 crypto/stack checks. A separate stale-backup constructor/no-op acknowledgement case remains under audit.
2026-10-16 11:22:36 -07:00
mikecarper 508dd23673 Keep channel faults from disabling healthy Companion contacts 2026-10-16 10:59:11 -07:00
amdoolittle b9c328a882 Remove BLE screen when BLE not available 2026-10-16 10:04:44 -07:00
mikecarper e5706bafa1 Restart contact streams after storage recovery
Release cached path snapshots before resetting contacts while retaining the requesting transport and table revision for a complete stream restart. Keep explicit session cancellation unchanged and avoid copying uncached contact buffers.

Cover cached and uncached recovery, transport isolation, empty reloads, backpressure, and the former cancellation as a negative control.
2026-10-16 09:11:19 -07:00
mikecarper 587700a36a Preserve accepted contacts after transient path read errors
Recheck cached immutable paths before resetting the live table after raw I/O failure. Keep accepted RAM mutations, current jobs and save deadlines when reads recover; stronger source or publication uncertainty still forces full recovery. Use the existing recovery byte and a fixed scratch buffer, with no cache allocation or eviction.

Cover full-cache transient recovery, persistent I/O and checksum failures, nRF unread-scope restoration, active ESP jobs, real uncertain publication and unchanged lazy deadlines with sanitizer tests and restored-reset negative controls.
2026-10-16 08:54:12 -07:00
mikecarper b393737593 Preserve contacts when source discovery is unknown
Do not classify legacy or page-name stat errors as unread payloads. Keep candidate contact files unchanged, retry source selection, and use bounded volatile operation if authority remains unknown. Cover legacy absence, downgrade leftovers, cleanup-time metadata recovery and persistent faults with actual-source sanitizer tests and restored-bug negative controls.
2026-10-16 08:38:26 -07:00
mikecarper 54a5137032 Recover unreadable contacts without stranding Companions
Verify fallback namespace moves before accepting publication or rollback. Reload readable contact images at a safe host boundary, discard only unreadable contact data after bounded retries, and permit volatile operation when storage cannot recover. Preserve unrelated stores and fail explicit durability requests truthfully.

Keep existing flash, RAM, OTA and capability limits by streaming nRF52 preferences through the validated wire table and sharing identical contact deadline resets. Add fault-injection, sanitizer, legacy-image parity and CLI lifecycle regressions.
2026-10-16 08:28:45 -07:00