HTCC-AB01 V2 does not show the battery level

The previous version of this development board showed the battery level using the instruction: “getBatteryVoltage()”

uint16_t voltage = getBatteryVoltage();

With version v2 the result of the battery level is zero.

I have tried others functions (level=analogRead(ADC); voltage=analogReadmV(ADC);), but the results are not as expected.

Anyone to help me?

I’ve only just started playing with my new V2 boards. I have a different problem with one of them, but the battery reading seems to be OK on the one that’s working. I can’t be 100% sure right at the moment, because the battery is still fully charged, but it’s showing 4.21V (not zero).

I’m also running exactly the same code as I run on my V1 boards, but I did update my Arduino IDE and Heltec [CubeCell] libraries before working with the V2 board.

Indeed the problem comes from using PlatformIO.
With Arduino IDE the instruction works correctly. Thank you