Need help setting up tp-battery-mode

Hello,

Need help with lenovo thinkpad tp-battery-mode setup

I followed the arch tutorial to set up the program but it does not work. I already set up this program several time in the past but this time it doesn't work.

I use the latest gnome desktop on a lenovo thinkpad laptop.

  1. I downloaded the tp-battery-mode program.

  2. Created a file /etc/tp-battery-mode.conf

  3. I pasted the START_THRESHOLD=85 STOP_THRESHOLD=90 commands in the file

  4. I enabled the file.

Rebooted and the battery still charging to 1oo%

I couldn't figure out what went wrong.

Could anybody help me out.

Thanks

Try/Install ipman

its in chaotic-aur

alias ipd='sudo ipman -d'
alias ipe='sudo ipman -e'
alias ips='ipman -s'

btw, missing your garuda-inxi.

3 Likes
System:
  Kernel: 6.0.8-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 12.2.0
    parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
    root=UUID=8ee680fb-b9fc-4b94-bb4b-81d0b5124470 rw [email protected]
    quiet quiet splash rd.udev.log_priority=3 vt.global_cursor_default=0
    loglevel=3
  Desktop: GNOME v: 43.1 tk: GTK v: 3.24.34 wm: gnome-shell dm: GDM v: 43.0
    Distro: Garuda Linux base: Arch Linux
Machine:
  Type: Laptop System: LENOVO product: 20TA004GUS v: ThinkPad E14 Gen 2
    serial: <superuser required> Chassis: type: 10 serial: <superuser required>
  Mobo: LENOVO model: 20TA004GUS v: SDK0J40697 WIN
    serial: <superuser required> UEFI: LENOVO v: R1EET46W(1.46 )
    date: 12/08/2021
Battery:
  ID-1: BAT0 charge: 28.6 Wh (61.8%) condition: 46.3/45.0 Wh (102.8%)
    volts: 11.5 min: 11.1 model: LGC 5B10X026 type: Li-poly serial: <filter>
    status: discharging cycles: 68
