You are not logged in.

#1 2020-05-08 22:58:34

860lacov
Member
Registered: 2020-05-02
Posts: 42

[SOLVED] tlp Error: battery charge thresholds not available

I wanted to do:
tlp recalibrate but there is an error:

Error: battery charge thresholds not available.
Error: battery discharge/recalibrate not available.

tlp manual says:
The output of tlp-stat -b (version 1.2.2 or higher recommended) will guide you which package to install:

    acpi_call (Community) – optional – External kernel module providing battery charge thresholds and recalibration for newer ThinkPads (X220/T420 and later)
    tp_smapi (Community) – optional – External kernel module providing battery charge thresholds, recalibration and specific tlp-stat -b output for older ThinkPads

my tlp-stat -b gives me:

Install tp-smapi kernel modules for ThinkPad battery thresholds and recalibration

but after installation of tp_smapi tlp-stat -b is showing:
tp-smapi   = inactive (kernel module 'tp_smapi' not installed)


My tlp.conf

 START_CHARGE_THRESH_BAT0=75
 STOP_CHARGE_THRESH_BAT0=95

# Ultrabay / Slice / Replaceable battery (values in %)
# Default: <none>

START_CHARGE_THRESH_BAT1=75
STOP_CHARGE_THRESH_BAT1=95

# Restore charge thresholds when AC is unplugged: 0=disable, 1=enable.
# Default: 0

RESTORE_THRESHOLDS_ON_BAT=1

Last edited by 860lacov (2020-05-09 10:24:50)

Offline

#2 2020-05-09 00:19:50

cirrus
Member
From: Glasgow Scotland
Registered: 2012-08-24
Posts: 323
Website

Re: [SOLVED] tlp Error: battery charge thresholds not available

rebuild kernel to load newer modules with mkinitcpio
you did not list your hardware, if applicable also see Thinkpads only

Last edited by cirrus (2020-05-09 00:22:54)


Registered Linux User #544546
   Time you enjoyed wasting was not wasted. --John Lennon.

Offline

#3 2020-05-09 09:46:09

860lacov
Member
Registered: 2020-05-02
Posts: 42

Re: [SOLVED] tlp Error: battery charge thresholds not available

I use linux-lts

During installation of tp_smapi linux-5.6.11.arch1-1 is installed.
And then

==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default'
  -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img
==> Starting build: 5.6.11-arch1-1
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [autodetect]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
  -> Running build hook: [filesystems]
  -> Running build hook: [keyboard]
  -> Running build hook: [consolefont]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-linux.img
==> Image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'fallback'
  -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback.img -S autodetect
==> Starting build: 5.6.11-arch1-1
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
==> WARNING: Possibly missing firmware for module: aic94xx
==> WARNING: Possibly missing firmware for module: wd719x
  -> Running build hook: [filesystems]
  -> Running build hook: [keyboard]
  -> Running build hook: [consolefont]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-linux-fallback.img
==> Image generation successful

Isn't that mean that kernel was rebuilt?

Output of my tlp-stat -b is:

+++ Battery Features: Charge Thresholds and Recalibrate
natacpi    = inactive (ThinkPad not supported)
tpacpi-bat = inactive (ThinkPad not supported)
tp-smapi   = inactive (kernel module 'tp_smapi' not installed)

+++ Battery Status: BAT0
/sys/class/power_supply/BAT0/manufacturer                   = SANYO
/sys/class/power_supply/BAT0/model_name                     = 42T4763
/sys/class/power_supply/BAT0/cycle_count                    = (not supported)
/sys/class/power_supply/BAT0/charge_full_design             =   6600 [mAh]
/sys/class/power_supply/BAT0/charge_full                    =   4314 [mAh]
/sys/class/power_supply/BAT0/charge_now                     =   4314 [mAh]
/sys/class/power_supply/BAT0/current_now                    =      0 [mA]
/sys/class/power_supply/BAT0/status                         = Full

Charge                                                      =  100.0 [%]
Capacity                                                    =   65.4 [%]

+++ Recommendations
* Install tp-smapi kernel modules for ThinkPad battery thresholds and recalibration

My laptop is Lenovo t410 but I use a replacement battery. If battery is not genuine then it will not work?

Last edited by 860lacov (2020-05-09 09:49:56)

Offline

#4 2020-05-09 09:58:09

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 9,995

Re: [SOLVED] tlp Error: battery charge thresholds not available

If you use the LTS kernel you need to install tp_smapi-lts

