Whether I’m doing the ‘right thing’ or not, all I have in my main loop, where I do my periodic check of all of my sensors, is:
digitalWrite(Vext, LOW); // Turn on the external power supply
delay(10); // Give everything a moment to settle down
// other unrelated stuff
batteryVoltage=getBatteryVoltage();
Serial.print("[loop-ReadVoltage] Battery Voltage: ");
Serial.print( batteryVoltage );
Serial.println(" mV");
There’s no detail in the board schematic that would explain why I might need to turn on Vext to read the battery voltage (nor why I might not have to do anything with VBAT_ADC_CTL), but you could give that a try.
The only other thing I’d suggest is creating a sketch without any unnecessary libraries, in case there’s some conflict in there somewhere. Just for the record, my sketch includes the following:
#include <LoRa_APP.h>
#include <Arduino.h>
#include <AT24C32N.h>
#include <Seeed_BME280.h>
#include <Wire.h>