System.batteryCharge

I know this topic has been discussed multiple time, but I’m searching to a solution for my issue.

While using the following Sleep option, then waking the SOC never seems to update correctly.

config2.mode(SystemSleepMode::ULTRA_LOW_POWER)
.gpio(WKP, RISING)
.network(NETWORK_INTERFACE_CELLULAR,
SystemSleepNetworkFlag::INACTIVE_STANDBY);
System.sleep(config2);

then reading the SOC using:
SOCvoltage =System.batteryCharge();

I using Device OS: 4.0.2.

Is there a solution I can use to read the updated SOC?

Hi, what does it mean, do you get a -1?
I think the SOC reading requires some time to get established, what if you wait a bit and re-read?
Cheers

2 Likes

Yes. The fuel gauge is turned off while asleep, and it takes a while to wake back up and return a reading so you can’t do it immediately after wake.

thanks I will add some wait time…

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.