<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://bugs.maemo.com/skins/common/feed.css?207"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>N900 Hardware Charge Meter/bq-script - Revision history</title>
		<link>http://bugs.maemo.com/index.php?title=N900_Hardware_Charge_Meter/bq-script&amp;action=history</link>
		<description>Revision history for this page on the wiki</description>
		<language>en</language>
		<generator>MediaWiki 1.15.5-7</generator>
		<lastBuildDate>Fri, 10 Apr 2026 11:36:59 GMT</lastBuildDate>
		<item>
			<title>amigadave:&amp;#32;use &lt;source&gt;, categorize</title>
			<link>http://bugs.maemo.com/index.php?title=N900_Hardware_Charge_Meter/bq-script&amp;diff=38504&amp;oldid=prev</link>
			<guid>http://bugs.maemo.com/index.php?title=N900_Hardware_Charge_Meter/bq-script&amp;diff=38504&amp;oldid=prev</guid>
			<description>&lt;p&gt;use &amp;lt;source&amp;gt;, categorize&lt;/p&gt;

		&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
		&lt;col class='diff-marker' /&gt;
		&lt;col class='diff-content' /&gt;
		&lt;col class='diff-marker' /&gt;
		&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 09:16, 13 September 2010&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;pre&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;source lang=&amp;quot;bash&amp;quot;&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#!/bin/sh&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#!/bin/sh&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 227:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 227:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;done # main&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;done # main&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;pre&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;source&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[[Category:N900 Hardware]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff generator: internal 2026-04-10 11:36:59 --&gt;
&lt;/table&gt;</description>
			<pubDate>Mon, 13 Sep 2010 09:16:22 GMT</pubDate>			<dc:creator>amigadave</dc:creator>			<comments>http://bugs.maemo.com/Talk:N900_Hardware_Charge_Meter/bq-script</comments>		</item>
		<item>
			<title>joerg_rw at 22:49, 11 September 2010</title>
			<link>http://bugs.maemo.com/index.php?title=N900_Hardware_Charge_Meter/bq-script&amp;diff=38467&amp;oldid=prev</link>
			<guid>http://bugs.maemo.com/index.php?title=N900_Hardware_Charge_Meter/bq-script&amp;diff=38467&amp;oldid=prev</guid>
			<description>&lt;p&gt;&lt;/p&gt;

		&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
		&lt;col class='diff-marker' /&gt;
		&lt;col class='diff-content' /&gt;
		&lt;col class='diff-marker' /&gt;
		&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 22:49, 11 September 2010&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;pre&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#!/bin/sh&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#!/bin/sh&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 226:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 227:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;done # main&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;done # main&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/pre&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff generator: internal 2026-04-10 11:36:59 --&gt;
&lt;/table&gt;</description>
			<pubDate>Sat, 11 Sep 2010 22:49:23 GMT</pubDate>			<dc:creator>joerg_rw</dc:creator>			<comments>http://bugs.maemo.com/Talk:N900_Hardware_Charge_Meter/bq-script</comments>		</item>
		<item>
			<title>joerg_rw:&amp;#32;copy of script in bq.tar</title>
			<link>http://bugs.maemo.com/index.php?title=N900_Hardware_Charge_Meter/bq-script&amp;diff=38465&amp;oldid=prev</link>
			<guid>http://bugs.maemo.com/index.php?title=N900_Hardware_Charge_Meter/bq-script&amp;diff=38465&amp;oldid=prev</guid>
			<description>&lt;p&gt;copy of script in bq.tar&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
