Skip to content

Fix SNR formatting in RX wardriving API payload#131

Merged
MrAlders0n merged 2 commits into
devfrom
copilot/fix-snr-rounding-error
Dec 22, 2025
Merged

Fix SNR formatting in RX wardriving API payload#131
MrAlders0n merged 2 commits into
devfrom
copilot/fix-snr-rounding-error

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 22, 2025

The RX wardriving function was submitting negative SNR values and rounding to integers instead of using absolute values with decimal precision.

Changes

  • content/wardrive.js: Changed SNR formatting from Math.round(entry.snr_avg) to Math.abs(entry.snr_avg).toFixed(1) in queueApiPost()
  • docs/FLOW_WARDRIVE_RX_DIAGRAM.md: Updated examples to reflect new format

Before/After

// Before: negative values and integer rounding
const heardRepeats = `${entry.repeater_id}(${Math.round(entry.snr_avg)})`;
// "heard_repeats": "7b(-8)"

// After: absolute value with one decimal place
const heardRepeats = `${entry.repeater_id}(${Math.abs(entry.snr_avg).toFixed(1)})`;
// "heard_repeats": "7b(8.0)"
Original prompt

The RX Wardriving function we just implemented seems to be rounding SNR before submitting it to API. -8 should alwasy read 8.0

[RX BATCH API] Payload: {
"key": "59C7754DABDF5C11CA5F5D8368F89",
"lat": 45.26969140877898,
"lon": -75.77747208706617,
"who": "MrAlders0n",
"power": "1.0w",
"heard_repeats": "7b(-8)",
"ver": "DEV-1766430122",
"test": 0,
"iata": "YOW",
"session_id": "20251222-0035",
"WARDRIVE_TYPE": "RX"
}


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI self-assigned this Dec 22, 2025
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix SNR rounding issue in RX Wardriving function Fix SNR formatting in RX wardriving API payload Dec 22, 2025
Copilot AI requested a review from MrAlders0n December 22, 2025 19:22
@MrAlders0n MrAlders0n marked this pull request as ready for review December 22, 2025 19:33
@MrAlders0n MrAlders0n merged commit 7d3f53e into dev Dec 22, 2025
@MrAlders0n MrAlders0n deleted the copilot/fix-snr-rounding-error branch December 23, 2025 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants