You are not logged in.

#1 2010-03-25 18:14:08

toad
Member
From: if only I knew
Registered: 2008-12-22
Posts: 1,775
Website

[SOLVED] - tp_smapi on a T41 - charge_thresh

EDITED:

Okay, I've edited this to pieces. My problem was that I had a laptop (T41) which doesn't support full battery management. It does now. All findings can be found in the tp_smapi wiki - updated with a script for automagic battery management even for partially supported laptops - many thanks, Demian smile

Last edited by toad (2010-04-14 21:02:10)


never trust a toad...
::Grateful ArchDonor::
::Grateful Wikipedia Donor::

Offline

#2 2010-03-25 22:09:38

toad
Member
From: if only I knew
Registered: 2008-12-22
Posts: 1,775
Website

Re: [SOLVED] - tp_smapi on a T41 - charge_thresh

Oh, and I'm using the Xfce Power Manager...


never trust a toad...
::Grateful ArchDonor::
::Grateful Wikipedia Donor::

Offline

#3 2010-03-25 23:33:47

demian
Member
From: Frankfurt, Germany
Registered: 2009-05-06
Posts: 709

Re: [SOLVED] - tp_smapi on a T41 - charge_thresh

Well, are you using tp_smapi on a Thinkpad?
If so, did you try manually altering the thresholds? If your battery is currently charging at 80% you need to set the start threshold lower than 80 to make it stop charging.

For me, tp-smapi works perfectly fine. I install it from the AUR and then just modprobe it.
What's the output of the following commands?
cat /sys/devices/platform/smapi/BAT0/start_charge_thresh
cat /sys/devices/platform/smapi/BAT0/stop_charge_thresh

Snippet of my rc.local

echo 35 > /sys/devices/platform/smapi/BAT0/start_charge_thresh
echo 80 > /sys/devices/platform/smapi/BAT0/stop_charge_thresh
echo 240 > /sys/devices/platform/i8042/serio1/sensitivity
echo 160 > /sys/devices/platform/i8042/serio1/speed

Those alter trackpoint speed and battery charge thresholds.

Regards,
demian

P.S.: I'd get rid of Xfce Power Manager to avoid conflicts or confusion in power management. You can use this script to query battery information.

Last edited by demian (2010-03-25 23:37:36)


no place like /home
github

Offline

#4 2010-03-26 07:11:58

toad
Member
From: if only I knew
Registered: 2008-12-22
Posts: 1,775
Website

Re: [SOLVED] - tp_smapi on a T41 - charge_thresh

Cheers demian,

thanks for replying! First off, it is a T41. I ran those cat commands:

toad@archtop 769\2 /home/toad > cat /sys/devices/platform/smapi/BAT0/start_charge_thresh
40

toad@archtop 769\3 /home/toad > cat /sys/devices/platform/smapi/BAT0/stop_charge_thresh
cat: /sys/devices/platform/smapi/BAT0/stop_charge_thresh: Operation not supported

Bah hmm I suppose it is off to Mr. Google and hope he can throw something useful my way.

I have removed the xfce power manager - at least for the time being. It is dead handy though for dimming and killing the screen...


never trust a toad...
::Grateful ArchDonor::
::Grateful Wikipedia Donor::

Offline

#5 2010-03-26 07:23:44

toad
Member
From: if only I knew
Registered: 2008-12-22
Posts: 1,775
Website

Re: [SOLVED] - tp_smapi on a T41 - charge_thresh

Okay, looks like my machine doesn't support it after all that: http://www.thinkwiki.org/wiki/Tp_smapi# … fic_status - bah!!!


never trust a toad...
::Grateful ArchDonor::
::Grateful Wikipedia Donor::

Offline

#6 2010-03-26 07:45:19

toad
Member
From: if only I knew
Registered: 2008-12-22
Posts: 1,775
Website

Re: [SOLVED] - tp_smapi on a T41 - charge_thresh

Okay, I've amended the tp_smapi wiki so people check compatibility first and asked in the thinkpad forum whether there are any roundabouts - has anybody managed to get it to work on a T41?


never trust a toad...
::Grateful ArchDonor::
::Grateful Wikipedia Donor::

Offline

#7 2010-04-08 04:43:38

toad
Member
From: if only I knew
Registered: 2008-12-22
Posts: 1,775
Website

Re: [SOLVED] - tp_smapi on a T41 - charge_thresh

