Page 1 of 1

Need help installing tp_smapi [Solved]

Posted: Mon Mar 18, 2013 3:01 pm
by Neil
Trying to install tp_smapi on my X40 so I can control battery charge thresholds. I'm running Debian sid with XFCE 4.10 from experimental repos, kernel version is 2.6.32-5-686

Been trying to install tp-smapi following these directions from Thinkwiki, and have met with failure every time. Either packages are not found by apt, or the module-assistant method seemed most promising, but failed complaining of kernel headers not being installed, so I tried aptitude's suggestion of installing kernel-headers, but that package could not be found either.

So now I just need someone to walk me through this step-by-step to see what I'm doing wrong and help me get this done.

Re: Need help installing tp_smapi

Posted: Mon Mar 18, 2013 4:11 pm
by twistero
The "kernel headers" should be in a package named linux-headers-[architecture]. [architecture] may be "486", "686-pae", "amd64", etc. To determine the [architecture] part, search for a package named "linux-image-[architecture]" that's already installed on your system (that package contains your current kernel).

Once you have linux-headers-[architecture] installed, try installing "tp-smapi-dkms" first. (If you already tried that before, purge tp-smapi-dpms then reinstall.) DKMS should be a better way to handle kernel modules since it will automatically compile your modules for any new kernel versions you may install in the future.
Try the module-assistant method only if DKMS fails.

Re: Need help installing tp_smapi

Posted: Mon Mar 18, 2013 4:57 pm
by Neil
OK, thanks for the info twistero, I'll give it a go after a while. Seems running

Code: Select all

aptitude install tp-smapi-source
completely removed my kernel image. Once I figure out how to restore that, I'll try again with tp_smapi.

Re: Need help installing tp_smapi

Posted: Fri Mar 22, 2013 8:33 pm
by Neil
OK, I've re-installed the system, and have tp-smapi-dkms installed. Now what do I do to set charging thresholds? Thinkwiki offers this:
To set the thresholds for starting and stopping battery charging (in percent of current full charge capacity):
# echo 40 > /sys/devices/platform/smapi/BAT0/start_charge_thresh
# echo 70 > /sys/devices/platform/smapi/BAT0/stop_charge_thresh
# cat /sys/devices/platform/smapi/BAT0/*_charge_thresh
But I don't have a clue what to do with that info, or where to make changes. Is there a GUI front end like BMM, or do I have to edit a config file somewhere?

Edit: I found which files to edit...the default setting were start @ 96%, end @ 100%, so I changed those to what I wanted. But, I still don't understand the ThinkWiki directions. If I run those commands in a terminal, it doesn't seem to do anything.

Re: Need help installing tp_smapi

Posted: Sat Mar 23, 2013 2:26 am
by GomJabbar
Neil wrote:...If I run those commands in a terminal, it doesn't seem to do anything.
If you notice the hash mark # in front of the command, that means you have to be running terminal as root. You do not type the hash mark though, it is a prompt. To log in terminal as root, type su - {Enter} then your root password {Enter}. That's su <space> <hyphen>. Alternatively you can type sudo then the command and enter your user password {if sudo is set up on your system}

The echo command performs the changes, the cat command verifies the changes (displays the current state).

Re: Need help installing tp_smapi

Posted: Sat Mar 23, 2013 3:42 pm
by Neil
GomJabbar wrote:The echo command performs the changes, the cat command verifies the changes (displays the current state).
This I find to be very useful information. Even though I had already changed the settings, just knowing what the echo and cat commands mean will be useful for many other tasks, I'm sure. And likely not just for me, but the many others who come here looking for help with this.

Re: Need help installing tp_smapi [Solved]

Posted: Thu Jun 20, 2013 8:40 am
by ilpalazzo
This is my first post so good day to everyone.

I am a total linux noob, in fact I write this on my first Linux install ever. I seem to have problems with installing tp_smapi as well.

What I did:

- I opened a terminal window and typed su and provided root pasword,
- prompt changed to root@debian:~#
- I typed in 'aptitude install tp-smapi-dkms'
- it started to make its thing, asking me to provide with 1st of Debian install Discs,
- It finished to prompt without errors
- i typed in 'echo 40 > /sys/devices/platform/smapi/BAT0/start_charge_thresh' and got an error message that there's not such a device.

as a matter of fact there were not a folder called 'smapi' in the platform folder so I assume the install went bad. Is there a way to make sure the thing is properly installed?

I would be grateful for an advice.

Re: Need help installing tp_smapi [Solved]

Posted: Thu Jun 20, 2013 3:13 pm
by rumbero
ilpalazzo wrote:as a matter of fact there were not a folder called 'smapi' in the platform folder so I assume the install went bad. Is there a way to make sure the thing is properly installed?
Installation probably went just fine. This just creates a matching kernel module, but doesn't automatically load it afterwards.

You have to run a "sudo modprobe tp-smapi" first, and then verify with "lsmod | grep smapi" if it was actually loaded.

After that, add the module name to /etc/modules to make sure it is autoloaded during boot: "sudo echo tp-smapi >> /etc/modules".

Re: Need help installing tp_smapi [Solved]

Posted: Fri Jun 21, 2013 5:37 am
by ilpalazzo
Thanks, this helped. Perhaps you can advise me on one more thing. tp-smapi packade supposedly contains a modified HDAPS driver that needs to be installed separately. I've only been able to find instructions for doing this when the tp-smapi driver is compiled locally. Can you advise on how to do it in my case?