Commit Graph
1285 Commits
Author SHA1 Message Date
mikecarper f5afc73d6d Keep get radio reply compatible with Companion apps 2026-09-28 15:47:24 -07:00
mikecarper e900526c3f Classify held DM count as a read-only CLI query 2026-09-28 14:15:39 -07:00
mikecarper 898cadae2c Share high-contact RAK offline queue with held one-key DMs 2026-09-28 12:47:12 -07:00
mikecarper eaf19c3638 Port consent-gated one-key DM queue to keymindCascade 2026-09-28 12:09:05 -07:00
mikecarper fd7b93c52d Link ESP32 picker to exact partition expansion packages 2026-09-27 21:13:25 -07:00
mikecarper ba2187db2c Revert adaptive RAK app-owned bootloader recovery after ACL test 2026-09-27 15:07:29 -07:00
mikecarper ec86d96039 Use application capabilities for adaptive RAK recovery status 2026-09-27 13:21:40 -07:00
mikecarper 3d984bfe8b Show live ESP32 partition check in migration guidance 2026-09-27 12:57:12 -07:00
mikecarper 6c3e52c923 Document ESP32 partition migration in picker and catalogs 2026-09-27 12:53:13 -07:00
mikecarper ed3c1ec75c Align STM32WL size test with four qualified USB images 2026-09-27 10:33:13 -07:00
mikecarper 4db7780ba7 Prepare 1.17.1.7 Cascade release catalogs and STM32WL USB images 2026-09-27 10:20:43 -07:00
mikecarper abaedd3894 Add application-owned RAK bootloader recovery over LoRa 2026-09-26 23:47:44 -07:00
mikecarper 5480b36b56 Refresh CLI test contracts for backup and retry controls 2026-09-26 22:50:54 -07:00
mikecarper 8ae82a5e2f Update Companion session harness for private-key backup state 2026-09-26 22:36:54 -07:00
mikecarper 45fe38ff97 Merge upstream dev into keymindCascade 2026-09-26 22:01:28 -07:00
mikecarper 709a6fa735 Precompute ESP32 release partition lookup table 2026-09-26 19:58:28 -07:00
agessaman 99a4b6fad0 fix(mqtt): count failed starts and ignore bounced sessions in cf
connect()/reconnect() returning an error started no attempt, so no event
arrived and the failure went uncounted -- the low-heap case the counter exists
for. Counted now in a bridge-task-only start_failures, summed into cf: and
mqtt_connect_failures.

A renewal or corrected-clock bounce whose softDisconnect() times out gets its
old session's DISCONNECTED after the new attempt raised the flag. That session
is still marked connected until the handler runs, so the gate now also
requires !connected. An ignored late CONNECTED clears the flag too.

cf: no longer depends on dc being non-zero. Comments corrected for the
PSRAM-fallback stack cost and heap_largest's sampling point; the worst-case
test now models 6 slots.
2026-09-26 12:25:53 -07:00
agessaman 2f6d139729 fix(mqtt): count connect failures from a flag set before the attempt
The Starting-state gate raced the event task: client_state becomes Starting
only after connect()/reconnect() returns, so a fast failure could deliver
DISCONNECTED first and go uncounted, while a deliberate stop of an attempt in
flight was counted as a failure. A per-slot flag is now raised before the call
and cleared by onConnect, a failed start, or stopSlotClient().

Also stops zero-valued connect_failures/slots_breaker from creating an empty
stats object.
2026-09-26 11:53:54 -07:00
agessaman 3230fb6afc feat(mqtt): count connect failures and report tripped breakers
Two gaps remained after the first connection-health commit.

A slot retrying into a heap that cannot satisfy its TLS allocation moved no
counter at all. disconnect_count rose, but it also rises for dropped live
sessions, so it could not separate "actively failing to connect" from "was
connected, dropped once". Adds a per-slot connect_failures, incremented in
onDisconnect when the event arrives while the client is Starting -- meaning
it ended an attempt that never reached onConnect. Late events from a stopped
or quarantined client, and soft-disconnects of a live session, are in other
states and are not miscounted.

A slot parked by the circuit breaker also looked identical to one still
retrying, despite being materially worse: the breaker only probes every 30
minutes, so recovery is far slower and an operator may need to intervene.

