[Nexus One Android Development] theloginwithnoname:
Warning - long post as a result of several other posts concatenated

As houmles says, don't worry about wifi ;)

I think so, yes. It needs to be tried with AGE, as per one of my older posts. That is the same register between Pre and N1, as they use the same battery (the 2784).

In the first two logs you posted in #273, you'll note there are drops to 2mAh and 19mAh respectively before the last line drops. This would indicate to me that there is no correlation with < 80mAh.

I can confirm that the new logic pershoot has put in his new kernel allows it to drop below 80 and still keep charging too, however we don't get any more charge - thus:

08/25/2010 08:27:24 [INFORMATION] batt: 95%, 4148 mV, 206 mA (192 avg), 29.2 C, 1294 mAh
08/25/2010 08:28:21 [INFORMATION] batt: 95%, 4153 mV, 199 mA (200 avg), 29.2 C, 1297 mAh
08/25/2010 08:29:25 [INFORMATION] batt: 96%, 4153 mV, 193 mA (195 avg), 29.3 C, 1300 mAh
08/25/2010 08:30:25 [INFORMATION] batt: 96%, 4153 mV, 188 mA (190 avg), 29.3 C, 1304 mAh
08/25/2010 08:31:25 [INFORMATION] batt: 96%, 4153 mV, 181 mA (185 avg), 29.3 C, 1307 mAh
08/25/2010 08:32:25 [INFORMATION] batt: 96%, 4157 mV, 176 mA (177 avg), 29.3 C, 1310 mAh
08/25/2010 08:33:25 [INFORMATION] batt: 96%, 4157 mV, 171 mA (172 avg), 29.3 C, 1313 mAh
08/25/2010 08:34:25 [INFORMATION] batt: 97%, 4157 mV, 164 mA (167 avg), 29.3 C, 1316 mAh
08/25/2010 08:35:25 [INFORMATION] batt: 97%, 4157 mV, 144 mA (128 avg), 29.2 C, 1318 mAh
08/25/2010 08:36:25 [INFORMATION] batt: 97%, 4157 mV, 158 mA (159 avg), 29.1 C, 1320 mAh
08/25/2010 08:37:25 [INFORMATION] batt: 97%, 4162 mV, 152 mA (156 avg), 29.2 C, 1323 mAh
08/25/2010 08:38:26 [INFORMATION] batt: 98%, 4162 mV, 149 mA (148 avg), 28.8 C, 1324 mAh
08/25/2010 08:39:26 [INFORMATION] batt: 98%, 4162 mV, 144 mA (145 avg), 28.8 C, 1326 mAh
08/25/2010 08:40:26 [INFORMATION] batt: 98%, 4162 mV, 140 mA (141 avg), 28.8 C, 1329 mAh
08/25/2010 08:41:26 [INFORMATION] batt: 98%, 4162 mV, 135 mA (137 avg), 28.8 C, 1331 mAh
08/25/2010 08:42:26 [INFORMATION] batt: 98%, 4162 mV, 131 mA (133 avg), 28.8 C, 1334 mAh
08/25/2010 08:43:26 [INFORMATION] batt: 98%, 4162 mV, 110 mA (110 avg), 28.8 C, 1336 mAh
08/25/2010 08:44:26 [INFORMATION] batt: 98%, 4162 mV, 100 mA (109 avg), 28.8 C, 1337 mAh
08/25/2010 08:45:26 [INFORMATION] batt: 99%, 4167 mV, 122 mA (113 avg), 28.8 C, 1339 mAh
08/25/2010 08:46:26 [INFORMATION] batt: 99%, 4167 mV, 118 mA (119 avg), 29.0 C, 1342 mAh
08/25/2010 08:47:26 [INFORMATION] batt: 99%, 4162 mV, 98 mA (81 avg), 29.1 C, 1344 mAh
08/25/2010 08:48:26 [INFORMATION] batt: 99%, 4167 mV, 94 mA (94 avg), 28.8 C, 1345 mAh
08/25/2010 08:49:26 [INFORMATION] batt: 99%, 4162 mV, 92 mA (91 avg), 28.7 C, 1345 mAh
08/25/2010 08:50:27 [INFORMATION] batt: 99%, 4167 mV, 80 mA (91 avg), 28.8 C, 1347 mAh
08/25/2010 08:51:27 [INFORMATION] batt: 100%, 4167 mV, 87 mA (76 avg), 28.8 C, 1348 mAh
08/25/2010 08:52:27 [INFORMATION] batt: 100%, 4167 mV, 81 mA (84 avg), 29.0 C, 1352 mAh
08/25/2010 08:53:27 [INFORMATION] batt: 100%, 4167 mV, 79 mA (79 avg), 29.1 C, 1353 mAh
08/25/2010 08:54:27 [INFORMATION] batt: 100%, 4167 mV, 79 mA (80 avg), 29.1 C, 1355 mAh
08/25/2010 08:55:27 [INFORMATION] batt: 100%, 4172 mV, 96 mA (85 avg), 29.3 C, 1355 mAh
08/25/2010 08:56:27 [INFORMATION] batt: 100%, 4172 mV, 94 mA (74 avg), 29.3 C, 1358 mAh
08/25/2010 08:57:27 [INFORMATION] batt: 100%, 4167 mV, 72 mA (79 avg), 29.5 C, 1358 mAh
08/25/2010 08:58:27 [INFORMATION] batt: 100%, 4172 mV, 88 mA (78 avg), 29.6 C, 1358 mAh
08/25/2010 08:59:27 [INFORMATION] batt: 100%, 4167 mV, 68 mA (69 avg), 29.3 C, 1358 mAh
08/25/2010 08:59:27 [INFORMATION] batt: charging BATTOFF [FULL]

I think that is the battery telling the "host" it's full, so the host asks it for its "set" capacity and reports that. Hence why we need learning, agreed.

Glad we're now on the same page ;)

Hi there dvgrhl - have a look over my past few posts; the three files that contain relevant code are quoted.

I think if we can create a simple C module that uses these functions to interogate the battery, we should output the "set" capacity and age - by reading the relevant registers, the include file has the addresses.

I may have a bash myself but I've not done any C in Linux for years! if you can get there quicker, please go ahead - I'll advise wherever I think I can.

I believe so, yes. Your no-charge analysis between 90-100 is correct.

Me too for voltage (see above log). However capacity is way down (but it was an on-charge).

As above - they use the same battery according to the Pre thread, so should use the same registers - hence why I posted the three different battery files earlier on. We just need to get it coded now!

I would avoid quick-plugging if poss; we need to get the raw values. Have a terminal up as root. Type "cat /sys/kernel/debug/batt* > /sdcard/batt" and hit RETURN at the end (if there is no keyboard, long-press Menu key). This will capture it to sdcard.

(edit: removed incorrect reference to pasting in terminal)

You're correct about ~50 seconds. However the log is cumulative only from the point of boot - it gets wiped on reboot. If the register changes but is within the 50 seconds, plugging will change the register before it is logged and therefore we'd lose the register value.

That is why we need the read_register functions to run every 1, 10 seconds so we can see exactly what is going on close to shutdown.