![]() |
[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:
bnf 1.1 was just released.
bnf 1.0 was just uploaded to extras-devel. Changelog:
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 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 |
Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
I've updated description and added a picture.
/Estel |
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. |
Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
Another release so soon Estel? Get in my son!
|
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 :) |
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 |
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. |
Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
1 Attachment(s)
|
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 |
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?
|
Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
Nice tool. Plans to have this for the N9? (errm)
|
Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
@Jigzy
Probably perfectly doable for everyone, via QueenBeeconWidget. although, as it's reading data via i2cget, it couldn't update itself constantly - something like 1 auto update per minute (+ on touch) should be ok. @Jordi I have no idea, as I don't own N9(50), so NFC if something like ic2tool exists there, what type of charging chip it use, how to handle notifications (are there any?) etc, etc. So, it's definitely a task for someone owning devices in question, already. /Estel |
Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
Quote:
Thanks for the tool Estel. Edit: Just check that out and "callibration needed" stills 1. But SoC is pretty closer to the power monitor value than before calibration. Should i try recallibrate it ? |
Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
bnf doesn't rely on APM in any way - you can safely uninstall it. Although it's nice piece of code, I must admit, that I've also uninstalled APM few months ago - bnf suits my need for detailed info, and standard battery indicator is OK for a "glance" battery status. In my case, it was rather about saving memory, instead of CPU cycles.
As for shutting down - just stop bme, while attempting to calibrate. Then, after EDV=1 and VDQ=0, remember to charge device for a while (via charge.sh script, as per my instructions), before turning bme again - or, it will shutdown device due to voltage lower than it's threshold. /Estel |
Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
Quote:
I couldn't uninstall the app from HAM. Had to apt-get install bnf, apt-get remove bnf. Then installed via HAM again. Now with a fresh install bnf still doesn't display anything. sudo bnf works ok after a reboot but desktop and app lancher icons do nothing. Is this correct? |
Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
Of course not. Could You join IRc #maemo, and "ping Estel_"? We would check, what is going on.
/Estel |
Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
Quote:
QCPUFREQ was set to load bq27x00 module. After unchecking option and a reboot. bnf works perfectly. |
Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
2 Attachment(s)
Hey Estel,
just stumbled accidentally over your second package. :) Nice. Will surely help some people. (When will see your next deb with battery hot swap via click on widget?) Seems like something (a script and a desktop file) needs to be deb packaged to get some more deserved attention! ? Since I am using it since aeons, I just can not remember where/how I got it, via thread or directly from you? Whatever, I had modified (rearranged, sorted) the output slightly, so it matches my "subjective aesthetic feeling/logic" more :) Here are my screenies: Attachment 26584 Attachment 26585 |
Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
Quote:
Seriously though, I always thought that place for such - even simplest - things is in repos, instead in some random (or even extra valuable) thread on TMO, which many people can miss. I'm glad You're enjoying it too :) Repos version of script benefit from some code cleanup (minor things) - probably, You can re-patch them to Your modified version without much problems :) /Estel |
Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
Quote:
i'm a total noob and dont uderstand whwat is meant by "QCPUFREQ was set to load bq27x00 module. After unchecking option and a reboot. bnf works perfectly" please can someone help me how to do this? thank you |
Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
Quote:
|
Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
It's a great app!
but...How to calibrate it? I can only make it work via ``sudo gainroot bnf´´... it says that the full charge is at 795 mAh & it doesn't matter if I use BME or some other battery. p.s. It olso displays that calibration is 0 & vdq is 0. |
Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
Here Was covered further up, I agree it should be in a wiki or OP.
|
Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
This is THE wiki ;)
But maybe it should be at least in first post. Estel? |
Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
Good idea, adding :)
|
Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
Hello, I am still able starting the bnf only from the terminal after I switch to the root shell (sudo gainroot). If I start bnf from its application icon (menu, shortcut ...) only blank sscreen appears.
I tried to find a solution, I even blacklisted the bq27x00-battery modul, but still no luck. Can anyone help me with this issue please ? |
Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
Looks like your desktop file is missing sudo rights.
Try Code:
cat /usr/share/applications/hildon/bnf.desktop please have in mind. that i do have a personal installation of bnf, so maybe estel will know more ... --edit NOW I remember (as it happened again to me)! Sometimes the hildon-home hangs. Then you can not start any self-placed widgets/programs from desktop. This also hinders notifications for missed calls or SMS/mails. AND also the display of self made notfications like bnf uses. A restart will help out (there is also other workaround posted by me somewhere else in this forum ;)). |
Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
Here is the bnf.desktop without any edit
Code:
|
Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
Thank you very much. Had to change the exec command in the .desktop file from bnf to /usr/sbin/bnf and now it works just fine.
|
Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
Oops. Estel.
I think then you have to change a bit here (assuming karlitos installed from repo). Sudoing an exe without full path works only if location is in path. /usr/sbin is per default not in path for user (but of course for root). |
Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
I can confirm that the .desktop file as installed from the repos lacks the full path to bnf.
|
Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
It is not lacking anything - icons placed in standard directories where hildon expect them, doesn't need to be provided with full path.
Thanks for confirming, though :) /Estel |
Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
Hello, it is not about icons but about the path to the binary.
|
Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
Yes, it was not about icons (where full path is not only not needed, but must not be set, to my experience).
But I have to apologize, Estel. Of course a sudo in front of command does not require full path! But I had similar once and thought it was that (not having root rights); and it was late... As I just greyed out my nonsense in former post, it was not fully nonsense ;j My script is in totally different location! karlitos can you run sudo bnf from terminal as user (not as root)? Please open a new x-term and directly type sudo bnf If that starts the window or black screen, then give us output of lsmod | grep bq27 |
Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
@Estel
Trying to calibrate my battery using your bqCapacity post. Have you forgotten to mention ./i2cget needs chmod as well as bq27200.sh? |
Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
Good catch. I need to refine instructions anyway - i2cget is available from i2c-tool package for ages (in fact, was in time of writing initial tutorial...), so messing with placing i2cget manually isn't needed. bq27200.sh definitely needs chmod +x it.
Considering, that bq27200.sh is sitting in some random server for ages, I guess I will refine it a little, ask ShadowJK for permission and put it as part of bnf package - it will make things much easier. /Estel |
Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
Hi Estel
Any idea why sudo bnf after reflashing my devica and clean install CSSU fthumb sudo bnf granted me with Error: Could not set address to 0x55: Device or resource busy /usr/sbin/bnf: line 44: arithmetic syntax error tnx |
Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
Looks like something is occupying i2cbus - I bet, that bq27x00_battery module is loaded at startup. check your blacklist and enforced modules list (refer to kernel-power thread, it was discussed there, "somewhere" - I don't remember locations now, sadly :( ).
// edit For quick confirm/deny, try (as root) modprobe -r bq27x00_battery - if it accepts command without errors, and then, bnf starts to work, you can be sure it is it. |
Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
Yep, exactly that is my assumption/explanation also :)
@Estel Maybe you meant that from here on and ff? Can not remember in kernel thread, but maybe also there... --edit and I remembered why bnf called from menu icon may sometimes not display any output, but shows black screen |
Re: [Announce] bnf - nifty little tool, allowing to have battery info at glance
Yea :)
BTW, don't get too 1337 with blacklisting bq27x00_battery - do it using a way, that you will be able to revert easily. Current progress on bme replacement (via re-written bq2415_battery and bq27x00_battery modules) mean, that after some time, you *will* want to use "reborn" bq27x00_battery, as module for exporting things for userland bme replacement bits. After all, talking directly to i2c is always - more or less "dirty hack", and with dawn of proper BME replacement, it's going to get obsolete. While it will - for sure - mean availability of nicely integrated, GUI battery meters, it doesn't mean BNF will go away, though - for those hardy pack of people, that still like it, I will for sure release version that uses bq27x00_battery instead of i2cget, as soon as BME replacement using kernel module will be available. /Estel |
All times are GMT. The time now is 04:17. |
vBulletin® Version 3.8.8