Commit Graph
63 Commits
Author SHA1 Message Date
mikecarper fcfca64cc5 Refine trace and group data retries 2026-07-13 17:56:08 -07:00
mikecarper e3f47b487b Harden packet, retry, and alert handling 2026-07-13 16:37:32 -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 0ede4e2066 Merge RX duty-cycle power saving into keymindCascade 2026-07-11 22:12:20 -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
agessamanandClaude Fable 5 7076ff5b31 fix(radio): restore upstream token-bucket duty-cycle enforcement
Commit 22eb9b87 ("Revert 'Merge remote-tracking branch origin/dev...'")
reverted an entire upstream merge to escape a bad merge state, dropping
860 lines across 66 files. Among the collateral never reconciled on a
later re-merge was eb4fa032's token-bucket duty-cycle enforcement — the
mechanism that keeps nodes under a configured airtime budget (and EU
868 MHz nodes under the legally-mandated duty cycle). The fork had fallen
back to fixed per-packet spacing (getAirtimeBudgetFactor reverted to 2.0),
losing the windowed enforcement.

This was never an intentional design choice, so restoring it re-aligns the
fork with upstream and REDUCES the merge-conflict surface: Dispatcher.{h,cpp}
now diverge from upstream by watchdog additions only (77 insertions, 0
deletions) instead of rewriting checkSend()/loop().

