Active Topics

 


Reply
Thread Tools
Posts: 61 | Thanked: 7 times | Joined on Aug 2007 @ Kassel, Germany
#1
Hi all,

I am now figuring out a way to record battery/power consumption of a test script i am performing on the N900, and found a way to access Hal via python/dbus. I realize one thing - when i check the log file - it does not display changes of "'battery.reporting.current" if the phone turns off its screen.

As soon as i unlock the phone, i see the value gets updated. Is this behavior normal? When i look at batteryGraph, the sqlite DB has the same type of log too. if the phone is not used (screen locked/off) it will not log any changes.

Does it mean it is useless for me to put a script that automatically record the current value every say 30 seconds and leave it running at background, since the way i access the value via dbus/hal will not get the update unless i keep the phone "on" (which again forfeit the purpose - the script should run in background...)

thanks.

regards,
wahlau.
 
Posts: 1,258 | Thanked: 672 times | Joined on Mar 2009
#2
Yes it's normal. Only reliable way to make it update is to bring the battery meter icon into view.

The logic is surely to not bother updating it if it can't be seen.

Still, it does update once or twice a day if you leave it screen off..
 

The Following User Says Thank You to shadowjk For This Useful Post:
Posts: 61 | Thanked: 7 times | Joined on Aug 2007 @ Kassel, Germany
#3
Hi shadowjk,

I do not understand what you mean by "bring the battery meter icon into view".

my only uncertainty now is, how to notice of the hal mAh drop in a higher frequency when the phone is running a background process with its screen turns off. So far through my test - hal/dbus using a python script will just keep producing the same value as long as the phone is not touched, and only start recording a new value when i unlock the phone/screen. The same behaviour i also observe on the data recorded using BatteryGraph.

thanks again for your answer.
 
Posts: 1,258 | Thanked: 672 times | Joined on Mar 2009
#4
I meant the battery icon that's in the same area as time/clock and signal strength. When you go from using a fullscreen app to a normal app, which changes the meter from not visible to being visible, it usually gets an update.

Of course when you unlock phone to turn on screen, the meter also becomes visible and is updated.

My best advice on script would be to ignore/discard values from hal identical to previous value.

Have you looked at existing battery logging apps such as battery-eye?
 
Posts: 61 | Thanked: 7 times | Joined on Aug 2007 @ Kassel, Germany
#5
Hi Shadowjk,

yes i have tried to "borrow" some code from battery-eye, and all i have experienced now is, as soon as the screen turns off, i won't get HAL updates on the battery anymore until i manually triggers the screen to lit. I assume this is a feature - power saving - if the phone is not in active use, there is no active update on the bme status until some activities is detected again.

guess i have to stick to this situation now. wonder if it makes sense to manually turn on and off the screen just to get the values

thanks!
 
Posts: 61 | Thanked: 7 times | Joined on Aug 2007 @ Kassel, Germany
#6
Hi guys,

some updates: i manage to get a work around by making the phone to unlock and immediately lock itself periodically to note down the mAh values in a log file. I know the lock/unlock itself will take up some energy, but without this step the phone will not show any changes at all when i use hal to tell me how much current has been used...

one question i have now - the values i get is the hal.battery.reporting.current. If the differences of two measure values is 4mAh between 10 minutes, what does it mean? does it mean i can just divide 4mAh with 6 to say the N900 actually used 4/10 mA for that 10 minutes?

thanks...
 
Posts: 1,258 | Thanked: 672 times | Joined on Mar 2009
#7
rate = (last measured charge level * 3600 - current charge level * 3600) / elapsed time between the two measurements in seconds

If charge level measurement has unit mAh, then the result will be in mA.

Or in your case with minutes: rate = 4*60 / 10 = 24mA, which sounds like standby current draw when there's some low background internet traffic going on over wifi or 2g.
 

The Following User Says Thank You to shadowjk For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 20:45.