Skip to content

Incorrect SNR parsing in _read_packet of LoRa SX1262 driver #999

Closed
@hlym123

Description

@hlym123

🐛 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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions