OESF Portables Forum

Everything Else => General Support and Discussion => Zaurus General Forums => Archived Forums => Software => Topic started by: cmonex on March 07, 2006, 11:41:16 pm

Title: Battery Monitor
Post by: cmonex on March 07, 2006, 11:41:16 pm
as above... i'd like to see how long i've been running on batteries...  couldn't find anything..
Title: Battery Monitor
Post by: bam on March 08, 2006, 12:31:53 am
is there an uptime command in zaurus?
Title: Battery Monitor
Post by: bam on March 08, 2006, 12:35:22 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...
Title: Battery Monitor
Post by: cmonex on March 08, 2006, 08:44:46 am
Quote
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...
[div align=\"right\"][a href=\"index.php?act=findpost&pid=117501\"][{POST_SNAPBACK}][/a][/div]


hey thanks for your answer

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

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
Title: Battery Monitor
Post by: chyang on March 12, 2006, 10:22:41 am
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.
Title: Battery Monitor
Post by: bam on March 12, 2006, 12:15:31 pm
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.
Title: Battery Monitor
Post by: cmonex on March 23, 2006, 07:23:30 pm
thanks for your answers

Quote
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.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=118170\"][{POST_SNAPBACK}][/a][/div]

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?
Title: Battery Monitor
Post by: Greg2 on March 23, 2006, 09:26:39 pm
Quote
the uptime command sounds nice, hmm if anyone knows about one, let me know... 
In terminal do:
Code: [Select]
cat /proc/uptimeGreg
Title: Battery Monitor
Post by: cmonex on April 12, 2006, 09:46:37 pm
Quote
Quote
the uptime command sounds nice, hmm if anyone knows about one, let me know... 
In terminal do:
Code: [Select]
cat /proc/uptimeGreg
[div align=\"right\"][a href=\"index.php?act=findpost&pid=120019\"][{POST_SNAPBACK}][/a][/div]

hehe thanks. though this shows only system uptime
Title: Battery Monitor
Post by: lardman on April 13, 2006, 06:32:01 am
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
Title: Battery Monitor
Post by: cmonex on April 13, 2006, 08:02:41 am
Quote
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
[div align=\"right\"][a href=\"index.php?act=findpost&pid=122978\"][{POST_SNAPBACK}][/a][/div]


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

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  
 
wow, oz really can show the actual voltage?    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)...
Title: Battery Monitor
Post by: lardman on April 13, 2006, 08:17:14 am
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  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
Title: Battery Monitor
Post by: cmonex on April 14, 2006, 10:49:56 pm
Quote
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  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
[div align=\"right\"][a href=\"index.php?act=findpost&pid=122997\"][{POST_SNAPBACK}][/a][/div]


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  (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...  

i have a c760 btw. if that matters.
Title: Battery Monitor
Post by: ldrolez on June 23, 2006, 05:56:16 am
Quote
as above... i'd like to see how long i've been running on batteries...  couldn't find anything..
[div align=\"right\"][{POST_SNAPBACK}][/a][/div] (http://index.php?act=findpost&pid=117493\")
I've made a little script, which can give data to gnuplot : [a href=\"http://ldrolez.free.fr/software/zaurus/]http://ldrolez.free.fr/software/zaurus/[/url]

Cheers,

  Ludo.