Surfaces both:
- `mqttN.diag` gains `cf:<n>` beside the existing `dc:<n>`.
- the status payload gains `mqtt_connect_failures` (summed across slots) and
  `mqtt_slots_breaker` (count of tripped slots), each emitted only when
  non-zero so a healthy board's payload does not grow.

The counter is what distinguishes a retrying slot from a quiet one: while a
slot is down its publish counters cannot move by definition, so this is the
only value that shows the device is still trying.

Both suggested by adversarial review.
2026-09-26 11:10:13 -07:00
agessaman 9512a68953 fix(mqtt): size the status buffer for real field maxima
The worst-case test added with the connection-health fields did not model
production maxima -- it used a 28-byte model and a 24-byte firmware string,
while MQTTBridge permits _origin[32], _device_id[65], _board_model[64],
_firmware_version[64] and derives a 63-byte client version. isValidName()
rejects [ ] / \ : , ? * but permits '"', so a 31-character node name of
quotes is legal and every quote escapes to two bytes.

Measured at those real maxima:

  without connection-health fields   762 bytes
  with connection-health fields      851 bytes
  buffer                             768 bytes

So the 768-byte buffer already had only six bytes of headroom before this
work, and the four new fields overflow it. Overflow is silent:
serializeComplete() returns 0 and clears the buffer, and the bridge
publishes only a positive length, so a device would simply stop publishing
status with no error anywhere -- the same blindness the connection-health
fields exist to remove.

Raises STATUS_JSON_BUFFER_SIZE to 1024 and corrects the test to use the
actual maxima. Status serializes into the shared 2048-byte publish scratch
buffer, so this costs no extra RAM; only the PSRAM-allocation-failed stack
fallback grows by 256 bytes. A static_assert keeps the status ceiling within
the shared buffer.

Found by adversarial review of the preceding commit.
2026-09-26 11:09:21 -07:00
agessaman 2c60fee9d5 feat(mqtt): report slot connection health so an outage is visible
A slot that cannot establish TLS reported nothing. The per-slot counters
track publish successes and failures, and a slot that never connects never
attempts a publish -- so its ok count freezes and its error count stays at
zero for the entire outage. Observed on hardware: a slot sat dead for over
five hours while `sN=` showed 0 errors and the published status payload
carried no indication at all.

Two surfaces gain the missing signal:

- `get mqtt.stats` gains `down=<n>` (omitted when zero, like `filt=`) and
  marks each disconnected slot with a trailing `!`. The marker goes after
  the counts so existing "s(\d)=(\d+)/(\d+)" parsers keep matching.
- The published status payload gains `mqtt_slots_up`, `mqtt_slots_total`,
  `heap_largest`, and `mqtt_outage_secs`. These ride on every healthy slot's
  status message, because the slot that is down cannot report itself.

`mqtt_slots_up < mqtt_slots_total` is the condition to alert on.
`mqtt_outage_secs` is detail: it is present only when the outage has a known
start, so its absence does not imply health -- a slot that has never
connected since boot has no outage start time.

`heap_largest` is included because free heap alone does not predict a failed
connection. A slot needs one contiguous 16,384-byte block for its TLS record
buffers; measured immediately before an attempt this value predicted the
outcome in every observed case, while total free heap was 85 KB throughout a
multi-hour outage. A low value with every slot up is normal rather than a
fault -- established sessions already hold their buffers.

Publish-error semantics are unchanged: connect failures are not folded into
them.

Adds host coverage for the new fields, for the outage key's presence rule,
and for worst-case payload size. That last one matters because
serializeComplete() returns 0 and clears the buffer on overflow and the
bridge publishes only a positive length, so exceeding the 768-byte status
buffer would silently stop status publication -- the same blindness this
change exists to remove.
2026-09-26 11:05:40 -07:00
agessamanandACETyr f9df11f33e fix(mqtt): omit SNR/RSSI instead of publishing placeholder values
The reconstruction-less fallback path in buildPacketJSON (queued packet
with no captured raw frame that cannot be re-serialized) published
fabricated SNR 12.5 / RSSI -65 that consumers could not distinguish
from real radio readings. It now passes NAN / MQTT_RSSI_UNKNOWN, and
buildPacketMessage omits the SNR/RSSI keys entirely when no measurement
exists, mirroring the existing score omission.

