Active Topics

 



Notices


Reply
Thread Tools
Posts: 164 | Thanked: 132 times | Joined on Dec 2007
#1
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.
 

The Following 22 Users Say Thank You to ag2 For This Useful Post:
R-R's Avatar
Posts: 739 | Thanked: 242 times | Joined on Sep 2007 @ Montreal
#2
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.
 
Posts: 164 | Thanked: 18 times | Joined on Dec 2007
#3
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
 

The Following User Says Thank You to migs For This Useful Post:
Posts: 833 | Thanked: 124 times | Joined on Nov 2007 @ Based in the USA
#4
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
 

The Following User Says Thank You to gemniii42 For This Useful Post:
Posts: 145 | Thanked: 32 times | Joined on Dec 2007
#5
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?
 
Posts: 465 | Thanked: 149 times | Joined on Oct 2007
#6
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
 

The Following User Says Thank You to dblank For This Useful Post:
Posts: 465 | Thanked: 149 times | Joined on Oct 2007
#7
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?
 
PinCushionQueen's Avatar
Posts: 538 | Thanked: 168 times | Joined on Dec 2007 @ Seattle
#8
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.
 
Posts: 145 | Thanked: 32 times | Joined on Dec 2007
#9
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?
 
Posts: 164 | Thanked: 132 times | Joined on Dec 2007
#10
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


 
Forum Jump


All times are GMT. The time now is 18:41.