Last edited by V1del (2020-05-09 09:58:29)

Offline

#5 2020-06-28 17:10:18

860lacov
Member
Registered: 2020-05-02
Posts: 42

Re: [SOLVED] tlp Error: battery charge thresholds not available

I'm not sure if I should start the new thread.

I had a problem with TP-Link TL-WN772N wifi dongle. (Atheros AR9271). I know why thanks to JohannesK.

I downgraded kernel to 5.4.46-1-lts but since then I have similar problem.

Error: battery charge thresholds not available.
Error: battery discharge/recalibrate not available.

tlp-stat -b:

tp-smapi   = inactive (kernel module 'tp_smapi' not installed)

But it is installed for LTS kernel.
I wanted to load module with
modprobe tp_smapi but there is a error:

modprobe: FATAL: Module tp_smapi not found in directory /lib/modules/5.4.46-1-lts

In /lib/modules/ directory I have:
5.4.46-1-lts/ <- my current kernel
and
5.4.49-1-lts/

Offline

#6 2020-06-29 01:35:27

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 9,995

Re: [SOLVED] tlp Error: battery charge thresholds not available

You need to relevantly downgrade the corresponding module as well, they are built for the installed kernel, if you downgrade the kernel you also have to downgrade external modules like this relevantly so they fit with the kernel you downgrade to.

Offline

#7 2020-06-29 08:27:28

860lacov
Member
Registered: 2020-05-02
Posts: 42

Re: [SOLVED] tlp Error: battery charge thresholds not available

V1del wrote:

You need to relevantly downgrade the corresponding module as well, they are built for the installed kernel, if you downgrade the kernel you also have to downgrade external modules like this relevantly so they fit with the kernel you downgrade to.

Ok
Quite reasonable.

I've found
tp_sampi

But the version numbers are not "similar" to the kernel version.

How do I know which version to choose?

P.s.
I didn't downgrade virtualbox modules and virtualbox is still working (I think that the module was downgraded automatically).
Why is that?

Offline

#8 2020-06-29 09:45:10

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 9,995

Re: [SOLVED] tlp Error: battery charge thresholds not available

You likely use the DKMS variant for virtualbox which does the necessary rebuild locally on your machine instead.

As for finding out how to downgrade the precompiled packages, look at the corresponding rebuild change: https://git.archlinux.org/svntogit/comm … _smapi-lts so you'd need 0.42-72 for the 5.4.46 kernel

Inb4 the next question, yes tp-smapi could also be built as a DKMS module, it's not in the repos for reasons I don't know, but there exists an AUR package: https://aur.archlinux.org/packages/tp_smapi-dkms

Offline

#9 2020-06-29 15:00:03

860lacov
Member
Registered: 2020-05-02
Posts: 42

Re: [SOLVED] tlp Error: battery charge thresholds not available

V1del wrote:

You likely use the DKMS variant for virtualbox which does the necessary rebuild locally on your machine instead.

As for finding out how to downgrade the precompiled packages, look at the corresponding rebuild change: https://git.archlinux.org/svntogit/comm … _smapi-lts so you'd need 0.42-72 for the 5.4.46 kernel

Inb4 the next question, yes tp-smapi could also be built as a DKMS module, it's not in the repos for reasons I don't know, but there exists an AUR package: https://aur.archlinux.org/packages/tp_smapi-dkms

And it's working again. Thank you very much and one more question. about:
https://git.archlinux.org/svntogit/comm … _smapi-lts

Is this common knowledge?
I didn't know about existence of this page.
With link you gave me it was very easy to find proper tp_smapi version but when I go to:
https://git.archlinux.org/svntogit/community.git/ I'm not able to find the list with packages
I don't know where to go to get the list like this:
https://git.archlinux.org/svntogit/comm … _smapi-lts

Offline

#10 2020-06-30 06:59:27

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 9,995

Re: [SOLVED] tlp Error: battery charge thresholds not available

If you go from there without directly knowing the URL it's a bit of a puzzle with how the interface for cgit is set up, you need to switch the branch to the package you want, go to tree, enter the trunk directory and then look at the log.

Alternatively this link is placed for every package on the normal https://www.archlinux.org/packages/ detail page there's a "View changes" link in the box on the right corner, which is what I'd assume most people to use that are interested in the actual changes.  Or now that you know the general setup of the link, just change the last part to the package you want to inspect.

Offline

Board footer

Powered by FluxBB