Commit Graph
216 Commits
Author SHA1 Message Date
mikecarper b8f438d6ea Honor retry settings across firmware roles 2026-07-13 15:22:36 -07:00
mikecarper 4f839d3477 Reduce background polling and radio power use 2026-07-13 14:36:34 -07:00
mikecarper b9e7e416be Harden retry, region, radio, and alert logic 2026-07-13 13:18:49 -07:00
mikecarper 5a2aa592ea Improve repeater alerts and delivery reliability 2026-07-13 09:54:16 -07:00
mikecarper da00a00436 Improve repeater reliability and build tooling 2026-07-13 01:03:27 -07:00
mikecarper 73c6472d95 Harden flood retry airtime handling 2026-07-11 23:51:14 -07:00
mikecarper 927d7869ff Treat flood retry prefixes as bridge bucket seven 2026-07-11 23:11:25 -07:00
mikecarper 7d6bd44082 Match retry prefixes across path hash widths 2026-07-11 23:00:05 -07:00
mikecarper 0ede4e2066 Merge RX duty-cycle power saving into keymindCascade 2026-07-11 22:12:20 -07:00
mikecarper 4f8f36354e Restore Keymind features after LoRa OTA merge 2026-07-11 12:45:02 -07:00
mikecarper 4c0dbe707d Merge PR 2864 LoRa OTA into Keymind 2026-07-11 12:40:31 -07:00
agessaman b88dc02b66 Merge mcarper/keymindCascade into mqtt-observer-plus
Integrates Mike Carper's transmission-reliability work (direct retries with
SNR-adaptive backoff and CR, flood retry controls, alt-path replies, flood
channel gates) plus its upstream/dev base (as of 2026-07-06) on top of the
observer stack. The flex branch is untouched; this branch is the experimental
integration line.

Conflict-resolution decisions, for future re-syncs (git rerere is enabled and
has recorded these):
- NodePrefs adopts keymind/upstream member order + retry/flood tail. Member
  order is in-memory only: /com_prefs stays field-by-field with the same
  canonical file order both sides already share through offset 294; keymind
  appends the retry tail at 295+ (new canonical size 676). Flex fleet files
  load unchanged; retry fields default via direct_retry_prefs_magic.
- loadPrefsInt keeps the fork's legacy MQTT-gap recovery but moves its
  detection boundary from 'extra > 5' to 'extra > LEGACY_MQTT_GAP_3SLOT (864)'
  so keymind-size tails take the normal read path. COM_PREFS_TAIL_BYTES
  retired.
- Dispatcher/RadioLibWrappers: fork watchdog additions + keymind TX overrides
  and CAD busy counter are unioned; RxReservePacketManager::queueOutbound
  follows upstream's new bool return (false when shedding).
- CommonCLI: fork observer dispatch + versioned /mqtt_prefs machinery kept;
  keymind CLI (retry/flood/radioat) taken; duplicate CAD/FEM handlers and
  sanitise lines deduped (kept keymind placements to minimize future diff).
- MyMesh (repeater/room): fork alerter/OTA/observer wiring kept; keymind
  scheduled-radio system replaces the old pending_* temp-radio members;
  applySavedRadioParams() replaces raw setParams at startup.
- ESP32Board: fork manifest-OTA + keymind powerOff/deepSleep and stopOTAUpdate
  unioned; startOTAUpdate keeps fork's STA-aware IP with keymind's idempotency
  guard.
- build.sh taken wholesale from keymind (fleet builds use GH Actions).

Verified: Heltec_v3_repeater_observer_mqtt, Heltec_v3_repeater,
heltec_v4_repeater_observer_mqtt, Heltec_v3_room_server_observer_mqtt build;
host migration harness (13 MQTT + non-MQTT scenarios) passes with updated
expectations (676-byte /com_prefs; odd-size files normalize on save, not
load); native unit tests 13/13.
2026-07-09 23:10:41 -07:00
agessaman 1d52161332 Merge branch 'restore/upstream-duty-cycle' into restore/fem-rxgain 2026-07-09 17:54:45 -07:00
agessaman 1c9c6292e5 fix(mqtt): shed retransmissions, not capture, when duty cycle starves the pool
Load-testing the restored token bucket at 'set dutycycle 1' showed MQTT
capture dropping to exactly the TX rate. Queued retransmissions hold static-
pool packets with no expiry, so throttling parks the whole pool in the send
queue; Dispatcher::checkRecv() then discards received packets before logRx()
ever feeds the bridge — each completed TX frees exactly one packet for
exactly one more RX.

