Trying to set up tp-smapi for charging thresholds on Thinkpad X200t


#1

Hey guys, I’m running PureOS on a Thinkpad X200.
When I was using Manjaro, I used the tp-smapi dkms module to set the charge start and stop threshold to extend battery life. I can’t seem to get it working on PureOS.

Anyone have any tips?

Here is what I’ve been trying so far:

[chewie@falcon ~]$ ls /sys/devices/platform
alarmtimer  efi-framebuffer.0  pcspkr     regulatory.0   thinkpad_hwmon
coretemp.0  i8042              power      serial8250     uevent
dock.0      microcode          reg-dummy  thinkpad_acpi
[chewie@falcon ~]$ sudo find /sys -iname '*smapi*'
[chewie@falcon ~]$ lsmod |grep -i smapi
[chewie@falcon ~]$ dpkg -l '*smapi*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-===================================
ii  tp-smapi-dkms  0.43-1       all          ThinkPad hardware/firmware access m
[chewie@falcon ~]$ dpkg -L tp-smapi-dkms |less
[chewie@falcon ~]$ lsmod |grep -i thinkpad
thinkpad_ec            16384  0
thinkpad_acpi         106496  1
nvram                  16384  1 thinkpad_acpi
snd                    94208  18 snd_hda_codec_generic,snd_hda_codec_conexant,snd_hwdep,snd_hda_intel,snd_hda_codec,snd_timer,thinkpad_acpi,snd_pcm
rfkill                 28672  7 bluetooth,thinkpad_acpi,cfg80211
battery                20480  1 thinkpad_acpi
video                  45056  2 thinkpad_acpi,i915
[chewie@falcon ~]$ 

Neofetch:

[chewie@falcon ~]$ neofetch
dmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmd   chewie@falcon 
dNm//////////////////////////////////mNd   ---------- 
dNd                                  dNd   OS: PureOS x86_64 
dNd                                  dNd   Host: 744943U ThinkPad X200 Tablet 
dNd                                  dNd   Kernel: 4.19.0-5-amd64 
dNd                                  dNd   Uptime: 8 mins 
dNd                                  dNd   Packages: 2362 (dpkg), 7 (flatpak) 
dNd                                  dNd   Shell: bash 5.0.3 
dNd                                  dNd   Resolution: 1280x800 
dNd                                  dNd   DE: Budgie 
dNm//////////////////////////////////mNd   WM: Mutter(Budgie) 
dmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmd   Theme: Default [GTK2/3] 
                                           Icons: Adwaita [GTK2/3] 
                                           Terminal: xfce4-terminal 
                                           Terminal Font: Monospace 12 
                                           CPU: Intel Core 2 L9600 (2) @ 2.134G 
                                           GPU: Intel Mobile 4 Series Chipset 
                                           Memory: 1346MiB / 3689MiB 
[chewie@falcon ~]$ sudo modprobe tp_smapi
modprobe: ERROR: could not insert 'tp_smapi': No such device or address
[chewie@falcon ~]$ sudo modprobe tp_smapi_dkms
modprobe: FATAL: Module tp_smapi_dkms not found in directory /lib/modules/4.19.0-5-amd64
[chewie@falcon ~]$ ls /lib/modules/4.19.0-5-amd64/ |grep -i smapi

(nothing there)

Any ideas? I didn’t get any errors when installing it.


#2

Here is my full lsmod output:

