Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen Revision Vorhergehende Überarbeitung | |||
| mc_rxdelay_calc [2026/05/31 12:21] – bmke-a-2345-tdeck | mc_rxdelay_calc [2026/05/31 12:22] (aktuell) – gelöscht bmke-a-2345-tdeck | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| - | ====== MeshCore RX Delay Calculator ====== | ||
| - | |||
| - | ===== What is RX Delay? ===== | ||
| - | |||
| - | **RX Delay** ('' | ||
| - | |||
| - | **Purpose: | ||
| - | |||
| - | **Only affects flood routes.** Direct-route packets are processed immediately. | ||
| - | |||
| - | **Default: | ||
| - | |||
| - | **Limits (firmware): | ||
| - | |||
| - | * Delay **< 50 ms** → packet processed **immediately** | ||
| - | * Delay **> 32 000 ms** → capped at 32 seconds | ||
| - | * '' | ||
| - | Sources: [[https:// | ||
| - | |||
| - | ===== The Formula ===== | ||
| - | |||
| - | <code javascript> | ||
| - | /** | ||
| - | * MeshCore RX delay (milliseconds) | ||
| - | * | ||
| - | * @param {number} rxDelayBase | ||
| - | * @param {number} score - packet score 0.0 … 1.0 (from SNR + packet length) | ||
| - | * @param {number} airtimeMs | ||
| - | * @returns {number} delay in ms (can be negative → treated as immediate) | ||
| - | */ | ||
| - | function calcRxDelay(rxDelayBase, | ||
| - | if (rxDelayBase <= 0) return 0; | ||
| - | return (Math.pow(rxDelayBase, | ||
| - | } | ||
| - | |||
| - | </ | ||
| - | |||
| - | **Excel equivalent** | ||
| - | < | ||
| - | |||
| - | =(rx_delay_base ^ (0.85 - score) - 1) * airtime | ||
| - | |||
| - | </ | ||
| - | |||
| - | Your spreadsheet uses **airtime = 150 ms** as a fixed example. In firmware, '' | ||
| - | |||
| - | ===== Packet Score (0.0 – 1.0) ===== | ||
| - | |||
| - | The **score** | ||
| - | |||
| - | < | ||
| - | score = clamp(0, 1, ((SNR - SNR_threshold[SF]) / 10) * (1 - packet_len / 256)) | ||
| - | |||
| - | </ | ||
| - | |||
| - | **Interpretation: | ||
| - | |||
| - | * **score = 1.0** → excellent signal, well above decoding threshold, short packet | ||
| - | * **score = 0.5** → moderate margin above threshold | ||
| - | * **score = 0.0** → at or below SNR threshold (should not decode reliably) | ||
| - | SNR thresholds per SF (approx.): SF7 −7.5 dB, SF8 −10, SF9 −12.5, SF10 −15, SF11 −17.5, SF12 −20. | ||
| - | |||
| - | **Example: | ||
| - | |||
| - | ===== Reading the Table ===== | ||
| - | |||
| - | Your Excel sheet layout: | ||
| - | |||
| - | ^rx_delay_base | ||
| - | |**1** |0|0|0|0|0|0|0|0|0|0| | ||
| - | |**2** |102|85|70|55|41|28|16|5|−5|−15| | ||
| - | |…|…|…|…|…|…|…|…|…|…|…| | ||
| - | |||
| - | * **Rows** | ||
| - | * **Columns** | ||
| - | * **Cells** | ||
| - | **Key behaviors: | ||
| - | |||
| - | * '' | ||
| - | * '' | ||
| - | * Higher '' | ||
| - | * Higher **score** | ||
| - | |||
| - | ===== Interactive Calculator ===== | ||
| - | |||
| - | Paste the block below into a DokuWiki page. Requires **HTML embed** | ||
| - | |||
| - | < | ||
| - | < | ||
| - | |||
| - | #mc-rxdelay { font-family: | ||
| - | #mc-rxdelay table { border-collapse: | ||
| - | #mc-rxdelay th, #mc-rxdelay td { border: 1px solid #ccc; padding: 4px 6px; text-align: right; } | ||
| - | #mc-rxdelay th { background: #eef; position: sticky; top: 0; } | ||
| - | #mc-rxdelay td.row-hdr { background: #f5f5f5; font-weight: | ||
| - | #mc-rxdelay .neg { color: #888; } | ||
| - | #mc-rxdelay .imm { background: #e8f5e9; } | ||
| - | #mc-rxdelay .queued { background: #fff8e1; } | ||
| - | #mc-rxdelay .controls { margin: 12px 0; display: flex; flex-wrap: wrap; gap: 16px; align-items: | ||
| - | #mc-rxdelay .controls label { display: flex; align-items: | ||
| - | #mc-rxdelay .result-box { background: #f0f7ff; border: 1px solid #9cf; padding: 10px; margin: 12px 0; border-radius: | ||
| - | |||
| - | </ | ||
| - | |||
| - | </ | ||
| - | |||
| - | <div id=" | ||
| - | |||
| - | < | ||
| - | <div class=" | ||
| - | < | ||
| - | < | ||
| - | < | ||
| - | <button type=" | ||
| - | </ | ||
| - | |||
| - | </ | ||
| - | |||
| - | < | ||
| - | <div class=" | ||
| - | |||
| - | </ | ||
| - | |||
| - | < | ||
| - | <div style=" | ||
| - | <table id=" | ||
| - | < | ||
| - | < | ||
| - | </ | ||
| - | </ | ||
| - | |||
| - | </ | ||
| - | |||
| - | < | ||
| - | <p style=" | ||
| - | Green = <50 ms (processed immediately) · Yellow = queued · Grey italic = negative (also immediate) | ||
| - | </p> | ||
| - | |||
| - | </ | ||
| - | |||
| - | </ | ||
| - | |||
| - | <script type=" | ||
| - | |||
| - | var MC_RX_SCORES = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]; var MC_RX_BASES = [1, | ||
| - | |||
| - | function mcCalcRxDelay(rxDelayBase, | ||
| - | |||
| - | < | ||
| - | if (rxDelayBase <= 0) return 0; | ||
| - | return (Math.pow(rxDelayBase, | ||
| - | |||
| - | </ | ||
| - | |||
| - | } | ||
| - | |||
| - | /** Optional: compute packet score from SNR (SF7–SF12), | ||
| - | < | ||
| - | |||
| - | var raw = mcCalcRxDelay(rxDelayBase, | ||
| - | if (raw < | ||
| - | return Math.min(Math.round(raw), | ||
| - | |||
| - | </ | ||
| - | |||
| - | } | ||
| - | |||
| - | function mcRxDelayUpdate() { | ||
| - | |||
| - | < | ||
| - | var airtime = parseFloat(document.getElementById(' | ||
| - | var hlRx = parseFloat(document.getElementById(' | ||
| - | var hlScore = parseFloat(document.getElementById(' | ||
| - | |||
| - | </ | ||
| - | < | ||
| - | |||
| - | var raw = mcCalcRxDelay(hlRx, | ||
| - | var eff = mcEffectiveRxDelay(hlRx, | ||
| - | document.getElementById(' | ||
| - | '< | ||
| - | ', score=' | ||
| - | ' | ||
| - | ' = < | ||
| - | ' | ||
| - | (raw < | ||
| - | |||
| - | </ | ||
| - | |||
| - | < | ||
| - | var thead = '< | ||
| - | for (var s = 0; s < | ||
| - | thead += '< | ||
| - | } | ||
| - | thead += '</ | ||
| - | document.querySelector('# | ||
| - | |||
| - | </ | ||
| - | |||
| - | < | ||
| - | var tbody = ''; | ||
| - | for (var r = 0; r < | ||
| - | var rx = MC_RX_BASES[r]; | ||
| - | var rowClass = (Math.abs(rx - hlRx) <0.01) ? ' style=" | ||
| - | tbody += '< | ||
| - | for (var c = 0; c < | ||
| - | var sc = MC_RX_SCORES[c]; | ||
| - | var val = mcCalcRxDelay(rx, | ||
| - | var cls = ''; | ||
| - | if (val <0) cls = ' | ||
| - | else if (val < | ||
| - | else cls = ' | ||
| - | var hi = (Math.abs(rx - hlRx) <0.01 && Math.abs(sc - hlScore) <0.001) ? ' outline:2px solid #f90;' : ''; | ||
| - | tbody += '< | ||
| - | (val <0 ? '< | ||
| - | '</ | ||
| - | } | ||
| - | tbody += '</ | ||
| - | } | ||
| - | document.querySelector('# | ||
| - | |||
| - | </ | ||
| - | |||
| - | } | ||
| - | |||
| - | if (document.readyState === ' | ||
| - | |||
| - | < | ||
| - | document.addEventListener(' | ||
| - | |||
| - | </ | ||
| - | |||
| - | } else { | ||
| - | |||
| - | < | ||
| - | mcRxDelayUpdate(); | ||
| - | |||
| - | </ | ||
| - | |||
| - | } </ | ||
| - | |||
| - | ===== SNR → Score Helper (optional second widget) ===== | ||
| - | |||
| - | < | ||
| - | |||
| - | < | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | |||
| - | </ | ||
| - | |||
| - | </ | ||
| - | |||
| - | < | ||
| - | < | ||
| - | <div class=" | ||
| - | < | ||
| - | < | ||
| - | < | ||
| - | <button type=" | ||
| - | </ | ||
| - | <div class=" | ||
| - | |||
| - | </ | ||
| - | |||
| - | </ | ||
| - | |||
| - | < | ||
| - | var snr = parseFloat(document.getElementById(' | ||
| - | var sf = parseInt(document.getElementById(' | ||
| - | var pl = parseInt(document.getElementById(' | ||
| - | var score = mcPacketScore(snr, | ||
| - | document.getElementById(' | ||
| - | 'Score = < | ||
| - | |||
| - | </ | ||
| - | |||
| - | } mcScoreUpdate(); | ||
| - | |||
| - | ===== Practical Tuning Guide ===== | ||
| - | |||
| - | - **Start with '' | ||
| - | - **Never use 0 < rxdelay < 1** — it reverses the logic (bad paths win). | ||
| - | - **'' | ||
| - | - Compare delays for your typical packet airtime: a 300 ms airtime doubles all table values. | ||
| - | - Newer firmware may **autotune** | ||
| - | - RX delay is complementary to **TX delay** | ||
| - | |||
| - | ===== CLI Reference ===== | ||
| - | |||
| - | < | ||
| - | get rxdelay | ||
| - | set rxdelay 2 # enable with base 2 | ||
| - | |||
| - | </ | ||
| - | |||
| - | Companion radio stores the value internally as millis × 1000; repeater/ | ||
| - | |||
| - | ---- | ||
| - | |||