maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N800 (https://talk.maemo.org/forumdisplay.php?f=25)
-   -   Battery depletion on reboot (https://talk.maemo.org/showthread.php?t=26170)

prk60091 2009-01-12 20:10

Re: Battery depletion on reboot
 
there are a number of threads (just check the tag for battery and battery drain) that discuss this issue. a reboot on diablo will burn up about a full days worth of juice (normally the tablet burns about .5%/hour which translates to about 10-15% battery loss due to rebooting which is why it is suggested not to reboot your tablet. it is more power efficient going to sleep than to turn off.
I recently had an issue where i thought there was a firmware problem with the battery level. it turned out to be a bad battery (mine was 13 months old)

qwerty12 2009-01-12 20:19

Re: Battery depletion on reboot
 
Quote:

Originally Posted by BrentDC (Post 256936)
Is it possible to read the raw battery level (direct from the hardware)?

I'm thinking of an application that reads battery level every minute and adds it to a max 120 line log in /tmp/. The application then weights the readings slightly more toward present, to compute a more accurate reading (that would survive a reboot).

Possible?

http://mrrau.dyndns.org:23280/n800/kcbatt/

BrentDC 2009-01-12 20:56

Re: Battery depletion on reboot
 
Quote:

Originally Posted by qwerty12 (Post 256944)

Hmm, looking at the source, there is no algorithm for estimated battery level, just a linear return value.

That is cool though, it at least seems to draw the data directly from the hardware (the "retu", I think).

My C/C++ skills are very weak, but maybe I can modify the source and add some sort of algorithm to more accurately predict battery level. Or maybe not :)

Matan 2009-01-12 20:59

Re: Battery depletion on reboot
 
I also wrote a simple program: See retu-adc.c (or retu-adc for the binary) here:http://my.arava.co.il/~matan/770/

Run retu-adc to read all ADCs, or retu-adc 8 9 to read the battery voltage only.

To get a reasonable battery level, you need to take into account the temperature, charging status, and current draw, if it is also available somehow.

Matan 2009-01-12 21:09

Re: Battery depletion on reboot
 
Quote:

Originally Posted by BrentDC (Post 256960)
My C/C++ skills are very weak, but maybe I can modify the source and add some sort of algorithm to more accurately predict battery level. Or maybe not :)

If you come up with a good algorithm, I am sure someone will be able to implement it in whatever language.

To find such an algorithm I suggest log values from full battery to empty on a few usage profiles:

- low power draw: standby, not connected

- medium power draw: low CPU usage, screen on low brightness.

- high power draw: play a movie that takes 100% cpu in a loop over WiFi with maximum brightness and GPS on.

Try to find an algorithm that fits all those logs.


Just a small note: /tmp will not survive a reboot, it is on tmpfs.

BrentDC 2009-01-12 21:39

Re: Battery depletion on reboot
 
Matan, I'm a little confused. When I run your program, I just get this:

Code:

~/scripts $ ./retu-adc
0: ffffffff  1: ffffffff  2: ffffffff  3: ffffffff
4: ffffffff  5: ffffffff  6: ffffffff  7: ffffffff
8: ffffffff  9: ffffffff  10: ffffffff  11: ffffffff
12: ffffffff  13: ffffffff  14: ffffffff  15: ffffffff

Is this expected?

Matan 2009-01-12 22:12

Re: Battery depletion on reboot
 
I did not expect it, but it is a permission problem. Either run it as root, or run (once every boot)

chmod a+x /dev/retu

BrentDC 2009-01-12 22:41

Re: Battery depletion on reboot
 
Matan, could you please change the output of retu-adc to decimal instead of hex?

I would do it myself, but, again, my C skills are lacking :(

Benson 2009-01-12 22:54

Re: Battery depletion on reboot
 
Quote:

Originally Posted by BrentDC (Post 256993)
Matan, could you please change the output of retu-adc to decimal instead of hex?

I would do it myself, but, again, my C skills are lacking :(

Change this:
Code:

        for(i=s;i<e;i++) {
                printf("%d: %08x  ", i, ioctl(f,RETU_IOCH_ADC_READ, i));
                if((i&3)==3)printf("\n");
        }

to this:
Code:

        for(i=s;i<e;i++) {
                printf("%d: %010d  ", i, ioctl(f,RETU_IOCH_ADC_READ, i));
                if((i&3)==3)printf("\n");
        }

Changes from hex (x) to decimal (d), and also increases the field width from 8 to 10 characters.

Matan 2009-01-12 22:55

Re: Battery depletion on reboot
 
Here:

http://my.arava.co.il/~matan/770/retu-dec


All times are GMT. The time now is 19:35.

vBulletin® Version 3.8.8