Ports the fix from ACETyr's PR #13 (0a037040) on mqtt-bridge-implementation.

Co-Authored-By: ACETyr <35745290+ACETyr@users.noreply.github.com>
2026-09-26 10:46:11 -07:00
mikecarper 49d4cc3f3e Expose Companion flood retry controls and clarify T096 fixed TX PA 2026-09-26 10:31:54 -07:00
mikecarper eaf00755c0 Guard T096 transmit default and retry setting persistence 2026-09-26 10:12:52 -07:00
mikecarper 03e552e175 Enable LoRa OTA room and nRF52 sensor variants 2026-09-26 09:58:43 -07:00
mikecarper f46368226e Publish one ordinary ESP32 Full image per board role 2026-09-26 09:29:18 -07:00
mikecarper 4bd31358fc Keep G2 migration Full images out of ordinary release matrix 2026-09-26 08:59:29 -07:00
mikecarper d1463efa36 Refresh CI contracts for manual radio pages and build wrapper 2026-09-26 08:11:12 -07:00
mikecarper 20efcea770 Restore Companion text terminal after USB mOTA sender exits 2026-09-25 17:51:38 -07:00
mikecarper 7bbb7947ba Replay initial nRF52 USB READY after application handoff 2026-09-25 17:44:15 -07:00
mikecarper 284a67b9ec Drain companion queue on explicit OTA entry 2026-09-25 12:06:18 -07:00
mikecarper b84da21417 Describe local adaptive OTAFIX requirement in release metadata 2026-09-25 10:37:10 -07:00
mikecarper fca10471c3 Unify RAK repeater storage firmware and bootloader handoff 2026-09-25 10:35:04 -07:00
mikecarper 0500cb3720 Stabilize nRF52 Bluefruit startup for buttonless DFU 2026-09-25 08:33:54 -07:00
mikecarper 4362acf00b Bound nRF52 UF2 images and reduce repeater BLE DFU memory 2026-09-25 08:09:38 -07:00
mikecarper 51ed608951 Fix logging matrix firmware build failures 2026-09-25 00:37:38 -07:00
mikecarper 35c9a2aa00 Keep R8 power test board aligned with shutdown hook 2026-09-24 19:38:47 -07:00
mikecarper 8bb6fb2150 Exercise Companion power-off dispatch in host harness 2026-09-24 19:36:19 -07:00
mikecarper b772e10be4 Check G3 wake flags in shared board profile 2026-09-24 19:26:36 -07:00
mikecarper 05c7df6f4c Cover ESP32 migration identity recovery in host tests 2026-09-24 19:17:28 -07:00
mikecarper 40a9843c24 Merge branch 'keymindCascade' of github.com:mikecarper/MeshCore into keymindCascade
# Conflicts:
#	test/test_nrf52_ble_startup.py
2026-09-24 17:36:09 -07:00
mikecarper 307e7bec02 Complete ESP32 partition expander and adaptive LoRa OTA pacing 2026-09-24 17:13:22 -07:00
mikecarper 640facd5a2 Safely hand off expanded ESP32 LoRa bridge without resume record 2026-09-24 12:17:49 -07:00
mikecarper c0ef07a968 Add LoRa partition migration recipes for ESP32 infrastructure boards 2026-09-24 10:40:32 -07:00
mikecarper e7f6d529a0 Expand ESP32 OTA partition migration across infrastructure roles 2026-09-24 10:01:14 -07:00
mikecarper d68601b358 Add ESP32 migration build menu and verified release bundle 2026-09-24 08:02:31 -07:00
mikecarper 1e8ef78a2e Merge observer firmware branch into keymindCascade
Integrate compatible observer board, preset, WebConfig, display, CI, and policy updates. Preserve the checkout's newer MQTT binary preferences and WiFi bridge runtime where the forked implementations conflict. Keep ThinkNode observer networking WiFi-based until the Ethernet transport is wired into that runtime.
2026-09-24 01:20:56 -07:00
mikecarper 30203cd6e5 Fix nRF52 BLE startup host harness for device name state 2026-09-24 00:39:19 -07:00
mikecarper 8d4716be5b Add repeatable ESP32 partition migration build recipe 2026-09-24 00:26:46 -07:00
mikecarper 1bc900c33e Select registered OTA slots and verify LoRa staging geometry 2026-09-23 23:33:29 -07:00