Page 1 of 1

Using tp_smapi on Fedora 11 for battery charge levels

Posted: Sun Dec 13, 2009 8:40 pm
by Dead1nside
Hi,

I've found an akmod package for tp_smapi but I don't actually know how to use it to set the battery charge levels to start when under 20% and stop when at 80% -- I did try an echo command that I found but would appreciate it if anyone could point me in the right direction.

Thanks.

Re: Using tp_smapi on Fedora 11 for battery charge levels

Posted: Mon Dec 14, 2009 12:08 pm
by Superego
To set the thresholds you simply need to enter the following:

Code: Select all

# echo 20 > /sys/devices/platform/smapi/BAT0/start_charge_thresh 
# echo 80 > /sys/devices/platform/smapi/BAT0/stop_charge_thresh 
You can check the status by using:

Code: Select all

# cat /sys/devices/platform/smapi/BAT0/*_charge_thresh
If you want to have the thresholds set at startup you can just add the echo lines to /etc/profile.

You said you used an echo command already; is it the same one I have above? If so, did it work? Do you have the tp_smapi kernel module running? I'm not familiar with akmod packages...does that mean you're using a custom kernel?

Re: Using tp_smapi on Fedora 11 for battery charge levels

Posted: Mon Dec 14, 2009 8:29 pm
by Dead1nside
Superego wrote:To set the thresholds you simply need to enter the following:

Code: Select all

# echo 20 > /sys/devices/platform/smapi/BAT0/start_charge_thresh 
# echo 80 > /sys/devices/platform/smapi/BAT0/stop_charge_thresh 
You can check the status by using:

Code: Select all

# cat /sys/devices/platform/smapi/BAT0/*_charge_thresh
If you want to have the thresholds set at startup you can just add the echo lines to /etc/profile.

You said you used an echo command already; is it the same one I have above? If so, did it work? Do you have the tp_smapi kernel module running? I'm not familiar with akmod packages...does that mean you're using a custom kernel?
Thank you for your reply.

I don't get any response from the former commands, which look an awful lot like the ones I used before. I am using them as root but I just get 'No such file or directory' for all of your commands.

An akmod is like a kmod package but it automatically recompiles itself when you install a new kernel instead of having to manually find a matching kmod.

Re: Using tp_smapi on Fedora 11 for battery charge levels

Posted: Mon Dec 28, 2009 8:20 am
by Dead1nside
Edit: I've written an article on how to get it to work on Fedora 14, with akmods.
http://www.jonathanpritchard.com/blog/h ... ora-14-271

I've got it to work now after I upgraded to Fedora 12.

You can find a pre-built akmod package for Fedora (although not the latest release, it doesn't matter) here http://izhar.fedorapeople.org/tp_smapi-kmod/ .

There is a good guide on akmods here, http://fedorasolved.org/Members/zcat/akmods .

You need the akmod and kmod tools from the repositories, trying to install the akmod with the following, will provide you with the relevant warnings telling you what else you need:

Code: Select all

rpm -ivh akmod-tp_smapi-0.40-1.fc11.i686.rpm
You will need the relevant kernel-devel package for your kernel, if you're using a PAE kernel make sure you get the kernel-PAE-devel.

Once it is installed do as root:

Code: Select all

# service akmods restart
This will rebuild all akmods and should report a success.

You can now check that the package is installed as a kernel module by doing:

Code: Select all

modprobe -l
It should be on that list.

Now you can restart, or load tp_smapi manually with:

Code: Select all

# modprobe tp_smapi
I have noticed that you need to actually switch to root and not use sudo if you want to use the echo style commands to change the battery levels, apart from that it appears to work, I have not tested it though.