Skip to content

Incorrect SNR parsing in _read_packet of LoRa SX1262 driver #999

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
hlym123 opened this issue Apr 15, 2025 · 2 comments
Open

Incorrect SNR parsing in _read_packet of LoRa SX1262 driver #999

hlym123 opened this issue Apr 15, 2025 · 2 comments
Assignees

Comments

@hlym123
Copy link

hlym123 commented Apr 15, 2025

🐛 Bug Description

micropython/lora/lora-sx126x/lora/sx126x.py, line: 599

In sx1262.py, the SNR value is parsed incorrectly in _read_packet. The driver currently does:

rx_packet.snr = pkt_status[2]  # Incorrect

pkt_status[2] is a signed 8-bit integer in two’s complement format (unit: dB × 4), and should be converted before use.

raw_snr = pkt_status[2]
if raw_snr >= 128:
    raw_snr -= 256  # convert to int8
@dpgeorge
Copy link
Member

@projectgus FYI

@projectgus projectgus self-assigned this Apr 16, 2025
@projectgus
Copy link
Contributor

Thanks @hlym123, will fix.

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

No branches or pull requests

3 participants