Editing N900 software power management

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 88: Line 88:
if [[ -e /sys/class/power_supply/bq27200-0/current_now ]]
if [[ -e /sys/class/power_supply/bq27200-0/current_now ]]
then
then
-
  current_read='cat /sys/class/power_supply/bq27200-0/current_now'
+
current_read='cat /sys/class/power_supply/bq27200-0/current_now'
-
  echo Using kernel battery driver to read current.
+
echo Using kernel battery driver to read current.
else
else
-
  if  command -v i2cget >/dev/null
+
if  command -v i2cget >/dev/null
-
  then
+
then
-
    current_read='i2cget -y 2 0x55 0x14 w'
+
current_read='i2cget -y 2 0x55 0x14 w'
-
    echo "Using I2C to read charge meter directly"
+
echo Using I2C to read charge meter directly
-
  else
+
else
-
    echo "Cannot find a way to read the charge meter."
+
echo Cannot find a way to read the charge meter.
-
    echo "Either i2ctools from extras-devel must be installed, or the power kernel with the bq27x00_battery module which normally accompanies it."
+
echo Either i2ctools from extras-devel must be installed, or the power kernel with the bq27x00_battery module which normally accompanies it.
-
    echo "Exiting."
+
echo Exiting.
-
    exit
+
exit
-
  fi
+
fi
fi
fi
#                                      Reset timer stats.
#                                      Reset timer stats.
Line 106: Line 106:
while true        #                    Loop while printing stats
while true        #                    Loop while printing stats
do
do
-
  echo 1 >/proc/timer_stats  #          Start gathering stats
+
echo 1 >/proc/timer_stats  #          Start gathering stats
-
  sleep 5                    #          Sleep 5s
+
sleep 5                    #          Sleep 5s
-
  echo 0 >/proc/timer_stats  #          Finish stats.
+
echo 0 >/proc/timer_stats  #          Finish stats.
-
#                                       Print output, assuming sense resistor is 22 milliohms.
+
#                                     Print output, assuming sense resistor is 22 milliohms.
-
  echo `date` $((`$current_read` * 3570 / 22 / 1000))mA `tail -1 /proc/timer_stats`
+
echo `date` $((`$current_read` * 3570 / 22 / 1000))mA `tail -1 /proc/timer_stats`
done
done
</source>
</source>
Line 123: Line 123:
  ...
  ...
-
This shows that immediately after starting, the script measured over the first 5 s (actually for the 5s window that ended before script started) a power consumption of 25 mA. This will discharge in one hour the battery by 25 milliamp-hours. It has a total capacity of around 1200 mAh - so will last about 1200 mAh/25 mA = 75 hours (roughly).
+
This shows that immediately after starting, the script measured over the first 5 s a power consumption of 25 mA. This will discharge in one hour the battery by 25 milliamp-hours. It has a total capacity of around 1200 mAh - so will last about 1200 mAh/25 mA = 75 hours (roughly).
Wifi however uses a significant amount of power. By comparison, this is the result when redirecting the output to a file.
Wifi however uses a significant amount of power. By comparison, this is the result when redirecting the output to a file.

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)