CPU:
  Info: model: 11th Gen Intel Core i5-1135G7 bits: 64 type: MT MCP
    arch: Tiger Lake gen: core 11 level: v4 note: check built: 2020
    process: Intel 10nm family: 6 model-id: 0x8C (140) stepping: 1
    microcode: 0xA6
  Topology: cpus: 1x cores: 4 tpc: 2 threads: 8 smt: enabled cache:
    L1: 320 KiB desc: d-4x48 KiB; i-4x32 KiB L2: 5 MiB desc: 4x1.2 MiB L3: 8 MiB
    desc: 1x8 MiB
  Speed (MHz): avg: 1631 high: 2400 min/max: 400/4200 scaling:
    driver: intel_pstate governor: powersave cores: 1: 2400 2: 733 3: 911
    4: 2400 5: 2400 6: 2400 7: 1081 8: 727 bogomips: 38707
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Vulnerabilities:
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: mmio_stale_data status: Not affected
  Type: retbleed status: Not affected
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via
    prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
    sanitization
  Type: spectre_v2 mitigation: Enhanced IBRS, IBPB: conditional, RSB
    filling, PBRSB-eIBRS: SW sequence
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: Intel TigerLake-LP GT2 [Iris Xe Graphics] vendor: Lenovo
    driver: i915 v: kernel arch: Gen-12.1 process: Intel 10nm built: 2020-21
    ports: active: eDP-1 empty: DP-1, DP-2, DP-3, DP-4, HDMI-A-1
    bus-ID: 00:02.0 chip-ID: 8086:9a49 class-ID: 0300
  Device-2: Acer Integrated Camera type: USB driver: uvcvideo bus-ID: 3-8:2
    chip-ID: 5986:212b class-ID: 0e02
  Display: x11 server: X.Org v: 21.1.4 with: Xwayland v: 22.1.5
    compositor: gnome-shell driver: X: loaded: modesetting
    alternate: fbdev,intel,vesa dri: iris gpu: i915 display-ID: :1 screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.00x11.22")
    s-diag: 582mm (22.93")
  Monitor-1: eDP-1 model: LG Display 0x0685 built: 2020 res: 1920x1080
    hz: 60 dpi: 158 gamma: 1.2 size: 309x174mm (12.17x6.85") diag: 355mm (14")
    ratio: 16:9 modes: 1920x1080
  API: OpenGL Message: Unable to show GL data. Required tool glxinfo
    missing.
Audio:
  Device-1: Intel Tiger Lake-LP Smart Sound Audio vendor: Lenovo
    driver: sof-audio-pci-intel-tgl
    alternate: snd_hda_intel,snd_sof_pci_intel_tgl bus-ID: 00:1f.3
    chip-ID: 8086:a0c8 class-ID: 0401
  Sound API: ALSA v: k6.0.8-zen1-1-zen running: yes
  Sound Server-1: PulseAudio v: 16.1 running: no
  Sound Server-2: PipeWire v: 0.3.60 running: yes
Network:
  Device-1: Intel Wi-Fi 6 AX201 driver: iwlwifi v: kernel bus-ID: 00:14.3
    chip-ID: 8086:a0f0 class-ID: 0280
  IF: wlp0s20f3 state: up mac: <filter>
  Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: Lenovo driver: r8169 v: kernel pcie: gen: 1 speed: 2.5 GT/s lanes: 1
    port: 3000 bus-ID: 04:00.0 chip-ID: 10ec:8168 class-ID: 0200
  IF: enp4s0 state: down mac: <filter>
Bluetooth:
  Device-1: Intel AX201 Bluetooth type: USB driver: btusb v: 0.8
    bus-ID: 3-10:4 chip-ID: 8087:0026 class-ID: e001
  Report: bt-adapter ID: hci0 rfk-id: 1 state: down
    bt-service: enabled,running rfk-block: hardware: no software: yes
    address: <filter>
Drives:
  Local Storage: total: 704.24 GiB used: 11.29 GiB (1.6%)
  SMART Message: Required tool smartctl not installed. Check --recommends
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Crucial model: CT500P5SSD8
    size: 465.76 GiB block-size: physical: 512 B logical: 512 B speed: 31.6 Gb/s
    lanes: 4 type: SSD serial: <filter> rev: P4CR311 temp: 33.9 C scheme: MBR
  ID-2: /dev/nvme1n1 maj-min: 259:2 vendor: Samsung
    model: MZALQ256HAJD-000L1 size: 238.47 GiB block-size: physical: 512 B
    logical: 512 B speed: 31.6 Gb/s lanes: 4 type: SSD serial: <filter>
    rev: BL1QFXV7 temp: 28.9 C scheme: GPT
Partition:
  ID-1: / raw-size: 49.74 GiB size: 49.74 GiB (100.00%)
    used: 11.22 GiB (22.6%) fs: btrfs dev: /dev/nvme1n1p8 maj-min: 259:10
  ID-2: /boot/efi raw-size: 749 MiB size: 747.5 MiB (99.80%)
    used: 77.5 MiB (10.4%) fs: vfat dev: /dev/nvme1n1p1 maj-min: 259:3
  ID-3: /home raw-size: 49.74 GiB size: 49.74 GiB (100.00%)
    used: 11.22 GiB (22.6%) fs: btrfs dev: /dev/nvme1n1p8 maj-min: 259:10
  ID-4: /var/log raw-size: 49.74 GiB size: 49.74 GiB (100.00%)
    used: 11.22 GiB (22.6%) fs: btrfs dev: /dev/nvme1n1p8 maj-min: 259:10
  ID-5: /var/tmp raw-size: 49.74 GiB size: 49.74 GiB (100.00%)
    used: 11.22 GiB (22.6%) fs: btrfs dev: /dev/nvme1n1p8 maj-min: 259:10
Swap:
  Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default)
  ID-1: swap-1 type: zram size: 15.33 GiB used: 0 KiB (0.0%) priority: 100
    dev: /dev/zram0
  ID-2: swap-2 type: partition size: 9.28 GiB used: 0 KiB (0.0%)
    priority: -2 dev: /dev/nvme1n1p7 maj-min: 259:9
Sensors:
  System Temperatures: cpu: 48.0 C mobo: N/A
  Fan Speeds (RPM): fan-1: 0 fan-2: 0
Info:
  Processes: 303 Uptime: 4m wakeups: 9678 Memory: 15.33 GiB
  used: 3.59 GiB (23.4%) Init: systemd v: 252 default: graphical
  tool: systemctl Compilers: gcc: 12.2.0 clang: 14.0.6 Packages: pm: pacman
  pkgs: 1206 libs: 331 tools: pamac,paru,yay Shell: fish v: 3.5.1
  default: Bash v: 5.1.16 running-in: gnome-terminal inxi: 3.3.23
Garuda (2.6.9-1):
  System install date:     2022-11-08
  Last full system update: 2022-11-16
  Is partially upgraded:   No
  Relevant software:       NetworkManager
  Windows dual boot:       Probably (Run as root to verify)
  Snapshots:               Snapper
  Failed units:            systemd-sysctl.service Preformatted text
╭─[email protected] in ~ as 🧙 took 24s
 ╰─λ sudo ipman -d
Battery protection disabled (charge level 100%)
/usr/bin/ipman: line 82: /sys/bus/platform/drivers/ideapad_acpi/VPC2004:00/conservation_mode: No such file or directory

 ╭─[email protected] in ~ as 🧙 took 14ms
[🔴] × sudo ipman -e
Battery protection enabled (charge level 55-60%)
/usr/bin/ipman: line 79: /sys/bus/platform/drivers/ideapad_acpi/VPC2004:00/conservation_mode: No such file or directory

 ╭─[email protected] in ~ as 🧙 took 13ms