Module                  Size  Used by
rfcomm                 86016  4
fuse                  122880  7
acpi_call              16384  0
thinkpad_ec            16384  0
ctr                    16384  6
ccm                    20480  9
joydev                 24576  0
bnep                   24576  2
wacom_w8001            20480  0
serport                16384  1
uinput                 20480  1
btusb                  53248  0
btrtl                  16384  1 btusb
btbcm                  16384  1 btusb
btintel                24576  1 btusb
bluetooth             643072  27 btrtl,btintel,btbcm,bnep,btusb,rfcomm
drbg                   28672  1
ansi_cprng             16384  0
ecdh_generic           24576  1 bluetooth
crc16                  16384  1 bluetooth
arc4                   16384  2
msr                    16384  0
ath9k                 135168  0
ath9k_common           20480  1 ath9k
ath9k_hw              483328  2 ath9k_common,ath9k
ath                    36864  3 ath9k_common,ath9k,ath9k_hw
coretemp               16384  0
kvm_intel             245760  0
mac80211              815104  1 ath9k
kvm                   724992  1 kvm_intel
snd_hda_codec_conexant    24576  1
snd_hda_codec_generic    86016  1 snd_hda_codec_conexant
irqbypass              16384  1 kvm
snd_hda_intel          45056  4
cfg80211              761856  4 ath9k_common,ath9k,ath,mac80211
snd_hda_codec         151552  3 snd_hda_codec_generic,snd_hda_codec_conexant,snd_hda_intel
pcspkr                 16384  0
serio_raw              16384  0
snd_hda_core           94208  4 snd_hda_codec_generic,snd_hda_codec_conexant,snd_hda_intel,snd_hda_codec
sg                     36864  0
snd_hwdep              16384  1 snd_hda_codec
iTCO_wdt               16384  0
iTCO_vendor_support    16384  1 iTCO_wdt
thinkpad_acpi         106496  1
snd_pcm               114688  3 snd_hda_intel,snd_hda_codec,snd_hda_core
snd_timer              36864  1 snd_pcm
nvram                  16384  1 thinkpad_acpi
snd                    94208  18 snd_hda_codec_generic,snd_hda_codec_conexant,snd_hwdep,snd_hda_intel,snd_hda_codec,snd_timer,thinkpad_acpi,snd_pcm
soundcore              16384  1 snd
rfkill                 28672  7 bluetooth,thinkpad_acpi,cfg80211
ac                     16384  0
battery                20480  1 thinkpad_acpi
evdev                  28672  27
pcc_cpufreq            16384  0
acpi_cpufreq           24576  1
binfmt_misc            20480  1
parport_pc             32768  0
ppdev                  20480  0
lp                     20480  0
parport                57344  3 parport_pc,lp,ppdev
ip_tables              28672  0
x_tables               45056  1 ip_tables
autofs4                49152  2
btrfs                1384448  1
xor                    24576  1 btrfs
zstd_decompress        81920  1 btrfs
zstd_compress         172032  1 btrfs
xxhash                 16384  2 zstd_compress,zstd_decompress
raid6_pq              122880  1 btrfs
crc32c_generic         16384  1
libcrc32c              16384  1 btrfs
ecb                    16384  2
crypto_simd            16384  0
cryptd                 28672  1 crypto_simd
glue_helper            16384  0
aes_x86_64             20480  9
xts                    16384  1
algif_skcipher         16384  0
af_alg                 28672  1 algif_skcipher
dm_crypt               40960  1
dm_mod                155648  9 dm_crypt
sd_mod                 61440  2
i915                 1728512  16
ahci                   40960  1
libahci                40960  1 ahci
libata                270336  2 libahci,ahci
i2c_algo_bit           16384  1 i915
drm_kms_helper        200704  1 i915
scsi_mod              245760  3 sd_mod,libata,sg
psmouse               172032  0
uhci_hcd               49152  0
ehci_pci               16384  0
ehci_hcd               94208  1 ehci_pci
i2c_i801               28672  0
e1000e                282624  0
drm                   483328  8 drm_kms_helper,i915
lpc_ich                28672  0
usbcore               290816  4 ehci_pci,ehci_hcd,btusb,uhci_hcd
usb_common             16384  1 usbcore
thermal                20480  0
video                  45056  2 thinkpad_acpi,i915
button                 16384  0
[chewie@falcon ~]$ cd /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:2a/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/
[chewie@falcon BAT0]$ ls
alarm                   device              power          technology
capacity                energy_full         power_now      type
capacity_level          energy_full_design  present        uevent
charge_start_threshold  energy_now          serial_number  voltage_min_design
charge_stop_threshold   manufacturer        status         voltage_now
cycle_count             model_name          subsystem
[chewie@falcon BAT0]$ cat charge_start_threshold 
cat: charge_start_threshold: No such device
[chewie@falcon BAT0]$ head -9999 *
==> alarm <==
0

==> capacity <==
99

==> capacity_level <==
Normal

==> charge_start_threshold <==
head: error reading 'charge_start_threshold': No such device

==> charge_stop_threshold <==
head: error reading 'charge_stop_threshold': No such device

==> cycle_count <==
0

==> device <==
head: error reading 'device': Is a directory

==> energy_full <==
63130000

==> energy_full_design <==
65120000

==> energy_now <==
62970000

==> manufacturer <==
SANYO

==> model_name <==
92P1003

==> power <==
head: error reading 'power': Is a directory

==> power_now <==
0

==> present <==
1

==> serial_number <==
13920

==> status <==
Unknown

==> subsystem <==
head: error reading 'subsystem': Is a directory

==> technology <==
Li-ion

==> type <==
Battery

==> uevent <==
POWER_SUPPLY_NAME=BAT0
POWER_SUPPLY_STATUS=Unknown
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_TECHNOLOGY=Li-ion
POWER_SUPPLY_CYCLE_COUNT=0
POWER_SUPPLY_VOLTAGE_MIN_DESIGN=14800000
POWER_SUPPLY_VOLTAGE_NOW=16593000
POWER_SUPPLY_POWER_NOW=0
POWER_SUPPLY_ENERGY_FULL_DESIGN=65120000
POWER_SUPPLY_ENERGY_FULL=63130000
POWER_SUPPLY_ENERGY_NOW=62970000
POWER_SUPPLY_CAPACITY=99
POWER_SUPPLY_CAPACITY_LEVEL=Normal
POWER_SUPPLY_MODEL_NAME=92P1003
POWER_SUPPLY_MANUFACTURER=SANYO
POWER_SUPPLY_SERIAL_NUMBER=13920

==> voltage_min_design <==
14800000

==> voltage_now <==
16593000

#3

A little more info from tlp-stat:

[chewie@falcon BAT0]$ sudo tlp-stat -b 
--- TLP 1.1 --------------------------------------------

+++ ThinkPad Battery Features
tp-smapi   = inactive (kernel module 'tp_smapi' load error)
tpacpi-bat = inactive (unsupported hardware)

+++ Battery Status
/sys/class/power_supply/BAT0/manufacturer                   = SANYO
/sys/class/power_supply/BAT0/model_name                     = 92P1003
/sys/class/power_supply/BAT0/cycle_count                    = (not supported)
/sys/class/power_supply/BAT0/energy_full_design             =  65120 [mWh]
/sys/class/power_supply/BAT0/energy_full                    =  63130 [mWh]
/sys/class/power_supply/BAT0/energy_now                     =  61670 [mWh]
/sys/class/power_supply/BAT0/power_now                      =  12378 [mW]
/sys/class/power_supply/BAT0/status                         = Discharging

Charge                                                      =   97.7 [%]
Capacity                                                    =   96.9 [%]

#4

Just a thought, could it be that libreboot does not support smapi? Perhaps it was a function of the proprietary bios. I’d sure hate to lose it, though, because it really extends battery life in a huge way.


#5

Ok guys, it seems that there is a problem between libreboot and smapi. Might be fixed later on with some other implementation. Thanks for humoring me, I just wanted to post the “solution” in case someone else went looking for the same. Thanks!