RS=20&lt;br /&gt;
&lt;br /&gt;
# 1 = Warn if battery is getting low&lt;br /&gt;
WARN=1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Internal: Have we warned user?&lt;br /&gt;
FIRSTWARNING=0&lt;br /&gt;
SECONDWARNING=0&lt;br /&gt;
&lt;br /&gt;
debugecho()&lt;br /&gt;
{&lt;br /&gt;
        if [ $LOOPMODE -eq 0 ]; then&lt;br /&gt;
                echo $*&lt;br /&gt;
        fi&lt;br /&gt;
}&lt;br /&gt;
debugechon()&lt;br /&gt;
{&lt;br /&gt;
        if [ $LOOPMODE -eq 0 ]; then&lt;br /&gt;
                echo -n $*&lt;br /&gt;
        fi&lt;br /&gt;
}&lt;br /&gt;
dot()&lt;br /&gt;
{&lt;br /&gt;
        debugechon &amp;quot;.&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
if [ ! -e ./i2cget ] ; then&lt;br /&gt;
        echo &amp;quot;Need ./i2cget&amp;quot;&lt;br /&gt;
        return&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
LOOPMODE=0&lt;br /&gt;
LOOPCOUNT=0&lt;br /&gt;
if [ -n &amp;quot;$1&amp;quot; ] ; then&lt;br /&gt;
        if [ $(($1)) -gt 1 ] ; then&lt;br /&gt;
                LOOPMODE=$(($1))&lt;br /&gt;
        else&lt;br /&gt;
                LOOPMODE=1&lt;br /&gt;
        fi&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
echo LOOPMODE=$LOOPMODE&lt;br /&gt;
&lt;br /&gt;
doit=1&lt;br /&gt;
while [ $doit -eq 1 ] ; do ## MAIN LOOP ##&lt;br /&gt;
&lt;br /&gt;
doit=0&lt;br /&gt;
############## Data acquisition ##############&lt;br /&gt;
&lt;br /&gt;
#debugechon &amp;quot;About to stop bme. &amp;quot;&lt;br /&gt;
#killall -STOP bme_RX-51&lt;br /&gt;
#debugecho &amp;quot;Bme stopped.&amp;quot;&lt;br /&gt;
# sleep 1;&lt;br /&gt;
debugechon &amp;quot;Reading values&amp;quot;&lt;br /&gt;
&lt;br /&gt;
AR=$(./i2cget -y 2 0x55 0x02 w) ; dot&lt;br /&gt;
ARTTE=$(./i2cget -y 2 0x55 0x04 w); dot&lt;br /&gt;
VOLT=$(./i2cget -y 2 0x55 0x08 w) ; dot&lt;br /&gt;
TEMP=$(./i2cget -y 2 0x55 0x06 w) ; dot&lt;br /&gt;
CSOC=$(./i2cget -y 2 0x55 0x2c)  ; dot&lt;br /&gt;
RSOC=$(./i2cget -y 2 0x55 0x0b)  ; dot&lt;br /&gt;
NAC=$(./i2cget -y 2 0x55 0x0c w) ; dot&lt;br /&gt;
CACD=$(./i2cget -y 2 0x55 0x0e w) ; dot&lt;br /&gt;
CACT=$(./i2cget -y 2 0x55 0x10 w); dot&lt;br /&gt;
AI=$(./i2cget -y 2 0x55 0x14 w)  ; dot&lt;br /&gt;
TTF=$(./i2cget -y 2 0x55 0x18 w) ; dot&lt;br /&gt;
TTE=$(./i2cget -y 2 0x55 0x16 w) ; dot&lt;br /&gt;
FLAGS=$(./i2cget -y 2 0x55 0x0A) ; dot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if [ $LOOPMODE -eq 0 ] ; then&lt;br /&gt;
CYCL=$(./i2cget -y 2 0x55 0x28 w) ; dot&lt;br /&gt;
CYCLTL=$(./i2cget -y 2 0x55 0x2a w) ; dot&lt;br /&gt;
SI=$(./i2cget -y 2 0x55 0x1A w) ; dot&lt;br /&gt;
STTE=$(./i2cget -y 2 0x55 0x1C w); dot&lt;br /&gt;
MLI=$(./i2cget -y 2 0x55 0x1e w) ; dot&lt;br /&gt;
MLTTE=$(./i2cget -y 2 0x55 0x20 w); dot&lt;br /&gt;
LMD=$(./i2cget -y 2 0x55 0x12 w) ; dot&lt;br /&gt;
&lt;br /&gt;
ILMD=$(./i2cget -y 2 0x55 0x76); dot&lt;br /&gt;
EDVF=$(./i2cget -y 2 0x55 0x77); dot&lt;br /&gt;
EDV1=$(./i2cget -y 2 0x55 0x78); dot&lt;br /&gt;
ISLC=$(./i2cget -y 2 0x55 0x79); dot&lt;br /&gt;
DMFSD=$(./i2cget -y 2 0x55 0x7A); dot&lt;br /&gt;
TAPER=$(./i2cget -y 2 0x55 0x7B); dot&lt;br /&gt;
#TODO: PKCFG&lt;br /&gt;
IMLC=$(./i2cget -y 2 0x55 0x7D); dot&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
debugecho &amp;quot;done.&amp;quot;&lt;br /&gt;
#debugechon  &amp;quot;Waking up bme.&amp;quot;&lt;br /&gt;
#killall -CONT bme_RX-51&lt;br /&gt;
#debugecho &amp;quot;Done. &amp;quot;&lt;br /&gt;
debugecho &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
############## Calculate ##############&lt;br /&gt;
&lt;br /&gt;
CSOC=$(($CSOC))                      # CSOC Compensated state of charge %. CACT/LMD * 100&lt;br /&gt;
RSOC=$(($RSOC))                      # RSOC Relative state of charge %. NAC/LMD * 100&lt;br /&gt;
NAC=$(($NAC * 3570 / $RS / 1000))    # NAC Nominal available capaciy, mAh.&lt;br /&gt;
CACD=$(($CACD * 3570 / $RS / 1000))  # CACD Discharge rate compensated available capacity, mAh.&lt;br /&gt;
CACT=$(($CACT * 3570 / $RS / 1000))  # CACT Temperature compensated CACD, mAh.&lt;br /&gt;
AI=$(($AI * 3570 / $RS / 1000))      # AI Average (last 5.12 seconds) current, mA.&lt;br /&gt;
VOLT=$(($VOLT))                      # VOLT Battery voltage, mV.&lt;br /&gt;
TTF=$(($TTF))                        # TTF Time to Full minutes. 65535 if no charging.&lt;br /&gt;
TTE=$(($TTE))                        # TTE Time to Empty minutes. 65535 if charging.&lt;br /&gt;
&lt;br /&gt;
F=$(($FLAGS))&lt;br /&gt;
FLAGS_CHARGE=$(($F/128))             # There is charging activity. AI is measuring charge current.&lt;br /&gt;
F=$(($F-$F/128*128))&lt;br /&gt;
FLAGS_NOACT=$(($F/64))               # No charge/discharge activity detected.&lt;br /&gt;
F=$(($F-$F/64*64))&lt;br /&gt;
FLAGS_IMIN=$(($F/32))                # Charge current has tapered off (battery charge is near/at completion)&lt;br /&gt;
F=$(($F-$F/32*32))&lt;br /&gt;
FLAGS_CI=$(($F/16))                  # Capacity inaccurate. &amp;gt;32 cycles since last learning cycle.&lt;br /&gt;
F=$(($F-$F/16*16))&lt;br /&gt;
FLAGS_CALIP=$(($F/8))                # External offset calibration in progress.&lt;br /&gt;
F=$(($F-$F/8*8))&lt;br /&gt;
FLAGS_VDQ=$(($F/4))                  # Valid discharge. All requirements met for learning the battery's capacity when reaching EDV1&lt;br /&gt;
F=$(($F-$F/4*4))&lt;br /&gt;
FLAGS_EDV1=$(($F/2))                 # First end of discharge-voltage flag. Battery voltage is at or below preprogrammed EDV1 threshold. If VDQ is 1, LMD is updated and VDQ set to 0.&lt;br /&gt;
F=$(($F-$F/2*2))&lt;br /&gt;
FLAGS_EDVF=$F                        # Final end of discharge-voltage flag. The battery has discharged to 0% threshold.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if [ $LOOPMODE -eq 0 ] ; then&lt;br /&gt;
AR=$(($AR * 3570 / $RS / 1000))      # AR At-rate&lt;br /&gt;
ARTTE=$(($ARTTE))                    # At-rate time to empty&lt;br /&gt;
LMD=$(($LMD * 3570 / $RS / 1000))    # LM Last measured discharge, mAh.&lt;br /&gt;
SI=$(($SI * 3570/ $RS / 1000))       # SI Standby Current, mA.&lt;br /&gt;
STTE=$(($STTE))                      # STTE Time to empty at standby, minutes.&lt;br /&gt;
MLI=$(($MLI * 3570 / $RS / 1000))    # MLI Maximum Load Current, mA.&lt;br /&gt;
MLTTE=$(($MLTTE))                    # MLTTE Time to empty at maximum load, minutes.&lt;br /&gt;
CYCL=$(($CYCL))                      # CYCL Cycles since last learning cycle (last time LMD was updated)&lt;br /&gt;
CYCLTL=$(($CYCLTL))                  # CYCLTL Cycles since last full reset.&lt;br /&gt;
&lt;br /&gt;
ILMD=$(($ILMD * 913920 / $RS / 1000)) # eeprom Initial Last Measured Discharge. LMD = ILMD if no valid learning cycle has been completed.&lt;br /&gt;
EDVF=$(($EDVF * 8 + 8*256))           # eeprom End of discharge voltage threshold.&lt;br /&gt;
EDV1=$(($EDV1 * 8 + 8*256))           # eeprom 6.25% Capacity voltage threshold.&lt;br /&gt;
ISLC=$(($ISLC * 7140 / $RS / 1000))   # eeprom Initial standby load current.&lt;br /&gt;
&lt;br /&gt;
# DMF in bits 4:7&lt;br /&gt;
DMF=$(($DMFSD/16))&lt;br /&gt;
# SD in bits 0:3&lt;br /&gt;
SD=$(($DMFSD-$DMF*16))&lt;br /&gt;
DMF=$(($DMF * 4900))                 # eeprom Digital Magnitude Filter, nanoVolts&lt;br /&gt;
SD=$((1610 / $SD))                   # eeprom Self Discharge rate, thousandth of percent (1/1000 %) per day at 25 degrees celcius&lt;br /&gt;
&lt;br /&gt;
AGELMD=$(($TAPER/128))               # eeprom Battery capacity aging estimation on/off&lt;br /&gt;
TAPER=$(($TAPER-$AGELMD*128))&lt;br /&gt;
TAPER=$(($TAPER * 228000 / $RS / 1000))  # eeprom Taper current mA&lt;br /&gt;
&lt;br /&gt;
IMLC=$(($IMLC * 457000 / $RS / 1000))    # eeprom Initial Max Load Current&lt;br /&gt;
&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
############## Display ##############&lt;br /&gt;
&lt;br /&gt;
if [ $WARN -eq 1 ] ; then&lt;br /&gt;
        if [ $FLAGS_EDVF -eq 1 ] &amp;amp;&amp;amp; [ $SECONDWARNING -eq 0 ] ; then &lt;br /&gt;
                dbus-send --print-reply  --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteDialog string:'Battery at CRITICAL low level' uint32:0 string:'ok'&lt;br /&gt;
                SECONDWARNING=1&lt;br /&gt;
        else &lt;br /&gt;
                SECONDWARNING=0&lt;br /&gt;
                if [ $FLAGS_EDV1 -eq 1 ] &amp;amp;&amp;amp; [ $FIRSTWARNING -eq 0 ] ; then&lt;br /&gt;
                        dbus-send --print-reply --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteDialog string:'Warning: Battery Low' uint32:0 string:'ok'&lt;br /&gt;
                        FIRSTWARNING=1&lt;br /&gt;
                else&lt;br /&gt;
                        FIRSWARNING=0&lt;br /&gt;
                fi&lt;br /&gt;
        fi&lt;br /&gt;
fi&lt;br /&gt;
if [ $LOOPMODE -eq 0 ] ; then &lt;br /&gt;
&lt;br /&gt;
echo -n CSOC: $CSOC &amp;quot;% &amp;quot;&lt;br /&gt;
echo RSOC: $RSOC &amp;quot;%&amp;quot;&lt;br /&gt;
echo Average Current: $AI mA&lt;br /&gt;
echo -n TTF: $(($TTF)) &amp;quot;minutes &amp;quot;&lt;br /&gt;
echo TTE: $(($TTE)) minutes&lt;br /&gt;
&lt;br /&gt;
echo -n NAC: $NAC &amp;quot;mAh &amp;quot;&lt;br /&gt;
echo -n CACD: $CACD &amp;quot;mAh &amp;quot;&lt;br /&gt;
echo CACT: $CACT &amp;quot;mAh &amp;quot;&lt;br /&gt;
&lt;br /&gt;
echo -n SI: $SI &amp;quot;mA &amp;quot;&lt;br /&gt;
echo  STTE: $STTE &amp;quot;minutes&amp;quot;&lt;br /&gt;
&lt;br /&gt;
echo -n MLI: $MLI &amp;quot;mA &amp;quot;&lt;br /&gt;
echo  MLTTE: $MLTTE &amp;quot;minutes&amp;quot;&lt;br /&gt;
&lt;br /&gt;
echo -n AR: $AR &amp;quot;mA &amp;quot;&lt;br /&gt;
echo ARTTE: $ARTTE &amp;quot;minutes&amp;quot;&lt;br /&gt;
&lt;br /&gt;
echo Last Measured Discharge: $LMD mAh&lt;br /&gt;
echo Cycle Count since Learning: $CYCL Total Cycle Count since last full reset: $CYCLTL&lt;br /&gt;
echo Reported Battery Voltage: $VOLT mV&lt;br /&gt;
echo Battery Gauge die Temperature: $(($TEMP * 250 / 1000 - 273)) C&lt;br /&gt;
echo -e &amp;quot;Flags:\t&amp;quot; $FLAGS&lt;br /&gt;
echo -e &amp;quot;\t&amp;quot; Charge:$FLAGS_CHARGE NOACT:$FLAGS_NOACT IMIN:$FLAGS_IMIN CI:$FLAGS_CI CALIP:$FLAGS_CALIP VDQ:$FLAGS_VDQ EDV1:$FLAGS_EDV1 EDVF: $FLAGS_EDVF&lt;br /&gt;
echo -e &amp;quot;eeprom data:&amp;quot;&lt;br /&gt;
echo -e &amp;quot;\t&amp;quot; ILMD=$ILMD EDVF=$EDVF EDV1=$EDV1 ISLC=$ISLC&lt;br /&gt;
echo -e &amp;quot;\t&amp;quot; DMF=$DMF nanoVolt SD=$SD thousandths of percent per day&lt;br /&gt;
echo -e &amp;quot;\t&amp;quot; AGELMD=$AGELMD TAPER=$TAPER mA&lt;br /&gt;
echo -e &amp;quot;\t&amp;quot; IMLC=$IMLC mA&lt;br /&gt;
&lt;br /&gt;
else # loopmode&lt;br /&gt;
&lt;br /&gt;
if [ $LOOPCOUNT -eq 0 ] ; then&lt;br /&gt;
        LOOPCOUNT=24&lt;br /&gt;
        echo -e &amp;quot;      mv   RSOC CSOC mA   NAC  CACD CACT TTF   TTE   TEMP EDV1 LOW&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
LOOPCOUNT=$(($LOOPCOUNT-1))&lt;br /&gt;
&lt;br /&gt;
C=$AI&lt;br /&gt;
if [ $FLAGS_CHARGE -eq 0 ] ; then&lt;br /&gt;
        C=&amp;quot;-&amp;quot;$C&lt;br /&gt;
fi&lt;br /&gt;
printf &amp;quot;$(date +%H:%M) %4d %-3d  %-3d  %-4d %-4d %-4d %-4d %-5d %-5d %-3d %d\n&amp;quot; $VOLT $RSOC $CSOC $C $NAC $CACD $CACT $TTF $TTE $(($TEMP * 250 /1000 - 273)) $FLAGS_EDV1 &lt;br /&gt;
sleep $LOOPMODE&lt;br /&gt;
doit=1&lt;br /&gt;
fi # if loopmode&lt;br /&gt;
&lt;br /&gt;
done # main&lt;/div&gt;</description>
			<pubDate>Sat, 11 Sep 2010 22:46:32 GMT</pubDate>			<dc:creator>joerg_rw</dc:creator>			<comments>http://bugs.maemo.com/Talk:N900_Hardware_Charge_Meter/bq-script</comments>		</item>
	</channel>
</rss>