Laptop battery gaining capacity?
by LinuxMonday from LinuxQuestions.org on (#6CZ10)
Hello everyone,
I posted this to another site's forum, but no one there seemed to have an answer. It was a distro-specific site, so maybe this is a better place for the question?
Here's what I posted and what I'm curious about:
I run a simple script I wrote to log my current laptop battery capacity now and again (so I know when I want to replace it - maybe at 50%?). For a long time, it had been reporting 67%:
Code:2023-06-17 : Battery 0: design capacity 8850 mAh, last full capacity 5997 mAh = 67%Then a few weeks ago, no worries but it dropped (as expected as it ages) to 65%:
Code:2023-06-24 : Battery 0: design capacity 8850 mAh, last full capacity 5778 mAh = 65%However, (since) then the reported capactity increased to 68%? Not sure what to make of this as I don't imagine the battery is actually getting better.
Code:2023-07-03 : Battery 0: design capacity 8850 mAh, last full capacity 6073 mAh = 68%Any thoughts?
Following is my system info, and then following that the bash script I use to report my battery info, in case either are helpful.
Here's my system info:
Code:System:
Kernel: 5.15.0-76-generic x86_64 bits: 64 compiler: gcc v: 11.3.0 Desktop: Cinnamon 5.6.8
tk: GTK 3.24.33 wm: muffin dm: LightDM Distro: Linux Mint 21.1 Vera base: Ubuntu 22.04 jammy
Machine:
Type: Laptop System: Dell product: Latitude E6540 v: 00 serial: <superuser required> Chassis:
type: 9 serial: <superuser required>
Mobo: Dell model: 0VPH0Y serial: <superuser required> UEFI: Dell v: A26 date: 10/09/2018
Battery:
ID-1: BAT0 charge: 36.6 Wh (54.3%) condition: 67.4/98.2 Wh (68.6%) volts: 11.1 min: 11.1
model: Samsung SDI DELL F0D4C36 serial: <filter> status: Discharging
Device-1: hidpp_battery_0 model: Logitech Wireless Mouse M325 serial: <filter>
charge: 55% (should be ignored) status: Discharging
CPU:
Info: quad core model: Intel Core i7-4700MQ bits: 64 type: MT MCP arch: Haswell rev: 3 cache:
L1: 256 KiB L2: 1024 KiB L3: 6 MiB
Speed (MHz): avg: 1365 high: 2560 min/max: 800/3400 cores: 1: 1049 2: 798 3: 798 4: 798 5: 798
6: 1728 7: 2560 8: 2395 bogomips: 38310
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
Device-1: Intel 4th Gen Core Processor Integrated Graphics vendor: Dell driver: i915 v: kernel
ports: active: eDP-1 empty: DP-1, DP-2, HDMI-A-1, HDMI-A-2, HDMI-A-3, VGA-1 bus-ID: 00:02.0
chip-ID: 8086:0416
Device-2: AMD Mars XTX [Radeon HD 8790M] vendor: Dell driver: radeon v: kernel pcie:
speed: 8 GT/s lanes: 8 ports: active: none empty: VGA-2 bus-ID: 01:00.0 chip-ID: 1002:6606
Display: x11 server: X.Org v: 1.21.1.4 driver: X: loaded: ati,modesetting,radeon
unloaded: fbdev,vesa gpu: i915 display-ID: :0 screens: 1
Screen-1: 0 s-res: 1920x1080 s-dpi: 96
Monitor-1: eDP-1 model: AU Optronics res: 1920x1080 dpi: 142 diag: 394mm (15.5")
OpenGL: renderer: Mesa Intel HD Graphics 4600 (HSW GT2) v: 4.6 Mesa 22.2.5-0ubuntu0.1~22.04.3
direct render: Yes
Audio:
Device-1: Intel Xeon E3-1200 v3/4th Gen Core Processor HD Audio vendor: Dell
driver: snd_hda_intel v: kernel bus-ID: 00:03.0 chip-ID: 8086:0c0c
Device-2: Intel 8 Series/C220 Series High Definition Audio vendor: Dell driver: snd_hda_intel
v: kernel bus-ID: 00:1b.0 chip-ID: 8086:8c20
Sound Server-1: ALSA v: k5.15.0-76-generic running: yes
Sound Server-2: PulseAudio v: 15.99.1 running: yes
Sound Server-3: PipeWire v: 0.3.48 running: yes
Network:
Device-1: Intel Ethernet I217-LM vendor: Dell driver: e1000e v: kernel port: f080
bus-ID: 00:19.0 chip-ID: 8086:153a
IF: eno1 state: down mac: <filter>
Device-2: Intel Centrino Advanced-N 6235 driver: iwlwifi v: kernel pcie: speed: 2.5 GT/s
lanes: 1 bus-ID: 03:00.0 chip-ID: 8086:088e
IF: wlp3s0 state: up mac: <filter>
Bluetooth:
Device-1: Intel Centrino Bluetooth Wireless Transceiver type: USB driver: btusb v: 0.8
bus-ID: 2-1.5:3 chip-ID: 8087:07da
Report: hciconfig ID: hci0 rfk-id: 5 state: up address: <filter> bt-v: 2.1 lmp-v: 4.0
sub-v: fc00
RAID:
Hardware-1: Intel 82801 Mobile SATA Controller [RAID mode] driver: ahci v: 3.0 bus-ID: 00:1f.2
chip-ID: 8086:282a
Drives:
Local Storage: total: 232.89 GiB used: 49.83 GiB (21.4%)
ID-1: /dev/sda vendor: EDGE Tech model: SE847-V SSD size: 232.89 GiB speed: 6.0 Gb/s
serial: <filter>
Partition:
ID-1: / size: 227.68 GiB used: 49.82 GiB (21.9%) fs: ext4 dev: /dev/sda2
ID-2: /boot/efi size: 511 MiB used: 6.1 MiB (1.2%) fs: vfat dev: /dev/sda1
Swap:
ID-1: swap-1 type: file size: 2 GiB used: 0 KiB (0.0%) priority: -2 file: /swapfile
Sensors:
System Temperatures: cpu: 52.0 C mobo: 50.0 C sodimm: SODIMM C gpu: radeon temp: 44.0 C
Fan Speeds (RPM): cpu: 3207
Repos:
Packages: 2279 apt: 2259 flatpak: 20
No active apt repos in: /etc/apt/sources.list
Active apt repos in: /etc/apt/sources.list.d/brave-browser-release.list
1: deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https: //brave-browser-apt-release.s3.brave.com/ stable main
Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list
1: deb http: //packages.linuxmint.com vera main upstream import backport
2: deb http: //archive.ubuntu.com/ubuntu jammy main restricted universe multiverse
3: deb http: //archive.ubuntu.com/ubuntu jammy-updates main restricted universe multiverse
4: deb http: //archive.ubuntu.com/ubuntu jammy-backports main restricted universe multiverse
5: deb http: //security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
Info:
Processes: 265 Uptime: 1h 38m Memory: 15.52 GiB used: 1.85 GiB (11.9%) Init: systemd v: 249
runlevel: 5 Compilers: gcc: 11.3.0 alt: 11/12 Client: Unknown python3.10 client inxi: 3.3.13And my bash script:
Code:#/bin/bash
# -----------------------------------------------------------------------------
# FILE PURPOSE AND NOTES:
# Create report of laptop battery health info
# Find codes at https://www.dmtf.org/standards/SMBIOS
# -----------------------------------------------------------------------------
# Set up variables
bios_report=$(cat /sys/class/dmi/id/chassis_type)
report_data="$HOME/System/Logs/Temp/laptop-battery-status.temp"
report_tracking="$HOME/System/Logs/laptop-battery-status.log"
report_latest="$HOME/System/Reports/laptop-battery.report"
echo ".. Compiling laptop battery report to $report_latest"
# Determine machine type, only run this if this is one of the laptops
case $bios_report in
3|4|5|6|7)
machine_type="Desktop"
echo
make-warning.sh "ERROR: $(hostname) reports it is a $machine_type ($bios_report) machine, and so has no battery"
echo "$(date +%Y-%m-%d) : Desktop machine, so no battery" > $report_tracking
echo
;;
8|9|10)
machine_type="Laptop"
# Get current battery info and store that in temp data file
acpi -i > $report_data
# Pull capacity data from the temp data file and store in tracking log and report files for later use
echo "$(date +%Y-%m-%d) : $(grep capacity $report_data)" >> $report_tracking
echo "$(date +%Y-%m-%d) : $(grep capacity $report_data)" > $report_latest
;;
*)
make-warning.sh "Unable to determine machine type (i.e., Desktop or Laptop)"
;;
esac
# Finalize script
log-script.sh $0
I posted this to another site's forum, but no one there seemed to have an answer. It was a distro-specific site, so maybe this is a better place for the question?
Here's what I posted and what I'm curious about:
I run a simple script I wrote to log my current laptop battery capacity now and again (so I know when I want to replace it - maybe at 50%?). For a long time, it had been reporting 67%:
Code:2023-06-17 : Battery 0: design capacity 8850 mAh, last full capacity 5997 mAh = 67%Then a few weeks ago, no worries but it dropped (as expected as it ages) to 65%:
Code:2023-06-24 : Battery 0: design capacity 8850 mAh, last full capacity 5778 mAh = 65%However, (since) then the reported capactity increased to 68%? Not sure what to make of this as I don't imagine the battery is actually getting better.
Code:2023-07-03 : Battery 0: design capacity 8850 mAh, last full capacity 6073 mAh = 68%Any thoughts?
Following is my system info, and then following that the bash script I use to report my battery info, in case either are helpful.
Here's my system info:
Code:System:
Kernel: 5.15.0-76-generic x86_64 bits: 64 compiler: gcc v: 11.3.0 Desktop: Cinnamon 5.6.8
tk: GTK 3.24.33 wm: muffin dm: LightDM Distro: Linux Mint 21.1 Vera base: Ubuntu 22.04 jammy
Machine:
Type: Laptop System: Dell product: Latitude E6540 v: 00 serial: <superuser required> Chassis:
type: 9 serial: <superuser required>
Mobo: Dell model: 0VPH0Y serial: <superuser required> UEFI: Dell v: A26 date: 10/09/2018
Battery:
ID-1: BAT0 charge: 36.6 Wh (54.3%) condition: 67.4/98.2 Wh (68.6%) volts: 11.1 min: 11.1
model: Samsung SDI DELL F0D4C36 serial: <filter> status: Discharging
Device-1: hidpp_battery_0 model: Logitech Wireless Mouse M325 serial: <filter>
charge: 55% (should be ignored) status: Discharging
CPU:
Info: quad core model: Intel Core i7-4700MQ bits: 64 type: MT MCP arch: Haswell rev: 3 cache:
L1: 256 KiB L2: 1024 KiB L3: 6 MiB
Speed (MHz): avg: 1365 high: 2560 min/max: 800/3400 cores: 1: 1049 2: 798 3: 798 4: 798 5: 798
6: 1728 7: 2560 8: 2395 bogomips: 38310
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
Device-1: Intel 4th Gen Core Processor Integrated Graphics vendor: Dell driver: i915 v: kernel
ports: active: eDP-1 empty: DP-1, DP-2, HDMI-A-1, HDMI-A-2, HDMI-A-3, VGA-1 bus-ID: 00:02.0
chip-ID: 8086:0416
Device-2: AMD Mars XTX [Radeon HD 8790M] vendor: Dell driver: radeon v: kernel pcie:
speed: 8 GT/s lanes: 8 ports: active: none empty: VGA-2 bus-ID: 01:00.0 chip-ID: 1002:6606
Display: x11 server: X.Org v: 1.21.1.4 driver: X: loaded: ati,modesetting,radeon
unloaded: fbdev,vesa gpu: i915 display-ID: :0 screens: 1
Screen-1: 0 s-res: 1920x1080 s-dpi: 96
Monitor-1: eDP-1 model: AU Optronics res: 1920x1080 dpi: 142 diag: 394mm (15.5")
OpenGL: renderer: Mesa Intel HD Graphics 4600 (HSW GT2) v: 4.6 Mesa 22.2.5-0ubuntu0.1~22.04.3
direct render: Yes
Audio:
Device-1: Intel Xeon E3-1200 v3/4th Gen Core Processor HD Audio vendor: Dell
driver: snd_hda_intel v: kernel bus-ID: 00:03.0 chip-ID: 8086:0c0c
Device-2: Intel 8 Series/C220 Series High Definition Audio vendor: Dell driver: snd_hda_intel
v: kernel bus-ID: 00:1b.0 chip-ID: 8086:8c20
Sound Server-1: ALSA v: k5.15.0-76-generic running: yes
Sound Server-2: PulseAudio v: 15.99.1 running: yes
Sound Server-3: PipeWire v: 0.3.48 running: yes
Network:
Device-1: Intel Ethernet I217-LM vendor: Dell driver: e1000e v: kernel port: f080
bus-ID: 00:19.0 chip-ID: 8086:153a
IF: eno1 state: down mac: <filter>
Device-2: Intel Centrino Advanced-N 6235 driver: iwlwifi v: kernel pcie: speed: 2.5 GT/s
lanes: 1 bus-ID: 03:00.0 chip-ID: 8086:088e
IF: wlp3s0 state: up mac: <filter>
Bluetooth:
Device-1: Intel Centrino Bluetooth Wireless Transceiver type: USB driver: btusb v: 0.8
bus-ID: 2-1.5:3 chip-ID: 8087:07da
Report: hciconfig ID: hci0 rfk-id: 5 state: up address: <filter> bt-v: 2.1 lmp-v: 4.0
sub-v: fc00
RAID:
Hardware-1: Intel 82801 Mobile SATA Controller [RAID mode] driver: ahci v: 3.0 bus-ID: 00:1f.2
chip-ID: 8086:282a
Drives:
Local Storage: total: 232.89 GiB used: 49.83 GiB (21.4%)
ID-1: /dev/sda vendor: EDGE Tech model: SE847-V SSD size: 232.89 GiB speed: 6.0 Gb/s
serial: <filter>
Partition:
ID-1: / size: 227.68 GiB used: 49.82 GiB (21.9%) fs: ext4 dev: /dev/sda2
ID-2: /boot/efi size: 511 MiB used: 6.1 MiB (1.2%) fs: vfat dev: /dev/sda1
Swap:
ID-1: swap-1 type: file size: 2 GiB used: 0 KiB (0.0%) priority: -2 file: /swapfile
Sensors:
System Temperatures: cpu: 52.0 C mobo: 50.0 C sodimm: SODIMM C gpu: radeon temp: 44.0 C
Fan Speeds (RPM): cpu: 3207
Repos:
Packages: 2279 apt: 2259 flatpak: 20
No active apt repos in: /etc/apt/sources.list
Active apt repos in: /etc/apt/sources.list.d/brave-browser-release.list
1: deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https: //brave-browser-apt-release.s3.brave.com/ stable main
Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list
1: deb http: //packages.linuxmint.com vera main upstream import backport
2: deb http: //archive.ubuntu.com/ubuntu jammy main restricted universe multiverse
3: deb http: //archive.ubuntu.com/ubuntu jammy-updates main restricted universe multiverse
4: deb http: //archive.ubuntu.com/ubuntu jammy-backports main restricted universe multiverse
5: deb http: //security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
Info:
Processes: 265 Uptime: 1h 38m Memory: 15.52 GiB used: 1.85 GiB (11.9%) Init: systemd v: 249
runlevel: 5 Compilers: gcc: 11.3.0 alt: 11/12 Client: Unknown python3.10 client inxi: 3.3.13And my bash script:
Code:#/bin/bash
# -----------------------------------------------------------------------------
# FILE PURPOSE AND NOTES:
# Create report of laptop battery health info
# Find codes at https://www.dmtf.org/standards/SMBIOS
# -----------------------------------------------------------------------------
# Set up variables
bios_report=$(cat /sys/class/dmi/id/chassis_type)
report_data="$HOME/System/Logs/Temp/laptop-battery-status.temp"
report_tracking="$HOME/System/Logs/laptop-battery-status.log"
report_latest="$HOME/System/Reports/laptop-battery.report"
echo ".. Compiling laptop battery report to $report_latest"
# Determine machine type, only run this if this is one of the laptops
case $bios_report in
3|4|5|6|7)
machine_type="Desktop"
echo
make-warning.sh "ERROR: $(hostname) reports it is a $machine_type ($bios_report) machine, and so has no battery"
echo "$(date +%Y-%m-%d) : Desktop machine, so no battery" > $report_tracking
echo
;;
8|9|10)
machine_type="Laptop"
# Get current battery info and store that in temp data file
acpi -i > $report_data
# Pull capacity data from the temp data file and store in tracking log and report files for later use
echo "$(date +%Y-%m-%d) : $(grep capacity $report_data)" >> $report_tracking
echo "$(date +%Y-%m-%d) : $(grep capacity $report_data)" > $report_latest
;;
*)
make-warning.sh "Unable to determine machine type (i.e., Desktop or Laptop)"
;;
esac
# Finalize script
log-script.sh $0