Go Back   maemo.org - Talk > Software > Applications
 
Register FAQ Community Calendar Today's Posts Search

Notices

Reply
 
Thread Tools
  #1  
Old 2007-12-30, 20:33
ag2 ag2 is offline
 
Join Date: Dec 2007
Posts: 164
Thanks!: 7
Thanked 132 Times in 39 Posts
Default [Announce] Battery status app

I wrote a small app to display the remaining battery charge.

[user@nokia ~]$ battery-status
[Dec 29 22:57] 97.6%

There is also a mode for monitoring battery charge over time, switched on with the -d N flag. The command

battery-status -d 10 > /media/mmc1/battery.log &

logs the battery state to a media card every 10 minutes. This can be useful for rundown tests, i.e. running the monitor from a full charge until the device shuts off. My N810 can run maemo mapper with GPS, WiFi, and Bluetooth on, and the screen off, for nearly 11 hours:

[user@nokia ~/apps]$ tail -f /media/mmc1/battery.log
----------------------
[Dec 29 23:02][00:00] 97.6%
[Dec 29 23:12][00:10] 96.0%
[Dec 29 23:22][00:20] 94.8%
[Dec 29 23:32][00:30] 93.2%
[Dec 29 23:42][00:40] 91.6%
[Dec 29 23:52][00:50] 90.0%
....
[Dec 30 08:42][09:40] 7.2%
[Dec 30 08:52][09:50] 5.6%
[Dec 30 09:02][10:00] 4.0%
[Dec 30 09:12][10:10] 2.4%
[Dec 30 09:22][10:20] 0.4%
[Dec 30 09:32][10:30] 0.0%
[Dec 30 09:42][10:40] 0.0%

Note: Because battery-status relies on DBus signaling, running it has the unfortunate side effect of activating the battery applet. I will try to find a workaround for this.

http://nitapps.com

Last edited by ag2; 2008-02-09 at 11:28.
Reply With Quote
The Following 22 Users Say Thank You to ag2 For This Useful Post:
  #2  
Old 2007-12-31, 04:28
R-R's Avatar
R-R R-R is offline
 
Join Date: Sep 2007
Location: Montreal
Posts: 739
Thanks!: 409
Thanked 242 Times in 123 Posts
Default Re: [Announce] Battery status app

Cool, finally a solution! Thanks!

...But for some reason on an N800 with OS2008, it just freezes when i do the command alone instead of giving the time left and going back to the prompt.

And with -d 1 it prints the ------------ line and then does nothing... Any idea?

EDIT: Oh yes... unplug the device first haha, cheers ;-)

Last edited by R-R; 2007-12-31 at 04:31.
Reply With Quote
  #3  
Old 2007-12-31, 04:46
migs migs is offline
 
Join Date: Dec 2007
Posts: 164
Thanks!: 24
Thanked 18 Times in 14 Posts
Red face Re: [Announce] Battery status app

Quote:
Originally Posted by ag2 View Post
I wrote a small app to display the remaining battery charge.

[user@nokia ~]$ battery-status
[Dec 29 22:57] 97.6%

There is also a mode for monitoring battery charge over time, switched on with the -d N flag. The command

battery-status -d 10 > /media/mmc1/battery.log &

logs the battery state to a media card every 10 minutes. This can be useful for rundown tests, i.e. running the monitor from a full charge until the device shuts off. My N810 can run maemo mapper with GPS, WiFi, and Bluetooth on, and the screen off, for nearly 11 hours:

[user@nokia ~/apps]$ tail -f /media/mmc1/battery.log
----------------------
[Dec 29 23:02][00:00] 97.6%
[Dec 29 23:12][00:10] 96.0%
[Dec 29 23:22][00:20] 94.8%
[Dec 29 23:32][00:30] 93.2%
[Dec 29 23:42][00:40] 91.6%
[Dec 29 23:52][00:50] 90.0%
....
[Dec 30 08:42][09:40] 7.2%
[Dec 30 08:52][09:50] 5.6%
[Dec 30 09:02][10:00] 4.0%
[Dec 30 09:12][10:10] 2.4%
[Dec 30 09:22][10:20] 0.4%
[Dec 30 09:32][10:30] 0.0%
[Dec 30 09:42][10:40] 0.0%

Note: Because battery-status relies on DBus signaling, running it has the unfortunate side effect of activating the battery applet. I will try to find a workaround for this.

http://olya.com/maemo/


Well since you're into writing apps, I would like to suggest an app that allows for a Bluetooth mouse and cursor for OS2008. Imagine the possiblities.. Thanks, Mike
Reply With Quote
The Following User Says Thank You to migs For This Useful Post:
  #4  
Old 2007-12-31, 12:28
gemniii42 gemniii42 is offline
 