Observer builds now use RxReservePacketManager (fork-owned header): once the
free pool drops below a quarter of the pool, outbound packets are refused and
freed, so RX allocation and MQTT capture continue at full rate while the node
sheds repeat load it has no TX budget for anyway. Non-observer builds keep
upstream pool behavior via the same factory; StaticPoolPacketManager stays
byte-identical to upstream.
2026-07-09 17:54:38 -07:00
Jarosław Domański 415faea52f Added RX duty-cycle noise floor calibration again (this time it works!) 2026-07-09 22:23:56 +02:00
agessaman e905451dce feat(radio): drive LoRa FEM RX gain from radio_fem_rxgain (heltec_v4)
Completes the FEM RX-gain restoration begun in the CAD/prefs change, which
persisted radio_fem_rxgain but didn't yet drive the hardware. Also dropped
by the 22eb9b87 revert; restored to match upstream.

- MainBoard: setLoRaFemLnaEnabled()/canControlLoRaFemLna()/isLoRaFemLnaEnabled()
  virtuals (default: can't control — non-FEM boards report unsupported)
- heltec_v4: board overrides driving loRaFEMControl; LoRaFEMControl gains the
  isLNAEnabled() getter (it already tracked lna_enabled and drove the FEM)
- CLI: `set radio.fem.rxgain on/off` / `get radio.fem.rxgain` (guarded by
  canControlLoRaFemLna, so it reports "unsupported" on non-FEM boards)
- app startup applies the persisted pref: board.setLoRaFemLnaEnabled(
  _prefs.radio_fem_rxgain), beside setRxBoostedGainMode

Default is ON (upstream), so on FEM boards the LNA is enabled after upgrade —
a real reception behavior change to confirm on hardware. The other FEM
variants (heltec_t096/tower_v2/tracker_v2) need the same small board-override
addition; until then `radio.fem.rxgain` reports unsupported there (no
regression — status quo).

Builds: heltec_v4 repeater-observer + room-observer (FEM board), Heltec_v3
repeater (non-FEM, base virtuals no-op). NEEDS on-device validation on a
Heltec V4.
2026-07-09 11:20:07 -07:00
agessaman df90673d18 feat(radio): restore CAD support + radio_fem_rxgain persistence (upstream parity)
Continues restoring features dropped by the 22eb9b87 revert. Both were
upstream-tested code, not intentional fork removals.

CAD (hardware Channel Activity Detection / listen-before-talk before TX),
fully restored and functional:
- NodePrefs.cad_enabled + `set cad on/off` / `get cad` CLI (default off)
- RadioLibWrapper: _cad_enabled + setCADEnabled() + the scanChannel()/CAD
  branch in isChannelActive() (Phase 1 already restored the Dispatcher hook)
- getCADEnabled() overrides in the repeater/room/sensor apps (return the
  pref) and companion (always on, matching upstream)

radio_fem_rxgain: the NodePrefs field + /com_prefs persistence are restored
here at upstream's exact offsets (293 fem, 294 cad), which makes /com_prefs
byte-identical to upstream through the tail. The field is persisted and
defaults on (upstream default), but the per-board LNA *driving* + the
`radio.fem.rxgain` CLI are deferred to the FEM-hardware change (they depend
on board methods and want per-board bench testing).

The new-format /com_prefs tail grows from 3 to 5 bytes; the old-format
detection threshold and the host migration harness are updated accordingly
(all scenarios pass, incl. the non-MQTT-build variant).

Builds: Heltec_v3 repeater, repeater-observer, room-observer. (sensor /
plain-room / companion fail only on the pre-existing Timezone.h include
issue, unrelated to these changes.)
2026-07-09 11:12:57 -07:00
Jarosław Domański a1330facff Improved RX duty-cycle watchdog observation with esp32 sleep in mind 2026-07-09 14:39:20 +02:00
Jarosław Domański 9cbd944a29 Added RX duty-cycle watchdog recovery 2026-07-09 12:00:15 +02:00
Jarosław Domański e97f0fecc6 Added RX duty-cycle power saving support 2026-07-08 08:49:37 +02:00
mikecarper ebd7da795c Share direct retry timing defaults 2026-07-07 00:56:44 -07:00
mikecarper 0613b2dcc2 Tune repeater flood controls and retries 2026-07-07 00:47:19 -07:00
mikecarper 220d44000e Merge commit 'refs/tmp/pr2437' into keymindCascade 2026-07-06 22:53:29 -07:00
mikecarper c411e65112 Merge commit 'refs/pull/2438/head' of github.com:meshcore-dev/MeshCore into keymindCascade
# Conflicts:
#	examples/simple_repeater/MyMesh.cpp
#	examples/simple_repeater/MyMesh.h
#	examples/simple_repeater/main.cpp
2026-07-06 22:53:04 -07:00
mikecarper 9908d2b73e Add altpath replies and flood channel hop gates 2026-07-06 17:10:53 -07:00
mikecarper f747f96739 Add flood channel controls and cascade prompt details 2026-07-06 15:54:08 -07:00
mikecarper 84c166d5cc Merge remote-tracking branch 'upstream/dev' into keymindCascade
# Conflicts:
#	examples/companion_radio/ui-new/UITask.cpp
#	examples/companion_radio/ui-orig/UITask.cpp
#	examples/companion_radio/ui-tiny/UITask.cpp
#	examples/simple_repeater/MyMesh.cpp
#	src/Mesh.cpp
#	src/Mesh.h
#	src/helpers/ESP32Board.cpp
#	src/helpers/ESP32Board.h
#	src/helpers/SimpleMeshTables.h
#	variants/heltec_v3/HeltecV3Board.h
#	variants/tenstar_c3/target.h
2026-07-06 15:32:07 -07:00
Neil Alexander 0d7379520f Fix recv_pkt_region incorrect usage
The `recv_pkt_region` is set when processing a flood packet in `filterRecvFloodPacket`
but direct/non-flood packets would never pass through that function, so the pointer was
not cleared for them.

`sendFloodReply` would then later use it blindly, which meant that the response would
either inherit the region from the last flood packet, or refer to a non-initialised pointer
if no region floods had been received yet.
2026-07-02 09:28:41 +01:00
mikecarper 88fec6e512 Use keymind retry timing for direct paths 2026-06-29 12:55:58 -07:00
Valentin Kivachuk Burda 543c90119e ota: CLI commands + node/CommonCLI integration + example hooks 2026-06-29 20:24:24 +02:00
mikecarper 4d2f304f63 Tune mesh retry behavior and builds 2026-06-27 01:51:23 -07:00
mikecarper 609e393b46 Fix repeater flood text and recent paging 2026-06-26 15:06:02 -07:00
agessaman 2eb41baeda refactor(mqtt): migrate observer settings to MQTTPrefs structure
Refactored the handling of observer-related settings by moving them from
NodePrefs to a new MQTTPrefs structure. This change centralizes MQTT,
WiFi, timezone, SNMP, and alert configurations, improving code organization
and maintainability. The new structure allows for better separation of
concerns and prepares the codebase for future enhancements.
2026-06-26 08:59:48 -07:00
taco 1f9bb67400 return bool when setting rx boost 2026-06-26 07:44:01 +10:00
taco 5d0ff7fe6e remove guard on MyMesh::setRxBoostedGain() 2026-06-26 07:06:37 +10:00
mikecarper f606ae9aeb Fix repeater build artifacts and recent paging 2026-06-24 17:28:19 -07:00
mikecarper 48ac725d76 Tune keymind repeater behavior 2026-06-24 17:06:49 -07:00
Kevin Le 1976494d7b PR 1727: Added get/set cad. Added # channel busy. 2026-06-24 22:03:35 +07:00
agessaman 125ddac184 feat(ota): add partition-table signature handling for OTA updates
Implemented functionality to generate and compare partition-table
signatures during OTA updates. This enhancement ensures that the
target build's partition layout matches the device's actual layout,
improving the reliability of OTA updates and preventing issues
related to partition changes.
2026-06-23 15:38:10 -07:00
agessaman 730eb37dbd feat(ota): implement build number suffix for firmware versioning
Enhanced the firmware versioning system by appending a build number
suffix when available, allowing for better tracking of published builds.
This change improves the OTA update process by providing clearer
versioning information in the embedded firmware string.
2026-06-23 12:55:07 -07:00
agessaman c1885fcc15 feat(ota): implement deferred OTA update scheduling and handling
Added support for deferred OTA updates in the MyMesh class, allowing
the system to schedule firmware updates to occur after a confirmation
reply is sent. This change improves the user experience by ensuring
that the update process does not block the main application loop,
allowing for smoother operation during firmware updates.
2026-06-22 22:33:57 -07:00
mikecarper 4813b9eea4 Merge remote-tracking branch 'upstream/pr-2367' into keymindCascade
# Conflicts:
#	build-iotthinks.sh
#	build.sh
#	docs/cli_commands.md
#	examples/companion_radio/MyMesh.cpp
#	examples/companion_radio/main.cpp
#	examples/simple_repeater/MyMesh.cpp
#	examples/simple_repeater/MyMesh.h
#	src/helpers/CommonCLI.cpp
#	src/helpers/CommonCLI.h
#	src/helpers/ESP32Board.h
#	src/helpers/SimpleMeshTables.h
#	src/helpers/sensors/EnvironmentSensorManager.cpp
#	variants/heltec_ct62/platformio.ini
#	variants/heltec_t096/T096Board.cpp
#	variants/heltec_t096/platformio.ini
#	variants/heltec_tracker/platformio.ini
#	variants/heltec_tracker_v2/platformio.ini
#	variants/heltec_v2/platformio.ini
#	variants/heltec_v3/platformio.ini
#	variants/heltec_v4/HeltecV4Board.cpp
#	variants/heltec_v4/platformio.ini
#	variants/heltec_wireless_paper/platformio.ini
#	variants/lilygo_tbeam_1w/platformio.ini
#	variants/lilygo_tbeam_SX1262/platformio.ini
#	variants/lilygo_tbeam_SX1276/platformio.ini
#	variants/lilygo_tbeam_supreme_SX1262/platformio.ini
#	variants/lilygo_tlora_v2_1/platformio.ini
#	variants/xiao_c3/platformio.ini
#	variants/xiao_s3/platformio.ini
#	variants/xiao_s3_wio/platformio.ini
2026-06-22 18:13:18 -07:00
mikecarper d9cefed1b1 Merge remote-tracking branch 'IoTThinks/PowerSaving-v16' into keymindCascade
# Conflicts:
#	build-iotthinks.sh
#	build.sh
#	examples/simple_repeater/MyMesh.h
#	src/helpers/CommonCLI.cpp
#	variants/heltec_ct62/platformio.ini
#	variants/heltec_t096/T096Board.cpp
#	variants/heltec_t096/platformio.ini
#	variants/heltec_tracker/platformio.ini
#	variants/heltec_tracker_v2/platformio.ini
#	variants/heltec_v2/platformio.ini
#	variants/heltec_v3/HeltecV3Board.h
#	variants/heltec_v3/platformio.ini
#	variants/heltec_v4/HeltecV4Board.cpp
#	variants/heltec_v4/platformio.ini
#	variants/heltec_wireless_paper/platformio.ini
#	variants/lilygo_tbeam_1w/platformio.ini
#	variants/lilygo_tbeam_SX1262/platformio.ini
#	variants/lilygo_tbeam_SX1276/platformio.ini
#	variants/lilygo_tbeam_supreme_SX1262/platformio.ini
#	variants/lilygo_tlora_v2_1/platformio.ini
#	variants/xiao_c3/platformio.ini
#	variants/xiao_s3_wio/platformio.ini
2026-06-22 17:50:12 -07:00
mikecarper 6b8135aa36 Fix direct retry review nits 2026-06-17 16:44:58 -07:00
mikecarper 19cfc43269 Trim recent repeater API and document retry defaults 2026-06-17 16:32:04 -07:00
mikecarper 7d2ff38120 Trim direct retry cleanup 2026-06-16 13:15:52 -07:00
mikecarper 21c5e2701b Tune unknown retry SNR 2026-06-15 18:06:58 -07:00
mikecarper cb5e2e7c3d Document direct retry CLI 2026-06-15 17:42:53 -07:00
mikecarper 765ec1447b Add direct retry controls 2026-06-15 17:24:22 -07:00
Wessel Nieboer 7c8e092457 Have CAD be a separate toggle (set cad on/off) 2026-06-14 15:20:58 +02:00