Restored from upstream: updateTxBudget/tx_budget_ms/duty_cycle_window_ms/
getRemainingTxBudget/getDutyCycleWindowMs and the windowed budget logic in
Dispatcher; getOutboundTotal() and the 0xFFFFFFFF count-all sentinel in
StaticPoolPacketManager; the getOutboundTotal() call in StatsFormatHelper.
Re-applied the fork's MQTT radio-watchdog on top as pure additions
(#ifdef WITH_MQTT_BRIDGE), keeping formatRadioDiag.

Stored airtime_factor settings keep their meaning: fork's t*factor spacing
and upstream's 1/(1+factor) windowed budget yield the same steady-state
duty cycle; upstream additionally allows short bursts within the window.

Phase 2 (CAD / radio_fem_rxgain, which touch NodePrefs persistence and
per-board FEM wiring) is documented in RESTORE_UPSTREAM_NOTES.md, not done
here. Builds: Heltec_v3 observer + plain repeater. NEEDS ON-DEVICE
duty-cycle validation before merge.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 10:08:14 -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
Kevin Le 1976494d7b PR 1727: Added get/set cad. Added # channel busy. 2026-06-24 22:03:35 +07:00
mikecarper 6b8135aa36 Fix direct retry review nits 2026-06-17 16:44:58 -07:00
mikecarper 8d46ed4f21 Enable retry CR radio overrides 2026-06-16 16:25:04 -07:00
mikecarper 166261c73e Merge remote-tracking branch 'upstream/dev' into HEAD
# Conflicts:
#	examples/simple_repeater/MyMesh.cpp
#	src/helpers/BaseChatMesh.cpp
#	src/helpers/CommonCLI.cpp
#	src/helpers/CommonCLI.h
#	variants/heltec_t096/T096Board.cpp
#	variants/heltec_v4/HeltecV4Board.cpp
2026-06-15 15:52:11 -07:00
mikecarper 60879c9973 Merge remote-tracking branch 'upstream/dev' into halo-direct-path-retries
# Conflicts:
#	examples/simple_repeater/MyMesh.cpp
#	src/Dispatcher.cpp
#	src/Dispatcher.h
#	src/Mesh.cpp
#	src/helpers/CommonCLI.cpp
#	src/helpers/CommonCLI.h
#	src/helpers/SimpleMeshTables.h
2026-06-15 15:32:58 -07:00
Wessel Nieboer 7c8e092457 Have CAD be a separate toggle (set cad on/off) 2026-06-14 15:20:58 +02:00
mikecarper 2af7b75d70 For packets with a path set; auto try again if no echo was heard 2026-06-04 15:07:11 -07:00
agessaman 7b21be3e39 feat(cli): add radio watchdog command and update documentation
Introduced a new CLI command to view and set the radio watchdog interval, allowing users to configure the watchdog timeout in minutes (0 to disable, 1-120 for active). Updated the documentation to reflect this addition and clarified the parameters for the `neighbor.remove` command. Default watchdog interval is set to 5 minutes in the codebase.
2026-04-24 20:54:00 -07:00
agessaman 961f829321 Enhance radio watchdog functionality in Dispatcher to prevent false alarms in quiet mesh environments. Introduce a composite timestamp for radio activity, incorporating last RX, ISR events, and successful TX. Update related methods in Dispatcher and RadioLibWrapper to track radio activity accurately. This improves radio management and troubleshooting capabilities. 2026-04-14 16:16:49 -07:00
agessaman 7e4f75c9a5 Add radio diagnostics support in MyMesh and CommonCLI
Implement a new method `formatRadioDiagReply` in MyMesh to format and return radio diagnostic information. Update CommonCLI to handle the new command for retrieving radio diagnostics. Enhance the Dispatcher class with a radio watchdog feature to monitor and recover from silent radio states. Introduce new error flags and methods in the Dispatcher and RadioLibWrapper classes to support these diagnostics, improving overall radio management and troubleshooting capabilities.
2026-04-10 08:48:22 -07:00
agessaman 22eb9b87a3 Revert "Merge remote-tracking branch 'origin/dev' into mqtt-bridge-implementation"
This reverts commit 2b63765522, reversing
changes made to 304719e8e0.
2026-03-20 15:54:14 -07:00
ripplebizandGitHub cf0cc851d4 Merge pull request #1297 from ViezeVingertjes/feature/duty-cycle-token-bucket
Implement token bucket duty cycle enforcement
2026-03-08 23:54:32 +11:00
Scott Powell 45564bad9b * Dispatcher bug fixes 2026-02-23 23:51:30 +11:00
Scott Powell 3e76161e9c * refactor of Contact/Client out_path_len (stored in files), from signed to unsigned byte (+2 squashed commits)
Squashed commits:
[f326e25] * misc
[fa5152e] * new 'path mode' parsing in Dispatcher
2026-02-21 19:35:51 +11:00
ViezeVingertjes 519b97a90a Updated the Dispatcher logic to replace hardcoded values with defined constants for minimum TX budget reserve and airtime division. 2026-02-07 19:07:33 +01:00
ViezeVingertjes 30d6588792 Update logic in Dispatcher to ensure refill is only applied when greater than zero. 2026-02-07 18:26:39 +01:00
ViezeVingertjes eb4fa032ff Implement token bucket duty cycle enforcement 2026-01-04 21:33:46 +01:00
Chris ea2ce93c02 Add a counter to track rx time for repeater stats 2025-07-30 09:41:20 -07:00
Scott Powell 466bd6d596 * fix for when AGC reset is disabled (interval = 0) 2025-06-13 14:25:09 +10:00
Scott Powell 32ca3dc9d0 * repeater and room server: new CLI setting "agc.reset.interval" (seconds) 2025-06-13 14:15:21 +10:00
Scott Powell b3d78ac8a7 * interference threshold now stored in prefs, CLI: set/get "int.thresh" 2025-05-26 17:18:49 +10:00
Scott Powell 0e35ae5ec6 * dynamic noise floor sampling 2025-05-25 21:44:15 +10:00
Scott Powell f2243b78ae * added Radio::loop() virtual function
* RadioLibWrapper:  new isChannelActive() based on current RSSI being above noise_floor + THRESHOLD
2025-05-24 21:24:44 +10:00
Scott Powell e291b57a07 * Dispatcher::checkSend() bug: getOutboundCount() should only count non-future packets 2025-05-14 16:50:11 +10:00
Scott Powell 805ca7b900 * CommonCLI: added "clear stats" command 2025-05-13 18:12:58 +10:00
Scott Powell 177dd90ca1 * Repeater/Room server: new diagnostics, stats.n_full_events now repurposed to 'err_events' (bit flags)
* new Radio::isInRecvMode() method
2025-05-13 15:38:10 +10:00
Scott Powell b08436eba7 * startSendRaw() now returns false if fail 2025-05-12 17:26:44 +10:00
Scott Powell 1d4ae9f3c4 minor refactor 2025-04-11 19:11:06 +10:00
Scott Powell ab8cd85d8e * added Packet::getRawLength() helper 2025-04-11 15:12:04 +10:00
Scott Powell 3c7ff8da29 * Packet::header, new: ROUTE_TYPE_TRANS_FLOOD, ROUTE_TYPE_TRANS_DIRECT
* Packet wire format change: (optional) extra 4 bytes for two trans_codes
2025-04-11 04:56:13 +10:00
Scott Powell 89bd6c3416 * Dispatcher: now impose a max time for CAD fail (ie. channel busy), defined by getCADFailMaxDuration(), default 4 seconds.
(an sx126x bug _might_ be making radio->isReceiving() return true indefinitely)
2025-03-28 20:50:42 +11:00
Scott Powell fe4fdeb236 * redesigned TRACE packet structure 2025-03-17 17:56:12 +11:00
Scott Powell 9aa2edf9ba Merge branch 'dev' into trace
# Conflicts:
#	examples/companion_radio/main.cpp
#	src/Dispatcher.cpp
2025-03-15 15:12:50 +11:00
Scott Powell 3778c0a8ff * repeater and room server: MESH_PACKET_LOGGING, now dumps RAW: rx packet contents
* Dispatcher: MESH_PACKET_LOGGING,  added " hash={packet-hash}"
2025-03-09 20:36:49 +11:00
Scott Powell f77a6944f9 * PUSH_CODE_LOG_RX_DATA: is now just: {snr*4},{rssi},{raw-lora-packet} 2025-03-09 17:04:22 +11:00
Scott Powell 2889867c4c * Dispatcher: added guard for packet payload size too large 2025-03-08 19:38:36 +11:00
Scott Powell 544adec2b6 * refactor Packet::_snr to single byte 2025-03-07 12:32:23 +11:00
Scott Powell b2fcc692ea * TRACE packet logging fix 2025-03-07 12:24:18 +11:00
Scott Powell b03aac18c0 Merge branch 'dev' into trace
# Conflicts:
#	src/Dispatcher.cpp
#	src/Mesh.cpp
#	src/helpers/BaseChatMesh.cpp
2025-03-07 12:14:26 +11:00
Scott Powell 189ed79d46 * new Dispatcher::getCADFailRetryDelay() 2025-02-27 04:05:50 +11:00