Errata 15.4: SetPacketParams resets register 0x0736 to an incorrect
default for IQ polarity. For standard IQ (no inversion), bit 2 must
be SET after every SetPacketParams call. Without this, LoRa RX
demodulation can fail silently while TX continues to work — the
symptom mimics a hardware failure.
Errata 15.1: Register 0x0889 bit 2 controls modulation quality at
different bandwidths. It must be cleared for 500 kHz BW and set for
all others. The previous implementation was a no-op stub.
Both fixes are from the SX1262 datasheet errata (DS_SX1261-2_V2.1)
and apply to all SX1262-based boards.
Fix for critical Issue: GPIO 36 on the ESP32 is an input-only pin (part of the ADC1 group along with GPIO 34, 35, and 39). This is a hardware limitation of the ESP32 microcontroller. These pins cannot be configured as outputs.
This means the current pin assignment in the firmware will not work correctly for the reset functionality, as pinMode(_reset, OUTPUT) and digitalWrite(_reset, LOW/HIGH) calls will fail to actually drive the pin. The reset pin for a generic ESP32 board should be reassigned to a GPIO that supports output mode (any GPIO that is not 34, 35, 36, or 39).
This appears to be a configuration error in the board definition that would prevent proper initialization of the SX1278 LoRa module on these board configurations.
// there are three version of V3: V3, V3.1, and V3.2
// V3 and V3.1 have a pull up on pin_ctrl and are active low
// V3.2 has a transistor and active high
// put the pin input mode and read it. if it's high, we have V3 or V3.1
// other wise, it's a V3.2
Also, changed the min, max, float values for V3 boards. From what I can see, most are sold with
a battery like this: https://www.amazon.com/dp/B0D3LMQSGL
These batteries advertise a min voltage of 3 and max of 4. Float should be a tiny bit below Max.