[🔴] × sudo ipman -s
cat: '/sys/bus/platform/drivers/ideapad_acpi/VPC2004:00/conservation_mode': No such file or directory
Battery protection: DISABLED

Too bad, doesn't work for you.
Have you checked if your other attempt is suitable for your notebook?

I tried the arch tutorial. I know it worked before. No clue why it doesn't work this time.

Switching to these new charging thresholds is as simple as enabling and starting tp-battery-mode.service

systemctl  enable --now tp-battery-mode.service

btw.
you do

START_THRESHOLD=85
STOP_THRESHOLD=90

or

?

Thanks.
I run those commands. It seems it is working now.
In the meantime I got this output.
I don't know it has any significance.
I paste it here just in case.

╭─[email protected] in ~ as 🧙 took 7s
 ╰─λ START_THRESHOLD=85
     STOP_THRESHOLD=90

fish: Unsupported use of '='. In fish, please use 'set START_THRESHOLD 85'.

The other thing is that when I entered this command

`systemctl  enable --now tp-battery-mode.service`

I didn't get any output.
Normally, there is an output after running this command.

cat /etc/tp-battery-mode.conf
systemctl status tp-battery-mode.service
tp-battery-mode.service - Set battery charge thresholds using tpacpi-bat
     Loaded: loaded (/usr/lib/systemd/system/tp-battery-mode.service; enabled; preset: disabled)
     Active: active (exited) since Wed 2022-11-16 21:39:28 EST; 26min ago
   Main PID: 508 (code=exited, status=0/SUCCESS)
        CPU: 25ms

Nov 16 21:39:28 jmak-20ta004gus systemd[1]: Starting Set battery charge thresholds using tpacpi-bat...
Nov 16 21:39:28 jmak-20ta004gus tp-battery-mode[535]: modprobe: FATAL: Module acpi_call not found in di>
Nov 16 21:39:28 jmak-20ta004gus tp-battery-mode[511]: Could not find /proc/acpi/call. Is module acpi_ca>
Nov 16 21:39:28 jmak-20ta004gus tp-battery-mode[543]: modprobe: FATAL: Module acpi_call not found in di>
Nov 16 21:39:28 jmak-20ta004gus tp-battery-mode[539]: Could not find /proc/acpi/call. Is module acpi_ca>
Nov 16 21:39:28 jmak-20ta004gus systemd[1]: Finished Set battery charge thresholds using tpacpi-bat.

[🧱] × cat /etc/tp-battery-mode.conf
File: /etc/tp-battery-mode.conf
START_THRESHOLD=85
STOP_THRESHOLD=90

You cut the output, but it seems there are things missing.

Please post the link

you use.

https://wiki.archlinux.org/title/Tp-battery-mode

Yes, that is the one I used.

https://wiki.archlinux.org/title/Tp-battery-mode

Yes, I just noticed
systemctl status
part is missing, but when I run the command it was there.

Please always explain exactly what you are doing.
This

does not make sense.

Please post always the command and the output from terminal.

Reduce the font size or extend the terminal, so you can post the full output.

╭─[email protected] in ~ as 🧙 took 15ms
 ╰─λ systemctl status tp-battery-mode.service


● tp-battery-mode.service - Set battery charge thresholds using tpacpi-bat
     Loaded: loaded (/usr/lib/systemd/system/tp-battery-mode.service; enabled; preset: disabled)
     Active: active (exited) since Wed 2022-11-16 21:39:28 EST; 1h 12min ago
   Main PID: 508 (code=exited, status=0/SUCCESS)
        CPU: 25ms

Nov 16 21:39:28 jmak-20ta004gus systemd[1]: Starting Set battery charge thresholds using tpacpi-bat...
Nov 16 21:39:28 jmak-20ta004gus tp-battery-mode[535]: modprobe: FATAL: Module acpi_call not found in di>
Nov 16 21:39:28 jmak-20ta004gus tp-battery-mode[511]: Could not find /proc/acpi/call. Is module acpi_ca>
Nov 16 21:39:28 jmak-20ta004gus tp-battery-mode[543]: modprobe: FATAL: Module acpi_call not found in di>
Nov 16 21:39:28 jmak-20ta004gus tp-battery-mode[539]: Could not find /proc/acpi/call. Is module acpi_ca>
Nov 16 21:39:28 jmak-20ta004gus systemd[1]: Finished Set battery charge thresholds using tpacpi-bat.
lines 1-12/12 (END)

Do you have acpi_call installed and loaded?
It's a dependency of tpacpi-bat, so it should be installed.
If you haven't already, create a file at /etc/modprobe.d/acpicall.conf with this content:

modprobe acpi_call

Reboot to test.


To get complete output of systemctl commands, add parameter --no-pager to the command. Example:

systemctl status --no-pager tp-battery-mode
3 Likes