Jump to content
Vitaly Lysenkov

BLifePlugin v0.3 - homescreen plugin for remaining operating time calculation

Recommended Posts

BLifePlugin v0.3 has been released!

v0.2-idle-thumb.jpgv0.2-graph-thumb.jpg

The BatteryLife Plugin (BLifePlugin) gathers and aggregates battery discharge statistics. It then calculates the remaining battery life with the current battery charge and current time of the day. The more days you use the plugin, more accurately it will predict the remaining time. Two or three days will be generally enough to see that it really works! If it has no statistics (stat file name is invalid, for example), time is evaluated as most battery plugins do - linear approximation based on the current discharge and the passed time.

BLifePlugin also shows a day average discharge graph, time to reach 100% when charging and other cool stats.

The plugin is compact with Smartphone devices running Windows Mobile 2003 (SE) and later with any screen orientation (portrait or landscape) and any resolution (from old 176×220 to current QVGA or even higher). The plugin was successfully tested on my T-Mobile SDA (running WM2003 SE) and I-Mate SP5m (running WM5).

Visit www.accosto.com for further information and the download page to get the installation package!

Edited by Paul (MVP)

Share this post


Link to post
Share on other sites

For all guys having trouble with screen fonts, text position, etc.

BLifePlugin v0.3 released.

Changes:

  • (new) some standard plugin parameters added. font-face, font-size, font-weight, fgcolor, bgcolor, padding-left, padding-right, padding-top are now parsed both from and tags (plugin has more priority, of course).
  • (new) CPU load monitoring added. Plugin background will be painted with HighCPULoadBgColor when the average CPU load exceeds HighCPULoadPercent. It is very useful to see if any background application consumes significant amount of CPU thus leading your device to drain more battery power.
  • (new) GetSystemPowerStatusEx will be called when GetSystemPowerStatusEx2 fails. But Voxtel W210 still doesn't work with this standard API. A kind of magic...
  • (fix) for PocketPC (use my PluginAdapter to run this plugin on PocketPC): now all the time the device has been in 'sleep' mode is considered as working. Per-hour discharge percent will be calculated as all discharge divided by hours.

Please refer to Description or Download page.

Share this post


Link to post
Share on other sites

Does not work on the i-mate SPL (as most of the other battery monitors). It will lock the phone if the homescreen plugin is selected.

Share this post


Link to post
Share on other sites

Anyone using the battery life blifeplugin on an o2 xda graphite? Is it working?

I have it running but it does not collect any data. It correctly shows the percentages on the home screen but just show a load of "unknown" on the stats page

Share this post


Link to post
Share on other sites
Anyone using the battery life blifeplugin on an o2 xda graphite? Is it working?

I have it running but it does not collect any data. It correctly shows the percentages on the home screen but just show a load of "unknown" on the stats page

I think, first of all you should check if StatFilename is defined correctly. Can you just create the file with this path+name in your favourite File Manager?

Share this post


Link to post
Share on other sites

Hi Vitaly,

... I have the plugin running since a few days now and I just cant't figure out the logic for the graph shown.

You mention it is the average power consumption that is drawn. I wonder about several things:

1.) where are new data added?

- left side of the graph (shifting the old graph to the right)

- right side of the graph (shifting old graph to the left)

The CPU monitors that I know from the PC are adding data at the right end and are shifting old data left.

2.) what is the scale of the x-axis? It seems like 24h with 1h ticks, 6h main + moving 0:00 marker.

- How does this scale shift (right or not at all?)

- does it shift synchronous with the data drawn (from my casual observation it does not)?

- why does the 0:00 marker not shift along with the other scale (the intersection shows the current time?)

3.) what is the scale of the y-axis (mA)?

- Is it depending on the maximum ever reached?

- can you indicate the absolute value (in mA)?

- I suppose high value means high discharge?

- what happens if charging is done in parallel, can I see this from the graph?

4.) Are you planning to add other graphs using the same timescale so you could browse through the graphs?

I could imagine the following:

- Battery % (weighted derived from Voltage I think?)

- Battery voltage (would reflect charge + discharge, bottom value should not be 0 but correlate to 0% capacity)

- Battery charge current draw (in the same graph as discharge but different scale?)

- CPU usage

-

thanks for the tool anyway :-)

bye

tobbbie

:-)

Share this post


Link to post
Share on other sites
Hi Vitaly,

... I have the plugin running since a few days now and I just cant't figure out the logic for the graph shown.

You mention it is the average power consumption that is drawn. I wonder about several things:

1.) where are new data added?

- left side of the graph (shifting the old graph to the right)

- right side of the graph (shifting old graph to the left)

The CPU monitors that I know from the PC are adding data at the right end and are shifting old data left.

2.) what is the scale of the x-axis? It seems like 24h with 1h ticks, 6h main + moving 0:00 marker.

