Help - Search - Members - Calendar
Full Version: Battery Monitor
OESF Forums > General Forums > General Support and Discussion > Software
cmonex
as above... i'd like to see how long i've been running on batteries... ph34r.gif couldn't find anything..
bam
is there an uptime command in zaurus?
bam
or you could do a cron or at job to log the battery status and time every so often, then you could extrapolate how much time it has run and how much time remains...just an estimate, but then again battery discharge is not quite linear...
cmonex
QUOTE(bam @ Mar 8 2006, 07:35 AM)
or you could do a cron or at job to log the battery status and time every so often, then you could extrapolate how much time it has run and how much time remains...just an estimate, but then again battery discharge is not quite linear...
*



hey thanks for your answer smile.gif

the uptime command sounds nice, hmm if anyone knows about one, let me know... cool.gif

again, i just need something that tells me how much time elapsed on battery power, i don't mind if it can't calculate the remaining time, i trust myself better on that laugh.gif
chyang
One or two years ago, I thought to extrapolate the usage time of the battery based on Anton's battery applet, before I wrote the code I did one simple test, and the result shows that the battery measurement is imprecise, so the time seems to be useless. My original algorithm works depends on the time difference and battery difference,
Use Time= Left_Batter/(delta_battery/delta_time), but some running results showed the delta_battery will increase in most of time. sad.gif
bam
the main problem is that current useage varies and here is no already built in way to measure this, but what can be done is a data profile of what the user does over time and a "good" estimation of battery time left, granted its not exact and if something drastically changes, say heavy wifi useage, the time error would increase but not dramatically.
cmonex
thanks for your answers smile.gif

QUOTE(chyang @ Mar 12 2006, 05:22 PM)
One or two years ago, I thought to extrapolate the usage time of the battery based on Anton's battery applet, before I wrote the code I did one simple test, and the result shows that the battery measurement is imprecise, so the time seems to be useless. My original algorithm works depends on the time difference and battery difference,
Use Time= Left_Batter/(delta_battery/delta_time), but some running results showed the delta_battery will increase in most of time. sad.gif
*


yeah i noticed it isn't precise. it stays above 70% for a while then when it gets below that the indicated charge drops much quicker...

OK anyway... i'm not interested in remaining time! i mean elapsed time as battery runtime ... it would be so cool.. anyone any ideas? ph34r.gif
Greg2
QUOTE(cmonex @ Mar 8 2006, 08:44 AM)
the uptime command sounds nice, hmm if anyone knows about one, let me know...  cool.gif
In terminal do:
CODE
cat /proc/uptime

Greg
cmonex
QUOTE(Greg2 @ Mar 24 2006, 04:26 AM)
QUOTE(cmonex @ Mar 8 2006, 08:44 AM)
the uptime command sounds nice, hmm if anyone knows about one, let me know...  cool.gif
In terminal do:
CODE
cat /proc/uptime

Greg
*



hehe thanks. though this shows only system uptime sad.gif
lardman
Well save the output of that command as soon as you resume and before suspend and you can then take the two away from one another.

While you at it, recording things to a text file (as this sound like the easiest way), you can save the battery status by 'cat /proc/apm' iirc. Then you can plot a battery percentage vs time graph.

If you're running on a c7x0 machine with OpenZaurus you might also consider recording the cpufreq transitions and the actual battery voltages (from sysfs.)


Si
cmonex
QUOTE(lardman @ Apr 13 2006, 12:32 PM)
Well save the output of that command as soon as you resume and before suspend and you can then take the two away from one another.

While you at it, recording things to a text file (as this sound like the easiest way), you can save the battery status by 'cat /proc/apm' iirc. Then you can plot a battery percentage vs time graph.

If you're running on a c7x0 machine with OpenZaurus you might also consider recording the cpufreq transitions and the actual battery voltages (from sysfs.)


Si
*



thanks for the idea. smile.gif hmm yeah it'd be nice to have some script for this. hmmm, now it only has to be actually created laugh.gif (and dunno yet, how unsure.gif )

btw actually uptime doesn't measure the time while the zaurus is switched off, just the system runtime from the last reboot. which could even be used for battery runtime if i never reboot and if i do a reboot at every recharge ph34r.gif

wow, oz really can show the actual voltage? cool.gif sounds more useful than this percentage thing in cacko which is very incorrectly measured. i sometimes get the feeling that someone was as crazy as to specify 50% at 3.6V (and 100% at 4.20V of course)...
lardman
All of the Zauruses can read the voltage (or at least a representation of the voltage from an a2d converter) in the kernel. OZ makes this info available in sysfs, I'm sure with a bit of kernel hacking it could be done for the 2.4.18 kernels.

Once you get into this, you can marvel at the wonder that is Sharp's voltage -> percentage lookup table wink.gif which is again contained within the kernel. I should add that this table has been redesigned in the past for the 2.4.x kernels and has also been re-designed for the 2.6.x kernel used by the OZ machines (depends which machine you have though, as the 2.6 kernel is onyl usable on the c7x0 and cx000 machines atm).


Si
cmonex
QUOTE(lardman @ Apr 13 2006, 02:17 PM)
All of the Zauruses can read the voltage (or at least a representation of the voltage from an a2d converter) in the kernel. OZ makes this info available in sysfs, I'm sure with a bit of kernel hacking it could be done for the 2.4.18 kernels.

Once you get into this, you can marvel at the wonder that is Sharp's voltage -> percentage lookup table wink.gif which is again contained within the kernel. I should add that this table has been redesigned in the past for the 2.4.x kernels and has also been re-designed for the 2.6.x kernel used by the OZ machines (depends which machine you have though, as the 2.6 kernel is onyl usable on the c7x0 and cx000 machines atm).


Si
*



a little bit of kernel hacking sounds very exciting however i'm not the right person to even think of trying to achieve that lol ph34r.gif (i'm no linux guru)
very sad, because i would sure try to hack it if i could.

so this lookup table is actually a wonder?! i seriously doubt it, lol... laugh.gif

i have a c760 btw. if that matters.
ldrolez
QUOTE(cmonex @ Mar 8 2006, 06:41 AM)
as above... i'd like to see how long i've been running on batteries... ph34r.gif couldn't find anything..
*

I've made a little script, which can give data to gnuplot : http://ldrolez.free.fr/software/zaurus/

Cheers,

Ludo.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.