Re: incorrect battery reading, 0% all the time
Thanh Hieu Cao <[email protected]>
| Newsgroups | gmane.os.openbsd.misc |
|---|---|
| Message-ID | <[email protected]> |
Jun 3, 2026 3:52:35 AM Jan Stary <[email protected]>: >> On my Dynabook Portege X40-J running OpenBSD 7.9, the battery report >> from `apm -v` always returns 0% despite the battery being fully >> charged and AC connected. >> AC/BAT state does change when AC is connected/disconnected, only the >> battery remains at 0%. >> >> apm -v output >> (AC UNPLUGGED) >> Battery state: charging, 0% remaining, 0 minutes recharge time >> estimate >> AC adapter state: connected >> Performance adjustment mode: manual (2901 MHz) >> (AC PLUGGED) >> Battery state: CRITICAL, 0% remaining, 0 minutes life estimate >> AC adapter state: not connected >> Performance adjustment mode: auto (400 MHz) >> >> There's nothing wrong with the battery physically, it reports >> correctly under Linux and holds charge well. > > So what does it report under Linux? > (And other OSes, for that matter?) > >> Attached is dmesg and sysctl output > > sysctl hw would probably be enough for this :-) > >> acpibat0 at acpi0: BAT1 model "G71C000MA210" serial 4266600 type LiON >> oem "BYD" > >> hw.sensors.acpibat0.volt0=4266.60 VDC (voltage) >> hw.sensors.acpibat0.volt1=4266.60 VDC (current voltage) >> hw.sensors.acpibat0.power0=1804.16 W (rate) > > Batteries differ in the semantics of what they report > - surely it's not 4 kV and 1.8kW; probably mili. > >> hw.sensors.acpibat0.watthour0=1804.16 Wh (last full capacity) > > It seems odd that this is exactly the same number > as the rate above in (mili)watts. > >> hw.sensors.acpibat0.watthour1=3300.26 Wh (warning capacity) >> hw.sensors.acpibat0.watthour2=0.00 Wh (low capacity) >> hw.sensors.acpibat0.watthour3=3308.11 Wh (remaining capacity), WARNING >> hw.sensors.acpibat0.watthour4=1804.16 Wh (design capacity) > > So 3308 Wh of the designed 1804 Wh remain? > > I suspect the battery itself reporting something strange > - possibly linux's acpibat knows its quirks? > > Jan Thanks for your time, below is the information pulled from Void Linux and FreeBSD (Live USB) while AC is unplugged. Void Linux: upower (3rd party program), print contents of files under /sys/class/power_supply/BAT1 FreeBSD: acpiconf, sysctl -------------------------- Void Linux (Kernel 7.0.11) -------------------------- $ upower dump Device: /org/freedesktop/UPower/devices/battery_BAT1 native-path: BAT1 vendor: BYD model: G71C000MA210 serial: 263 power supply: yes updated: Wed Jun 3 04:57:13 2026 (0 seconds ago) has history: yes has statistics: yes battery present: yes rechargeable: yes state: discharging warning-level: none energy: 22.576 Wh energy-empty: 0 Wh energy-full: 27.612 Wh energy-full-design: 53.13 Wh energy-rate: 6.175 W voltage: 15.4 V charge-cycles: N/A time to empty: 3.7 hours percentage: 82% capacity: 51.9706% technology: lithium-ion icon-name: 'battery-full-symbolic' History (rate): 1780477033 6.175 unknown 1780477032 5.990 discharging 1780477030 5.467 discharging 1780477029 5.128 discharging 1780477027 6.160 discharging 1780477025 6.190 discharging 1780477024 5.436 discharging 1780477022 6.391 discharging 1780476965 5.846 discharging ----trimmed $ find /sys/class/power_supply/BAT1/ -type f | xargs grep . /sys/class/power_supply/BAT1/uevent:DEVTYPE=power_supply /sys/class/power_supply/BAT1/uevent:POWER_SUPPLY_NAME=BAT1 /sys/class/power_supply/BAT1/uevent:POWER_SUPPLY_TYPE=Battery /sys/class/power_supply/BAT1/uevent:POWER_SUPPLY_STATUS=Discharging /sys/class/power_supply/BAT1/uevent:POWER_SUPPLY_PRESENT=1 /sys/class/power_supply/BAT1/uevent:POWER_SUPPLY_TECHNOLOGY=Li-ion /sys/class/power_supply/BAT1/uevent:POWER_SUPPLY_CYCLE_COUNT=0 /sys/class/power_supply/BAT1/uevent:POWER_SUPPLY_VOLTAGE_MIN_DESIGN=15400000 /sys/class/power_supply/BAT1/uevent:POWER_SUPPLY_VOLTAGE_NOW=15400000 /sys/class/power_supply/BAT1/uevent:POWER_SUPPLY_POWER_NOW=12859000 /sys/class/power_supply/BAT1/uevent:POWER_SUPPLY_ENERGY_FULL_DESIGN=53130000 /sys/class/power_supply/BAT1/uevent:POWER_SUPPLY_ENERGY_FULL=27612000 /sys/class/power_supply/BAT1/uevent:POWER_SUPPLY_ENERGY_NOW=20589000 /sys/class/power_supply/BAT1/uevent:POWER_SUPPLY_CAPACITY=75 /sys/class/power_supply/BAT1/uevent:POWER_SUPPLY_CAPACITY_LEVEL=Normal /sys/class/power_supply/BAT1/uevent:POWER_SUPPLY_TYPE=Battery /sys/class/power_supply/BAT1/uevent:POWER_SUPPLY_MODEL_NAME=G71C000MA210 /sys/class/power_supply/BAT1/uevent:POWER_SUPPLY_MANUFACTURER=BYD /sys/class/power_supply/BAT1/uevent:POWER_SUPPLY_SERIAL_NUMBER=263 /sys/class/power_supply/BAT1/serial_number:263 /sys/class/power_supply/BAT1/technology:Li-ion /sys/class/power_supply/BAT1/power_now:12859000 /sys/class/power_supply/BAT1/present:1 /sys/class/power_supply/BAT1/power/runtime_active_time:0 /sys/class/power_supply/BAT1/power/runtime_status:unsupported /sys/class/power_supply/BAT1/power/runtime_suspended_time:0 /sys/class/power_supply/BAT1/power/control:auto /sys/class/power_supply/BAT1/manufacturer:BYD /sys/class/power_supply/BAT1/energy_now:20589000 /sys/class/power_supply/BAT1/type:Battery /sys/class/power_supply/BAT1/capacity:75 /sys/class/power_supply/BAT1/cycle_count:0 /sys/class/power_supply/BAT1/voltage_now:15400000 /sys/class/power_supply/BAT1/status:Discharging /sys/class/power_supply/BAT1/alarm:0 /sys/class/power_supply/BAT1/model_name:G71C000MA210 /sys/class/power_supply/BAT1/voltage_min_design:15400000 /sys/class/power_supply/BAT1/hwmon3/in0_input:15400 /sys/class/power_supply/BAT1/hwmon3/power/runtime_active_time:0 /sys/class/power_supply/BAT1/hwmon3/power/runtime_status:unsupported /sys/class/power_supply/BAT1/hwmon3/power/runtime_suspended_time:0 /sys/class/power_supply/BAT1/hwmon3/power/control:auto /sys/class/power_supply/BAT1/hwmon3/power1_input:12859000 /sys/class/power_supply/BAT1/hwmon3/name:BAT1 /sys/class/power_supply/BAT1/capacity_level:Normal /sys/class/power_supply/BAT1/energy_full_design:53130000 /sys/class/power_supply/BAT1/charge_control_end_threshold:100 /sys/class/power_supply/BAT1/energy_full:27612000 -------------------- FreeBSD 15.0-RELEASE -------------------- # acpiconf -i 0 Design capacity: 53130 mWh Last full capacity: 27612 mWh Technology: primary (non-rechargeable) Design voltage: 15400 mV Capacity (warn): 552 mWh Capacity (low): 0 mWh Low/warn granularity: 531 mWh Warn/full granularity: 531 mWh Model number: G71C000MA210 Serial number: 263 Type: LiON OEM info: BYD State: discharging Remaining capacity: 65% Remaining time: 1:37 Present rate: 11041 mW Present voltage: 15400 mV # sysctl -a | grep -i battery battery0: <ACPI Control Method Battery> on acpi0 hw.acpi.battery.info_expire: 5 hw.acpi.battery.units: 1 hw.acpi.battery.state: 1 hw.acpi.battery.rate: 10256 hw.acpi.battery.time: 99 hw.acpi.battery.life: 61 dev.battery.0.%iommu: dev.battery.0.%parent: acpi0 dev.battery.0.%pnpinfo: _HID=PNP0C0A _UID=1 _CID=none dev.battery.0.%location: handle=\_SB_.BAT1 dev.battery.0.%driver: battery dev.battery.0.%desc: ACPI Control Method Battery dev.battery.0.%parent: