Score:0

Which package or packages are needed to charge a laptop battery?

in flag

I have an Ubuntu 22.04 system on an HP 17 laptop. When the laptop is plugged into the charger, it does not charge (nor does it discharge). When I mouse over the battery indicator in the system tray, the tooltip says "Battery at 75%, not charging" and it stays that way indefinitely.

I've found many AskUbuntu and Stack Exchange posts on this issue. All of them offer solutions that don't work for me. For example, the most common resolution is to "hard reset" the power by turning the laptop off and holding the power button down for up to a minute before rebooting. I've tried this several times, and it does not change anything. Other things from other posts that don't work include BIOS fiddling (I don't have any of the relevant battery settings), recovery mode, and busctl commands.

I have discovered, however, that when the laptop is completely powered off and plugged in, it charges normally. I just left it powered off for the past hour, and it's now at "Battery at 98%, not charging", up from 75%. This demonstrates that the battery itself and the laptop hardware are fully capable of charging; therefore, it must be an OS problem.

About a week ago I had a minor disaster in which I accidentally removed ~500 packages. I spent a day inspecting and re-installing each of these packages, and for the past week my machine has been functioning normally, with the exception of the charging problem. So, my best guess is that some package responsible for allowing the battery to charge must have been re-installed differently, or even missed. I'm trying to figure out what package to investigate.

I'm using the KDE Plasma DE. From a web search, I've found the Arch Wiki that indicates powerdevil is responsible for power management. This is one of the packages that was removed, but I reinstalled it successfully:

$ apt-cache policy powerdevil
powerdevil:
  Installed: 4:5.24.7-0ubuntu0.1
  Candidate: 4:5.24.7-0ubuntu0.1
  Version table:
 *** 4:5.24.7-0ubuntu0.1 500
        500 http://us.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages
        100 /var/lib/dpkg/status
     4:5.24.4-0ubuntu1 500
        500 http://us.archive.ubuntu.com/ubuntu jammy/universe amd64 Packages

I can't find a record of what other packages I should expect to be relevant, so I'm asking here so that there's a record of it. What package or packages are required for Ubuntu 22.04 to be able to charge a battery?

The entire list of packages that were affected is enormous. I can post it if requested, but it seems like a huge info dump for small utility. Hopefully someone here can suggest the name of the needle I'm looking for within that haystack. If it helps, here is the standard battery diagnostic output:

$ upower -i /org/freedesktop/UPower/devices/battery_BAT0
  native-path:          BAT0
  vendor:               Hewlett-Packard
  model:                Primary
  serial:               100000
  power supply:         yes
  updated:              Sun 09 Jul 2023 01:19:46 PM EDT (18 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               pending-charge
    warning-level:       none
    energy:              27.726 Wh
    energy-empty:        0 Wh
    energy-full:         36.66 Wh
    energy-full-design:  36.66 Wh
    energy-rate:         0 W
    voltage:             11.929 V
    charge-cycles:       70
    percentage:          75%
    capacity:            100%
    technology:          lithium-ion
    icon-name:          'battery-full-charging-symbolic'

Thanks.

guiverc avatar
cn flag
My understanding is the hardware itself and box *firmware* handles the charging, not the OS itself. If it was the OS that managed it; you'd be unable to charge your system whilst it was turned off! Power management instead is related to *power usage* and how the OS runs so as to prolong battery life.
ru flag
No packages are required for battery charging. OS doesn't manage charging. Your system firmware on the motherboard/mainboard handles the charging use case. If your system is not charging, I would suggest you take your computer to a repair shop.
MANI avatar
do flag
Do you dual-boot? Is the behavior same on other OS? Did you install 'tlp' in Ubuntu (https://linrunner.de/tlp/settings/introduction.html)?
Darien Marks avatar
in flag
I don't dual boot, and I have never had 'tlp' installed, either before or after the package disaster. If it's a firmware issue, it's hard for me to understand how my firmware could just stop working *only* when the OS is loaded without it being in some way OS-related, especially since it started at precisely the same moment as a massive package shake-up
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.