Hacker Public Radio

Your ideas, projects, opinions - podcasted.

New episodes Monday through Friday.


HPR3536: Laptop power problems

Hosted by Andrew Conway on 2022-02-21 00:00:00
Download or Listen

This is a story of a laptop with two power problems.

The first and less severe is that sometimes the charging of the battery will get stuck at a certain percentage. This is not simply due to the effect commonly found with aging batteries but a fault with the laptop's charging hardware. A full reset of the charging system can fix it, which for this ASUS Zenbook UX550vd laptop requires a long press — meaning 40 seconds — from its shutdown state.

The second and more serious issue is that the laptop thinks that it is plugged into AC power even when it is running only on battery. I ruled out an operating system or software issue because the issue remains whether running GNU/linux or Windows. The problem is serious because the power management software, in my case in KDE, will not respond to critically low battery levels by suspending or gracefully shutting down. It may be that a sudden loss of power damaged the previous SSD in this laptop, which was the subject of HPR 3428.

My first attempt to fool KDE into seeing accurate battery information under /sys/class/power_supply/BAT0 using an overlay filesystem failed presumably because KDE's power system is listening out for some kind of event rather than simply monitoring those files. My second and successful attempt involved writing my own bash scripts run by cron to monitor battery levels and initiate actions when they got too low. There were errors with comedic consequences along the way. In fact, while writing these shownotes after I finished recording the audio, the laptop suspended itself because of a bug in my script - I used le (less than or equal to) rather than lt (less than) in my test for a change in the battery charge leading to unintended and fun consequences when the battery was fully charged.

Comments



More Information...


Copyright Information

Unless otherwise stated, our shows are released under a Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) license.

The HPR Website Design is released to the Public Domain.