Author Topic: Battery Monitor  (Read 5135 times)

cmonex

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
Battery Monitor
« 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..

bam

  • Hero Member
  • *****
  • Posts: 1213
    • View Profile
    • http://thegrinder.ws
Battery Monitor
« Reply #1 on: March 08, 2006, 12:31:53 am »
is there an uptime command in zaurus?
SL-C3100 current: Stock/Tetsu 18h
Socket BT CF Card
Linksys WCF-12 802.11b/Cheapie USB Ethernet

The Grinder

bam

  • Hero Member
  • *****
  • Posts: 1213
    • View Profile
    • http://thegrinder.ws
Battery Monitor
« Reply #2 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...
SL-C3100 current: Stock/Tetsu 18h
Socket BT CF Card
Linksys WCF-12 802.11b/Cheapie USB Ethernet

The Grinder

cmonex

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
Battery Monitor
« Reply #3 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

chyang

  • Sr. Member
  • ****
  • Posts: 270
    • View Profile
    • http://mail.ustc.edu.cn/~chyang/
Battery Monitor
« Reply #4 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.
SL-C3200+Symbol CF WIFI+Corsair 2GB SD
SL-5500+Sharp-3.13 ROM+Viking 512MB CF+Kinston 256MB SD
[img]http://sunsetyang.googlepages.com/c3200.gif\" border=\"0\" class=\"linked-sig-image\" /][img]http://sunsetyang.googlepages.com/5500.gif\" border=\"0\" class=\"linked-sig-image\" /]
Socket CF Bluetooth + EagleTec CF Lan Card + EagleTec CF Modem
Histroy:
[SL-C3000 Cacko 1.23 Beta 1] Sold on 2006/07/27
MA701 CF WIFI + EagleTec CF Bluetooth + D-Link DCF-660W WIFI
[SL5500+Sharp-3.13 ROM+SimpleTech 64MB CF+Hagiwara 128MB SD] Lost on 18,March,04

bam

  • Hero Member
  • *****
  • Posts: 1213
    • View Profile
    • http://thegrinder.ws
Battery Monitor
« Reply #5 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.
SL-C3100 current: Stock/Tetsu 18h
Socket BT CF Card
Linksys WCF-12 802.11b/Cheapie USB Ethernet

The Grinder

cmonex

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
Battery Monitor
« Reply #6 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?
« Last Edit: March 23, 2006, 07:24:21 pm by cmonex »

Greg2

  • Hero Member
  • *****
  • Posts: 790
    • View Profile
    • http://
Battery Monitor
« Reply #7 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

cmonex

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
Battery Monitor
« Reply #8 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

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Battery Monitor
« Reply #9 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
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

cmonex

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
Battery Monitor
« Reply #10 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)...
« Last Edit: April 13, 2006, 08:04:59 am by cmonex »

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Battery Monitor
« Reply #11 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
« Last Edit: April 13, 2006, 08:19:17 am by lardman »
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

cmonex

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
Battery Monitor
« Reply #12 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.

ldrolez

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
    • http://zaurus.palmopensource.com
Battery Monitor
« Reply #13 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]
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.
- ludo
http://zaurus.palmopensource.com - the Zaurus Open Source Portal
http://www.drolez.com/software/zaurus - Misc Zaurus stuff (wifi drivers, hacks and more)