Ubuntu – How to a mini PC be stopped from being detected as a laptop with a battery

batteryintel atomlaptoppower-management

Long story short: We have one of those little $100 Chinese mini PCs running 18.04 LTS. ("Wintel Pro" / "Wintel Box") It thinks it has a battery, possibly because it thinks it is a laptop. The "battery" level notifications – that I have tried a million ways to kill – are driving me nuts because I'm trying to use this machine to run a looping slideshow while the workplace is open.

(Update: It wasn't just the battery notifications on the desktop, either. Sometimes it would just shut off randomly. I have a nearly identical model without a desktop and it exhibited random shut-offs until I applied the same fix detailed in my own answer below.)

Thought I might have had this fixed but HAHAHA NOPE

Related question: Why does Ubuntu power management set a battery as the default power supply on a desktop machine?

This is where someone asked "What is the output of laptop-detect -v?"

It is: We're a laptop (non device ACPI batteries found)

But we are emphatically not a laptop, and we don't want to be a laptop. How can we not be a laptop?

CPU is Intel Atom x5-Z8350. Do let me know if additional information is required. The fault may have nothing to do with Ubuntu but I live in hope Ubuntu might have the tools to fix it.

(Aside: LibreOffice Impress slides run fine, but I would not recommend these machines for high-resolution video playback.)

Top side of mini PC

Bottom of mini PC

LSHW output: https://pastebin.com/e5XXp8A0

Also, thank you to @Sri for reminding me that I'd already tried turning off "Notification Popups" and it did as much good as a piece of paper towel against a flood. The "battery" notifications seem to cheerfully disregard this setting – even with notification popups ostensibly OFF, the nonexistent battery still breaks through.

Update: Apparently there is an "axp288" device inside this miniPC, and apparently there is some discussion somewhere on the LKML about this:
https://lore.kernel.org/lkml/20190520115247.828904395@linuxfoundation.org/

Is there a way to get this code into my instance of Ubuntu? Would it even do any good? (Maybe it's already there?)

Best Answer

I'm an upstream kernel developer and the author of the kernel-patch linked from the original post.

I just discovered this thread today, this is a known issue with some of these Intel Atom x5-Z83xx based boxes, they use an AXP288 PMIC and often the BIOS does not turn off the fuel-gauge (battery monitoring) part of this chip.

The driver for the AXP288 fuel-gauge contains a list of devices like this: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/power/supply/axp288_fuel_gauge.c#n679

And it will automatically disable itself for devices on this list.

So the proper fix for this, which will make future Linux versions work out of the box, without needing manual configuration, is to add your device to this list.

I can do this for you, but I need some information about your model to be able to do this.

Please as a regular user in a terminal run:

grep . /sys/class/dmi/id/* 2> /dev/null

On the device and then copy and paste the output here, or send me an email with it at "Hans de Goede hdegoede@redhat.com".

That will give me the info which I need to add your device to the no-fuel-gauge list.

Related Question