Join Date: Nov 2007
Location: Based in the USA
Posts: 833
Thanks!: 95
Thanked 124 Times in 105 Posts
Default Re: [Announce] Battery status app

Quote:
Originally Posted by migs View Post


Well since you're into writing apps, I would like to suggest an app that allows for a Bluetooth mouse and cursor for OS2008. Imagine the possiblities.. Thanks, Mike
Especially a bluetooth finger mouse!
/edit - note that the one linked is not actually BT
__________________
N810, iGo bt kb, Diablo, 10Gb storage onboard instead of a Thinkpad
OTG w/ unlimited storage!!
Put a penguin in your pocket!!
PLEASE use the Wiki
Reply With Quote
The Following User Says Thank You to gemniii42 For This Useful Post:
  #5  
Old 2007-12-31, 14:12
albright albright is offline
 
Join Date: Dec 2007
Posts: 145
Thanks!: 21
Thanked 32 Times in 24 Posts
Default Re: [Announce] Battery status app

battery-status is a good idea. Unfortunately, on my brand
new n810 it only generates an error:

Code:
Traceback (most recent call last):
  File "/usr/bin/battery-status", line 5, in <module>
    import dbus, dbus.service, dbus.glib
ImportError: No module named dbus
Any idea what's going on?
Reply With Quote
  #6  
Old 2007-12-31, 18:31
dblank dblank is offline
 
Join Date: Oct 2007
Posts: 465
Thanks!: 23
Thanked 149 Times in 69 Posts
Default Re: [Announce] Battery status app

Quote:
Originally Posted by albright View Post
battery-status is a good idea. Unfortunately, on my brand
new n810 it only generates an error:

Code:
Traceback (most recent call last):
  File "/usr/bin/battery-status", line 5, in <module>
    import dbus, dbus.service, dbus.glib
ImportError: No module named dbus
Any idea what's going on?
Sounds like you're missing the python dbus module.
install python2.5-dbus
Reply With Quote
The Following User Says Thank You to dblank For This Useful Post:
  #7  
Old 2007-12-31, 18:35
dblank dblank is offline
 
Join Date: Oct 2007
Posts: 465
Thanks!: 23
Thanked 149 Times in 69 Posts
Default Re: [Announce] Battery status app

I've been checking battery status every minute for a few hours now, and notice it drops .4% about every half hour or so, when I'm not actively using it.

Anyone else see any fairly regular big drops when not using the tablet?
Reply With Quote
  #8  
Old 2007-12-31, 19:04
PinCushionQueen's Avatar
PinCushionQueen PinCushionQueen is offline
 
Join Date: Dec 2007
Location: Seattle
Posts: 538
Thanks!: 42
Thanked 168 Times in 105 Posts
Default Re: [Announce] Battery status app

Hmmm... I just came across an interesting possible bug with the logging. I've set up battery-status to log every 30 mins. It last logged at 10:53 = 91.2%. I immediately ran the instant battery-status and at it read 10:54 = 82.8%. Any idea why there's a difference between the two? Which one is correct? For the logging mode does it read at the beginning of the time period rather than the end? I was using WiFi just prior to checking the status so that could account for the big drop if logging mode is giving a reading at the beginning of the time period.

Thanks again for this, BTW
__________________
When you wish upon a star, your dreams really can come true... Unless it's an asteroid hurtling towards earth that will destroy all life.

Last edited by PinCushionQueen; 2007-12-31 at 19:07.
Reply With Quote
  #9  
Old 2007-12-31, 20:25
albright albright is offline
 
Join Date: Dec 2007
Posts: 145
Thanks!: 21
Thanked 32 Times in 24 Posts
Default Re: [Announce] Battery status app

Quote:
Sounds like you're missing the python dbus module.
install python2.5-dbus
No such application is available. Oh, I see it listed in
gronmayer's listing but after deleting and reinstalling
the maemo extra repository (watching out for the little
spelling mistake that necessitates the "temp fix" - what
crap) there is no such package in my listing as
python2.5-dbus ..

However, installing the monster package python2.5-
runtime did the trick ...

So what is the relation between the dbus package and
the runtime package?
Reply With Quote
  #10  
Old 2008-01-01, 22:51
ag2 ag2 is offline
 
Join Date: Dec 2007
Posts: 164
Thanks!: 7
Thanked 132 Times in 39 Posts
Default Re: [Announce] Battery status app

Quote:
Originally Posted by albright View Post
battery-status is a good idea. Unfortunately, on my brand
new n810 it only generates an error:

Code:
Traceback (most recent call last):
  File "/usr/bin/battery-status", line 5, in <module>
    import dbus, dbus.service, dbus.glib
ImportError: No module named dbus
Any idea what's going on?
My bad. I've added the python2.5-dbus dependency.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 17:15.