View Single Post
Posts: 59 | Thanked: 7 times | Joined on Jan 2010
#3587
Originally Posted by sdpkom View Post
a new version of my script used to change kernel settings based on battery temperature.

i am sorry for the typo in my last post.

usage instructions.

copy the contents into a file.
chmod +x FILENAME
type sudo :/FILENAME & (while in the same directory)


you can replace the word ideal, with any other profile (starving, xlv, lv or your own)
You can replace the speeds with any speed supported by the kernel
You can change the temperatures (currently 45, and 40)
You can change the frequency of probing (change sleep 30 to sleep 60 if you want it to run every minute).

It should be possible to move the modeprobe command outside the loop, but it does not work on my system.

One word of guidance, at low temperatures you can use lower voltages. When the temperature becomes higher, the same voltage would not work anymore.

Script follows

#!/bin/sh
set old="fhy"
set limits="yyu"
set oldlimits="r"
set new="rrr"
while test 2 -gt 1;
do
modprobe bq27x00_battery
read tmpr </sys/class/power_supply/bq27200-0/temp
if test $tmpr -gt 45;
then new="default";
limits="250 600";
else
if test $tmpr -gt 40;
then new="ideal";
limits="500 600";
else new="ideal";
limits="500 900"
fi
fi
if test "$old" != "$new"
then
/usr/sbin/kernel-config load "$new";
oldlimits="ttt";
old=$new;
fi
if test "$limits" != "$oldlimits";
then
/usr/sbin/kernel-config limits $limits;
oldlimits=$limits;
fi
sleep 30
done
i finally manage to make the script work , but how can i check that it really works ?
because i run sygic under the sun for 10minutes , with outside temprature 29 celsious , and my phone continue to run with max 900
, is there any program for checking my cpu temprature?

Last edited by dimkit; 2010-05-11 at 17:45.