bnf - battery information at glance 1.0
bnf - small nifty tool, displaying verbose battery-related info as pop-up notification
bnf is minimalistic, simple tool that display most important informations about battery and charging chip status (gathered via bq27x00_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 possible to measure things like 3 mA 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 (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, including OpenGLES applications (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.
Section:
user/system
Repository:
Depends:
Size:
5278 bytes
MD5sum:
0d9ce38f19098945cfede2ab6daf2d54
File:
Source:
Status:
Package in testing
Bugtracker:
QA Quarantine ends:
ENDED 2012-06-03 18:46
Changes
Package karma
0 out of 6
0
0
| Tester | Karma | Timestamp |
| Iker Rodriguez (72) | 2012-11-13 23:15 UTC | |
| Sifo basha (615) | 2012-08-08 04:24 UTC | |
| Rüdiger Schiller (615) | 2012-06-04 14:50 UTC | |
| Simó Albert i Beltran (174) | 2012-05-25 19:54 UTC |
Package events
| Event type | User | Timestamp |
| Package is in testing | System | 2012-05-24 18:46 UTC |

Comments:
Hello,
Thank you very much. bnf works well when I unload bq27x00_battery. Now I must find out what application is occupying the i2c. Could you give me any hint?
Please could you avoid syntax errors with something like attached patch.
See you.
--- /usr/sbin/bnf
+++ bnf
@@ -1,4 +1,17 @@
#!/bin/sh
+#
+# Contributors:
+# Simó Albert i Beltran
+
+
+notify()
+{
local o=org
local f=freedesktop
local n=Notifications
run-standalone.sh dbus-send --type=method_call --dest=$o.$f.$n /$o/$f/$n $o.$f.$n.SystemNoteDialog string:"$1" uint32:0 string:""
+}
+
# Changing directory, to make i2cget call working in all conditions
cd /usr/sbin/
@@ -37,8 +50,15 @@
WCH=$(cat /sys/devices/platform/musb_hdrc/charger)
+if [ -z "$AR" -o -z "$TEMP" -o -z "$NAC" -o -z "$CACD" -o -z "$CACT" -o -z "$AI" -o -z "$SI" -o -z "$MLI" -o -z "$LMD" -o -z "$ILMD" -o -z "$EDVF" -o -z "$EDV1" -o -z "$ISLC" -o -z "$DMFSD" -o -z "$TAPER" -o -z "$IMLC" ]
+then
notify "Sorry, data unavailable."
exit 1
+fi
+
############## Calculate ############## - from bq27200.sh by shadowjk
+TEMP=$(($TEMP * 250 / 1000 - 273))
CSOC=$(($CSOC)) # CSOC Compensated state of charge %. CACT/LMD * 100
RSOC=$(($RSOC)) # RSOC Relative state of charge %. NAC/LMD * 100
NAC=$(($NAC * 3570 / $RS / 1000)) # NAC Nominal available capaciy, mAh.
@@ -120,18 +140,15 @@
############## Printing output ##############
-o=org
-f=freedesktop
-n=Notifications
-run-standalone.sh dbus-send --type=method_call --dest=$o.$f.$n /$o/$f/$n $o.$f.$n.SystemNoteDialog string:"Voltage: $VOLT mV
+notify "Voltage: $VOLT mV
SoC: $CSOC%
Charge: $CACT mAh
Full Charge: $LMD mAh
-Temperature: $(($TEMP * 250 / 1000 - 273))°C
+Temperature: $TEMP°C
Status: $STS
Current: $AI mA
Remaining Time: $RT minutes $HL
-Calibration needed: $FLAGS_CI VDQ: $FLAGS_VDQ" uint32:0 string:""
+Calibration needed: $FLAGS_CI VDQ: $FLAGS_VDQ"
# thanks to Nicolai, for teaching me about displaying output as notification.
# huge thanks shadowjk, I would not be able to get even close to starting this, without Your bq27200.sh state-of-art script.
It seems, that You have something occupying i2c exclusively - probably, module bq27x00_battery.ko loaded (either manually, or auto-loaded at boot). try to modprobe -r or rmod it, before.
Generally, it's not bnf "problem" (so thumb down isn't entirely justified) - although, I'll add warning to package description in new version.
/Estel
Hello,
Firstly thanks for your work.
~ $ sudo bnf Error: Could not set address to 0x55: Device or resource busy [...] Error: Could not set address to 0x55: Device or resource busy /usr/sbin/bnf: line 44: arithmetic syntax error ~ $
:-(
See you.
Comments:
You must be logged in to make comments.