Topic: Battery reporting wrong percentage?

My GUI battery meter that I added to the panel on default Novena install (for Laptop model) seems to do a decent job of estimating time remaining, but seems to think that the battery cuts out at 40% instead of 0% (I booted after a full drain caused the system to power off and it showed around 40% remaining.)

Anyone else seeing something like this?

Re: Battery reporting wrong percentage?

The battery board actually "pulls the plug" to the mainboard when it hits 9V.  The gas gauge, which is what measures the battery percentage (among many other things) is *supposed* to be set such that 9V = 0%.  It seems as though it learns the battery capacity somewhat.

There are several ways to measure time remaining.  You can estimate it yourself, based on voltage and amperage, look at watts remaining, or just read the "time remaining" value.  It's not clear which yours is doing, but you might try looking at the serial console (sudo screen /dev/ttymxc3 115200, then type "stats") to see if anything looks amiss.

Re: Battery reporting wrong percentage?

When I unplug AC, it takes XFCE awhile to notice and show that I'm not charging anymore, but hooking up to th eserial console it seems like the gas guage definitely reports it instantly, so something funky is happening.

I'll keep investigating.

Re: Battery reporting wrong percentage?

The thing printing "[AC connected]" is the STM32, not the gas gauge.

There is a separate problem that you might be encountering.  There is a driver for the Senoko AC connector.  It is a Power Supply device with just an AC plug.  You may be running into a problem where this isn't getting detected.  If you run "upower -d", you should see "senoko-ac-supply", and the "online" property should reflect whether it's plugged in or not.  And it should be instantaneous.

Re: Battery reporting wrong percentage?

I'm not on AC just now, but my upower -d output does not show anything about senoko-ac, full output at http://pastie.org/10106565

Re: Battery reporting wrong percentage?

upower -d output right after plugging in AC: http://pastie.org/10107404

Re: Battery reporting wrong percentage?

That definitely seems odd.  What do you see if you run "dmesg | grep senoko"?  Does it say anything about being unable to detect the device?

There were some I2C problems before, they will be much better in the next version of the software.

Re: Battery reporting wrong percentage?

$ dmesg | grep senoko
[    2.626619] senoko 0-0020: Senoko 'S' version 2.0 (features: 0x02)
[    2.632865] senoko 0-0020: GPIO IRQ: 20
[    2.636725] senoko 0-0020: GPIO IRQ trigger: 0
[    3.104038] input: Senoko keypad as /devices/soc0/soc/2100000.aips-bus/21a0000.i2c/i2c-0/0-0020/senoko-keypad.1/input/input1

Re: Battery reporting wrong percentage?

That might be a problem.  Though I thought that was fixed.

The "Features" flag indicates that it doesn't have a power port.  That was due to a bug, so to work around it I had the MFD driver ignore that.

You don't have /sys/class/power_supply/senoko-ac-supply/ by any chance, do you?  If it still isn't working, we can try updating the kernel to a test image I have.  It has a few problems (audio doesn't resume correctly after suspend, and I have reports of the FPGA not working well,) but we can see if it helps your problem.

Re: Battery reporting wrong percentage?

$ ls /sys/class/power_supply/
sbs-0-000b

It works, it just takes a strangely long amount of time to realize it's switch from not charging to charging or vice-versa.  I'd be willing to try a test kernel to see if it helps.  I'm not going to use things like hibernate or suspend anyway smile

11 (edited by pelrun 2015-04-28 14:34:54)

Re: Battery reporting wrong percentage?

That's just because without the senoko-ac-supply device the AC status only gets updated when the xfce4 widget polls the sbs device once a minute or so.

Not sure why senoko-ac-supply isn't present; it's not in mine either.

Re: Battery reporting wrong percentage?

I installed the kernel from https://nas.xobs.io/novena/20150429/lin … _armhf.deb and now upower -d shows /org/freedesktop/UPower/devices/line_power_senoko_ac_supply and my power manager seems to detect AC connect/disconnect instantly