Using tp_smapi on Fedora 11 for battery charge levels

Solaris, RedHat, FreeBSD and the like
Post Reply
Message
Author
Dead1nside
Senior Member
Senior Member
Posts: 780
Joined: Mon Jul 24, 2006 8:32 pm
Location: Reading, UK
Contact:

Using tp_smapi on Fedora 11 for battery charge levels

#1 Post by Dead1nside » Sun Dec 13, 2009 8:40 pm

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.
T41p 2373-GHG / 1.5Ghz 'Banias' / NMB Keyboard
T61 14.1'' 7661-CTO / Vista Business / WXGA / T7300 / 2GB RAM / 80GB HDD / X3100 / 3945ABG / NMB KB /
T400 14.1'' 2768-CTO / Vista Business / WXGA / P8400 / 4GB RAM / 200GB 7200RPM / HD 3470 / 5300AGN / WWAN / NMB KB

Superego
Sophomore Member
Posts: 239
Joined: Tue Feb 20, 2007 4:05 pm
Location: Minneapolis, MN

Re: Using tp_smapi on Fedora 11 for battery charge levels

#2 Post by Superego » Mon Dec 14, 2009 12:08 pm

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?
W510: i7-820QM / 8GB 1066 RAM/ 1 GB NVIDIA Quadro FX 880M / 500GB 7200rpm / 15.6" HD 1080 / Arch Linux

Dead1nside
Senior Member
Senior Member
Posts: 780
Joined: Mon Jul 24, 2006 8:32 pm
Location: Reading, UK
Contact:

Re: Using tp_smapi on Fedora 11 for battery charge levels

#3 Post by Dead1nside » Mon Dec 14, 2009 8:29 pm

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.
T41p 2373-GHG / 1.5Ghz 'Banias' / NMB Keyboard
T61 14.1'' 7661-CTO / Vista Business / WXGA / T7300 / 2GB RAM / 80GB HDD / X3100 / 3945ABG / NMB KB /
T400 14.1'' 2768-CTO / Vista Business / WXGA / P8400 / 4GB RAM / 200GB 7200RPM / HD 3470 / 5300AGN / WWAN / NMB KB

Dead1nside
Senior Member
Senior Member
Posts: 780
Joined: Mon Jul 24, 2006 8:32 pm
Location: Reading, UK
Contact:

Re: Using tp_smapi on Fedora 11 for battery charge levels

#4 Post by Dead1nside » Mon Dec 28, 2009 8:20 am

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.
T41p 2373-GHG / 1.5Ghz 'Banias' / NMB Keyboard
T61 14.1'' 7661-CTO / Vista Business / WXGA / T7300 / 2GB RAM / 80GB HDD / X3100 / 3945ABG / NMB KB /
T400 14.1'' 2768-CTO / Vista Business / WXGA / P8400 / 4GB RAM / 200GB 7200RPM / HD 3470 / 5300AGN / WWAN / NMB KB

Post Reply
  • Similar Topics
    Replies
    Views
    Last post

Return to “Linux Questions”

Who is online

Users browsing this forum: No registered users and 0 guests