This is still bugging me - I've somehow managed to get the battery to stop charging by adding the script /usr/sbin/set_battery_thresholds to /etc/acpi/handler.sh

This tells me that it _could_ work on a T41, even if only manually. Will explore further and use this thread as a sort of monologue and to keep track (and increase my post count smile)


never trust a toad...
::Grateful ArchDonor::
::Grateful Wikipedia Donor::

Offline

#8 2010-04-08 11:15:05

demian
Member
From: Frankfurt, Germany
Registered: 2009-05-06
Posts: 709

Re: [SOLVED] - tp_smapi on a T41 - charge_thresh

If you set the start_charge_thresh high enough (i.e. 90 or higher) the battery won't charge whenever the battery charge is below that value. Maybe that's what's happened. Would be pretty sweet though if you somehow managed to create a stop_charge value.

Regards,
demian

Last edited by demian (2010-04-13 10:09:53)


no place like /home
github

Offline

#9 2010-04-08 13:43:39

toad
Member
From: if only I knew
Registered: 2008-12-22
Posts: 1,775
Website

Re: [SOLVED] - tp_smapi on a T41 - charge_thresh

Ta,

now that would be an acceptable scenario: charge the battery and when it reaches 79% invoke the start_charge with a value of 80%. Heck, one could even do a cron to watch the output of the battery charge and make it into a decent enough script.

However... I don't seem to be able to find a way of getting the machine to be flexible about it. This start_charge kicks in and whatever I do, like set it to 40 after or restarting the tp_smapi module or both - the battery won't charge again until after a reboot.

Any idea what I'm missing?


never trust a toad...
::Grateful ArchDonor::
::Grateful Wikipedia Donor::

Offline

#10 2010-04-13 10:11:18

demian
Member
From: Frankfurt, Germany
Registered: 2009-05-06
Posts: 709

Re: [SOLVED] - tp_smapi on a T41 - charge_thresh

If you want it to charge again you might have to unplug and plug back in the AC after you set the start treshold to a low value.
Maybe removing and reinserting thinkpad-acpi will suffice, too.

Last edited by demian (2010-04-13 10:16:47)


no place like /home
github

Offline

#11 2010-04-13 10:17:38

toad
Member
From: if only I knew
Registered: 2008-12-22
Posts: 1,775
Website

Re: [SOLVED] - tp_smapi on a T41 - charge_thresh

Yeah, quite a pita. Will try modprobing thinkpad-acpi - thanks for the tip smile


never trust a toad...
::Grateful ArchDonor::
::Grateful Wikipedia Donor::

Offline

#12 2010-04-13 10:55:16

toad
Member
From: if only I knew
Registered: 2008-12-22
Posts: 1,775
Website

Re: [SOLVED] - tp_smapi on a T41 - charge_thresh

Bah - thinkpad -acpi is in use and won't let me do anything with it. At the mo it looks like I have to actually reboot the computer to get it to charge again - not happy about that. Might start a specific thread to get help on that.

EDIT:

How do I reset or rather get rid of the value in sys/devices/platform/smapi/BAT0/start_charge_thresh ? That might have something to do with it...

Last edited by toad (2010-04-13 11:50:56)


never trust a toad...
::Grateful ArchDonor::
::Grateful Wikipedia Donor::

Offline

#13 2010-04-13 22:24:16

demian
Member
From: Frankfurt, Germany
Registered: 2009-05-06
Posts: 709

Re: [SOLVED] - tp_smapi on a T41 - charge_thresh

As far as i know the start_charge_tresh entry gets saved by the battery electronics so despite my suggestion unloading/reloading modules probably won't change a thing.
You'd have to overwrite the start_tresh. Are you sure you didn't just misstype or edit the tresh file with insufficient priviliges?

You _could_ try force unloading thinkpad-acpi but according to the manual it's risky and - as I said - I don't think it'll make a difference. Especially since tp_smapi is controlling the battery when loaded.


Edit: Also, i just realized, i was talking nonsense before. Instead of setting the start_charge tresh very high you should be doing the exact opposite if you don't want the battery to charge. If the battery is at 50% and you'd want it to stop charging you'd have to set the start_charge_tresh to 49 or lower.
Sorry about that. Maybe this confusion was the source of your battery not charging when it supposedly should have been charging.

Last edited by demian (2010-04-14 12:54:55)


no place like /home
github

Offline

Board footer

Powered by FluxBB