maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [Announce] bnf - nifty little tool, allowing to have battery info at glance (https://talk.maemo.org/showthread.php?t=84452)

Estel 2012-05-24 00:54

[Announce] bnf - nifty little tool, allowing to have battery info at glance
 
Current version: 1.2
---

bnf 1.2 was uploaded to extras-devel. It is minor release, incorporating changes from tar-only 1.1 into repos version (tar link removed from attachment) + small fix for sudo. Changelog:
  • Fixed typo in sudoers file (bnf.sh was present, instead of bnf)
  • Back in the repos, ad they're working again
---

bnf 1.1 was just released. Repositories and autobuilder are not working reliably ATM, so extras-* release will arrive if when it's ever fixed. For now, update from 1.0 is available as attachment to this post. To install, just untar it to /usr/sbin (overwriting old file).Changelog:
  • Uses either bq27x00_battery module, or i2cget method, transparently deciding which one is applicable.
  • New value - "Average Time Remaining", which shows remaining time, calculated from averaged power usage since last complete charging.
  • Minor code cleanup + more things commented for easy code understanding, even for sh beginners.
---

bnf 1.0 was just uploaded to extras-devel. Changelog:
  • Initial release.

bnf is minimalistic, simple tool that display most important informations about battery and charging chip status (gathered via bq27x00_battery module, or i2cget), as notification pop-up message. It process values that need calculating and display them in human-readable format, detect state (charging via USB, wall charger, or discharging) and formatting visible info accordingly.

It's main advantage is, that it displays info from last 5 seconds without influencing output by itself - it's even possible to measure such small things as 3 mA total power usage in echo > sys/power/mem state (via calling it as first thing upon wakeup).

bnf can be called via desktop icon (provided by package), terminal:
Code:

sudo bnf
...or things like shortcutd. Last one is extremely useful, as with bnf, it allows to check power usage, while inside full-screen programs (bnf can be called via camera button half-press), without connecting via ssh or running anything in background.

bnf works out-of-the box, and doesn't require any configuration.

http://imageshack.us/scaled/landing/407/bnf11.png

bnf is licensed under terms of GPL (latest revision). It is provided as-is, without any warranty whatsoever.
---

Credits:

Thanks to shadowjk for method of gathering data via i2cget. I wouldn't be even close to starting it without Your state-of-art bq27200.sh script.
Thanks to merlin1991 and X-Fade, for teaching me about debhelper requirements.
---

FAQ:
---

Q: Nice tool, but I would like it to also display <xyz>...
A: Open /usr/sbin/bnf with any text editor of Your choice and modify it - it's quite easy, in fact, everything is documented to (almost) single command, so adjusting it to own needs should be trivial. This makes bnf great tool for learning few basic things about shell scripting for N900.

Q: How to calibrate battery measurements?
A: See:
http://talk.maemo.org/showpost.php?p...&postcount=846
Instructions are long, but process itself is very straightforward, at least, when You get used to it. I've written it as verbosely as I can, to allow everyone understand what is happening - otherwise, it would be 3-4 liner.
---

First post will be updated when appropriate (with notes left as post, inside this thread).

/Estel

Estel 2012-05-24 01:14

Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
 
I've updated description and added a picture.

/Estel

nkirk 2012-05-24 07:39

Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
 
Being a fan of your bat capacity guide + script, i always thought why didnt you build something like this earlier to make it more mass-market friendly so most others could benifit from it. good work estel

/nkirk.

vi_ 2012-05-24 08:30

Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
 
Another release so soon Estel? Get in my son!

reinob 2012-05-24 11:21

Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
 
@Estel,

Thanks for the script. I've tried it, and I get:
SoC: 70%
Charge: 1384 mAh
Full Charge: 1969 mAh

My battery is however the stock one, so the full charge is about 1300mAh (1269 according to battery-eye) and current charge should be around 584mAh (again, according to battery-eye).

BatteryGraph "confirms" that the charge is 584mAh (46%).

Note that bnf says, in my case, that "Calibration needed: 1" (and VDQ: 0, no idea what that is).

I know that the whole battery-thing is a mess, and I guess I do need to calibrate the battery measurements, but I just wanted to indicate my results in case you might want to add a warning on the first post..

Add.: I just read through http://talk.maemo.org/showpost.php?p...&postcount=846 again (it's an amazing read :), so I'll give that a shot and see if I can calibrate the measurement :)

Estel 2012-05-24 11:37

Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
 
@nkirk

Thanks - it wasn't released earlier, because I've lacked skills to put it into repos properly ;)

@vi_
Fortunately, releasing this one was a no-brainer, after ereswap that took ~20 hours of constant effort (*after* having main reswapping part ready) to write missing parts and upload this bugger to repos ;)

I also have something "in-middle" to release - thing less complicated than ereswap, but requiring some actual work (unlike bnf) before release - so expect 3th one soon, but it will be targeted at absolutely niche "market" (users of optical disc drives via hostmode).

/Estel

// Edit

@reinob
Thansk a lot for trying it :) I see You've already went through calibration guide, so you probably know already what VDQ is (Valid discharge quality). Just don't worry if You won't get accurate result after first calibration - drop from 1900 to 1200-something will, probably, require few calibration "steps".

also, keep in mind, that both batteryeye and batterygraph doesn't give "real" results - even if You would have 3000 mAh battery, it would say about "Stock" capacity - it's taking data from same source as BME, so capacity is "red" from resistor value between BMI (3th battery pin) and mass - whatever manufacturer put there, "code" the readings - and State of Charge is calculated via voltage.

After proper calibration, bnf will should you absolutely 100% accurate State of Charge - percentage shown is CSOC (Compensated State of Charge), so it even take into account current temperature of battery (which affects capacity).

/Estel

sixwheeledbeast 2012-05-24 20:53

Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
 
Thought I'd mention something I found after installing (or not) bnf.
Downloaded via HAM, accidently tapped the fuzzy area on ic2tool execption warning.
bnf "failed to install".
On checking HAM again it wasn't in the repo's.

Turn's out it's installed without ic2tools and when run the desktop goes blank and CPU hits 100%. Only way to stop it is pressing power key.

trlopes1974 2012-05-24 22:27

Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
 
1 Attachment(s)
Attachment 26555

niceeeee.... I guess it needs calibration

Estel 2012-05-25 17:40

Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
 
Well, "Calibration needed: 1" means something ;)

BTW, even having "Calibration needed: 0" doesn't mean You don't need calibration, if You've changed battery recently or so. N900's hardware doesn't have any way to fingerprint battery, so if You switch from standard BL-5J to, lets say, dual-scud, You still need to calibrate before seeing Your 3000 mAh.

Generally, "Calibration needed" is derived form amount of cycles since last calibration. If chip was reset, calibration is "never" so induct "Calibration needed".

/Estel

Jigzy 2012-05-25 18:59

Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
 
Love the app! not sure if others would be interested, but is their a possibilty of having a widget displaying all the info?


All times are GMT. The time now is 23:48.

vBulletin® Version 3.8.8