- How does this scale shift (right or not at all?)

- does it shift synchronous with the data drawn (from my casual observation it does not)?

- why does the 0:00 marker not shift along with the other scale (the intersection shows the current time?)

3.) what is the scale of the y-axis (mA)?

- Is it depending on the maximum ever reached?

- can you indicate the absolute value (in mA)?

- I suppose high value means high discharge?

- what happens if charging is done in parallel, can I see this from the graph?

4.) Are you planning to add other graphs using the same timescale so you could browse through the graphs?

I could imagine the following:

- Battery % (weighted derived from Voltage I think?)

- Battery voltage (would reflect charge + discharge, bottom value should not be 0 but correlate to 0% capacity)

- Battery charge current draw (in the same graph as discharge but different scale?)

- CPU usage

-

thanks for the tool anyway :-)

bye

tobbbie

:-)

Just made 4 screenshots that show that the graph data are simply unchanged and the 0:00 marker moves right.

post-120185-1183544241_thumb.jpg post-120185-1183544251_thumb.jpg

post-120185-1183544261_thumb.jpg post-120185-1183564117_thumb.jpg

I noticed a slight change in the graph for the last picture, but there is no moving graph as I would expect.

My XML in the homescreen is:

<!-- Here is the BatteryLife plugin -->

StatFilename="\My Documents\BLifeHistory.dat"

HighCPULoadPercent="70"

RefreshTimeout="120000"

MaxHistoryDays="30"

FlushTimeoutHours="1000" >

I checked the datafolder which I have set to "My Documents" and it contains the file BLifeHistory.dat looking like:

[version 1]

2007.6.25.13:0

2007.6.25.23:3,1,1,0,1,2,0,3,1

2007.6.26.11:0,0

2007.6.26.20:2,2,0,1,0,1,2,0,1,1,2,0,1,1,1,0,1

2007.6.27.20:1,1,1,0

2007.6.28.2:3,1,1,0,3,0,2,1

2007.6.28.15:6,0

2007.6.28.22:4,1,2

2007.6.29.2:3,1,1,2,5

2007.6.29.9:5,3,4,4,4,4,3,1,3,1,1

2007.6.30.10:2,1,4,3,1,1,2,0,2

2007.6.30.20:2,5,5

2007.7.1.12:3,1,2,1,1,2,0,1,1

2007.7.2.0:4,0,1,1,1,2,1

2007.7.2.12:1

2007.7.2.15:5,1

2007.7.3.0:2,2,1,0,2,1

2007.7.3.7:3,4

2007.7.3.22:2,1,1,1,3,0,1,2,5,2,1

2007.7.4.14:4,0

Initially there was a huge block intermitted (between 2007.6.27 and 28) from the date 2005.10.4.... with a lot of 0 behind it. This was due to a battery-removal when I lost the current time/date. I have deleted these lines from the file, did a reboot, but nothing has changed since then.

Any hint what I can do?

bye

tobbbie

:-)

Edited by tobbbie

Share this post


Link to post
Share on other sites

I have deleted the history file and now I see that the graph is drawn left to right and the moving marker seems to indicate the current time on the 24h scale. Looking at the values drawn however, I cannot detect a correlation to the device activities, ecpecially not for interactive use of the device.

Can you tell please how you derive the average current draw from the battery?

- Is it an average (from how many samples?) of the "BatteryAverageCurrent" value?

- how many samples are you keeping where (in memory?) for the graph?

- can you detect values when the homescreen is not in foreground, i.e. other applications are?

- how long does it take until I can see a current draw from the battery on the graph (e.g. I start listening to music)?

bye

tobbbie

:-)

Share this post


Link to post
Share on other sites

I wonder if the calulation is usefull if you derive it as well from the time that the device is connect AND charging.

As you account only the dis-charge rate for estimations, but the device is not loosing battery-power while beeing charged, the data may not be reflecting the truth, especially if you have the device connected to the PC via USB during the day.

This leads to two effects:

- the discharge is high as constant sync is happening. This alone will decrease the remaining time of availabilty dramatically

- the charge via USB is not accounted for in the graph

Consequently the graph is not giving a represenation what is going on with the battery in reality.

As well is the estimated time until battery-empty too short, as it is based on the current draw while connected.

So both "pages" of information deliver data of limited quality in my case.

Hm... I think I will observe a little more and then remove the plugin again as it does not cover my use-habits.

bye

tobbbie

:-)

Share this post


Link to post
Share on other sites

OK, so finally I dropped the plugin due to missing information on how the logic is working; however I derived the following:

1.) There is only one (1) value per hour calculated and stored

2.) The values from previous days are averaged with the current day, so the graph shows the average day consumption and NOT the last 24 hours

Its a pity, but well there is room for improvement...

bye

tobbbie

:-)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

By using this site, you agree to our Terms of Use.