Reply
Thread Tools
Posts: 398 | Thanked: 77 times | Joined on Jul 2007
#11
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's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#12
Originally Posted by BrentDC View Post
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's Avatar
Posts: 903 | Thanked: 632 times | Joined on Apr 2008
#13
Originally Posted by qwerty12 View Post
http://mrrau.dyndns.org:23280/n800/kcbatt/
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
 
Posts: 1,224 | Thanked: 1,763 times | Joined on Jul 2007
#14
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.
 
Posts: 1,224 | Thanked: 1,763 times | Joined on Jul 2007
#15
Originally Posted by BrentDC View Post
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.
 

The Following User Says Thank You to Matan For This Useful Post:
BrentDC's Avatar
Posts: 903 | Thanked: 632 times | Joined on Apr 2008
#16
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?
 
Posts: 1,224 | Thanked: 1,763 times | Joined on Jul 2007
#17
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
 

The Following User Says Thank You to Matan For This Useful Post:
BrentDC's Avatar
Posts: 903 | Thanked: 632 times | Joined on Apr 2008
#18
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's Avatar
Posts: 4,930 | Thanked: 2,272 times | Joined on Oct 2007
#19
Originally Posted by BrentDC View Post
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.
 

The Following User Says Thank You to Benson For This Useful Post:
Posts: 1,224 | Thanked: 1,763 times | Joined on Jul 2007
#20
 

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


 
Forum Jump


All times are GMT. The time now is 16:58.