diff --git a/docs/cli_commands.md b/docs/cli_commands.md index 2d31a18b..6adcc4c7 100644 --- a/docs/cli_commands.md +++ b/docs/cli_commands.md @@ -1115,8 +1115,8 @@ set direct.retry.margin 10 - Lower SNR uses more robust coding rates. - CR6 is intentionally skipped. - `off` disables per-packet retry CR overrides and uses the current radio CR. -- Unknown repeaters start at `+2.00 dB` for adaptive CR selection. -- A failed unknown repeater is seeded at `+1.75 dB`. +- Unknown repeaters start at `+3.00 dB` for adaptive CR selection. +- A failed unknown repeater is seeded at `+2.75 dB`. - Each later failure lowers the SNR estimate by `0.25 dB`. **Examples:** @@ -1164,6 +1164,15 @@ set direct.retry.cr 20.0,12.0,6.0,2.0 - `snr_db`: SNR in dB. - `page`: 1-based result page. +**SNR details:** +- Recent repeater SNR is stored internally in quarter-dB units. +- Heard repeater samples update an existing table entry with a weighted blend: `75%` existing SNR and `25%` new heard SNR, rounded up. +- Direct retry success also feeds the heard echo SNR back into the same weighted table. +- Direct retry failure is not weighted: each final echo-timeout failure lowers that repeater's SNR by `0.25 dB`. +- Unknown repeaters start at `+3.00 dB` for adaptive CR selection. +- If an unknown repeater fails, it is seeded into the table at `+2.75 dB`. +- `set recent.repeater ` seeds a missing prefix or adds another weighted sample for an existing prefix. + **Examples:** ``` get recent.repeater diff --git a/examples/simple_repeater/MyMesh.cpp b/examples/simple_repeater/MyMesh.cpp index f8946e64..05c308bc 100644 --- a/examples/simple_repeater/MyMesh.cpp +++ b/examples/simple_repeater/MyMesh.cpp @@ -606,7 +606,7 @@ bool MyMesh::allowDirectRetry(const mesh::Packet* packet, const uint8_t* next_ho if (repeater == NULL) { // Retry unknown repeaters too. If they fail, onDirectRetryFailed() seeds the - // recent-repeater table below the +2.00 dB starting point. + // recent-repeater table below the +3.00 dB starting point. return true; } int16_t retry_floor_x4 = (int16_t)getDirectRetryMinSNRX4() + (int16_t)_prefs.direct_retry_snr_margin_x4; @@ -615,7 +615,7 @@ bool MyMesh::allowDirectRetry(const mesh::Packet* packet, const uint8_t* next_ho void MyMesh::configureDirectRetryPacket(mesh::Packet* retry, const mesh::Packet* original, uint8_t retry_attempt) { (void)retry_attempt; - int8_t snr_x4 = 8; // unknown repeaters start at +2.00 dB + int8_t snr_x4 = 12; // unknown repeaters start at +3.00 dB const SimpleMeshTables* tables = static_cast(getTables()); if (tables != NULL) { uint8_t prefix[MAX_HASH_SIZE]; @@ -683,7 +683,7 @@ void MyMesh::onDirectRetryFailed(const uint8_t* next_hop_hash, uint8_t next_hop_ SimpleMeshTables* tables = static_cast(getTables()); if (tables != NULL) { if (!tables->decrementRecentRepeaterSnrX4(next_hop_hash, next_hop_hash_len, 1)) { - tables->setRecentRepeater(next_hop_hash, next_hop_hash_len, 7, false, true); + tables->setRecentRepeater(next_hop_hash, next_hop_hash_len, 11, false, true); } } }