**** BEGIN LOGGING AT Sun Dec 09 03:00:01 2018 Dec 09 17:53:51 ShadowJK: ping Dec 09 17:53:53 ping Dec 09 17:54:02 DocScrutinizer05: ping Dec 09 17:54:23 ? Dec 09 17:54:52 DocScrutinizer05: have a coule of minutes? Dec 09 17:55:00 in regards of bq chip Dec 09 17:55:04 a few Dec 09 17:55:46 shoot Dec 09 17:56:07 while working on lested, one of the devs said that maybe the sense resistor value used to do the calculations of current, capacity etc in the kernel driver is wrong Dec 09 17:56:11 *leste Dec 09 17:56:37 it shouldn't be hardcoded anyway Dec 09 17:56:50 why? Dec 09 17:56:56 20 and 22 milli both make sense Dec 09 17:57:14 why? because the driver is opretty generic Dec 09 17:57:39 but he said that if 30 is used, the reported value for design capacity on n900 starts making sense Dec 09 17:58:17 instead of > 2000 mAh it becomes closer to 1350 or somesuch Dec 09 17:58:18 you don't want drivers named bq27xxx-10.ko bq27xxx-20.ko etc Dec 09 17:58:55 May paste little fragment from datasheet? Dec 09 17:59:24 sure, now the question is - did anyone ever measured the current withdrawn from the battery and compared it with what is reported? Dec 09 17:59:25 well, this shows that design capacity as flashed to bq27299 is incorrect Dec 09 17:59:39 yes, I did Dec 09 18:00:03 yep, my vague memories told me so :) Dec 09 18:00:12 spinal_: see ^^^ Dec 09 18:00:14 EEPROM Data Registers (EE_DATA) — Address 0x76 — 0x7F Dec 09 18:00:15 The EEPROM data registers contain information vital to the performance of the device. These registers are to be Dec 09 18:00:15 programmed during pack manufacturing to allow flexibility in the design values of the battery to be monitored. Dec 09 18:00:15 The EEPROM data registers are listed in Table 2. Detailed descriptions of what should be programmed follow. Dec 09 18:00:15 See the Programming the EEPROM section for detailed information on writing the values to EEPROM. Dec 09 18:00:29 0x76 ILMD Initial last measured discharge high byte Dec 09 18:00:52 if reported current value is correct, then sense resistor value MUST be correct as well Dec 09 18:00:53 that's not a big deal for Nokia just to program right values to bq27200 Dec 09 18:01:21 and by correct I mean - matches the measured value Dec 09 18:01:23 we can only measure USB current when charging the phone Dec 09 18:01:28 no Dec 09 18:01:44 you can measure the current directly on battery terminals Dec 09 18:01:58 you are right Dec 09 18:02:10 need to disconnect battery and connect it by wires Dec 09 18:02:12 i'll do it Dec 09 18:02:18 and thats what DocScrutinizer05 did back then iirc Dec 09 18:02:28 spinal_: please do Dec 09 18:02:56 that would definitely show if RS value is correct Dec 09 18:03:02 >> that's not a big deal for Nokia just to program right values to bq27200<< however they didn't Dec 09 18:03:33 i bet they did Dec 09 18:03:50 ok, measure the current and we'll see Dec 09 18:04:02 give me 10-15 minutes Dec 09 18:04:05 sure Dec 09 18:04:09 no hurry :) Dec 09 18:04:31 I'll be glad if you;re right Dec 09 18:04:33 grecheck LMD vs writing on your battery. When it's vorrect odds are you got right RS, when it's 50% off then you may conclude 30 is not a good value and you better use 20 Dec 09 18:04:48 freemangordon: ^^^ Dec 09 18:05:34 then you also can check RS easily between minus of battery connector and GND e.g. on USB Dec 09 18:05:35 yes, but I guess spinal_ has an old battery with unknown capacity Dec 09 18:06:04 so what? Dec 09 18:06:09 20 milliohms Dec 09 18:06:14 :) Dec 09 18:06:17 NOT hardcoded Dec 09 18:06:21 yeah Dec 09 18:06:28 that's another issue Dec 09 18:06:42 the question now is whether 20 is the correct value for n900 Dec 09 18:06:53 yes, tis Dec 09 18:06:55 atherwise for sure it should not be hardcoded Dec 09 18:08:08 DocScrutinizer05: thanks a lot! Dec 09 18:08:12 yw Dec 09 18:08:38 my own fault, I came up with this 30mR a 7 years ago ;-OP Dec 09 18:09:00 spinal_: ^^^ ;) Dec 09 18:09:13 but... >> that's not a big deal for Nokia just to program right values to bq27200<< however they didn't Dec 09 18:22:03 freemangordon: http://maemo.cloud-7.de/maemo5/patches_n_tools/bq27k.py Dec 09 18:23:36 original: http://maemo.cloud-7.de/maemo5/usr/local/sbin/bq27200.sh Dec 09 18:24:15 note the obsolete "30" in comment Dec 09 18:36:34 hm Dec 09 18:36:41 do I need to connect middle terminal too? Dec 09 18:36:46 that's gonna be hard Dec 09 18:37:15 doesn't start with just 2 terminals connected Dec 09 18:37:42 http://termbin.com/ni58 Dec 09 18:38:24 yes, BSI disconnect causes emergency shutdown Dec 09 18:39:57 freemangordon, i thought.... Dec 09 18:40:05 how do you propose to measure the current? Dec 09 18:40:27 with ampermeter Dec 09 18:40:31 ammeter Dec 09 18:40:32 yes Dec 09 18:40:34 how? Dec 09 18:40:48 if I connect all wires and measure it when the phone is on Dec 09 18:40:52 what value should i get? Dec 09 18:41:08 the value going to the battery exclusively or to battery + working device? Dec 09 18:41:13 the same value that is reported by bq for current Dec 09 18:41:17 really? Dec 09 18:41:19 i Dec 09 18:41:22 battery + working device Dec 09 18:41:43 the value reported by the kernel is the current going from/to the battery Dec 09 18:41:56 spinal_: I still think LMD is way easier Dec 09 18:42:01 yes Dec 09 18:42:03 that's why you get message "The device consumes more memory than it gets from charge" Dec 09 18:42:28 not, this is nother story Dec 09 18:42:39 ah, sorry, my mistake you're right Dec 09 18:42:40 you should not connect charger/usb when measuring Dec 09 18:42:48 yep Dec 09 18:43:01 i still thinking how to connect all terminals without soldering :p Dec 09 18:44:08 seems i need more time Dec 09 18:44:20 you shouldn't, it's pretty pointless and honestly I only was able to do wuth a frabkenstein battery with wires retrofitted to protection circuit Dec 09 18:44:47 you shouldn't, it's pretty pointless and honestly I only was able to do with a frankenstein battery with wires retrofitted to protection circuit Dec 09 18:45:19 spinal_: listen to what doc says, he knows what he is talking about. usually :p Dec 09 18:45:27 try with LMD Dec 09 18:45:28 measure resustance between battery connector - and device GND Dec 09 18:45:43 why is that? Dec 09 18:45:50 RS is serial to the batteru Dec 09 18:45:52 or simply check LMD and compare to what you get when charging battery externally Dec 09 18:45:54 *battery Dec 09 18:46:17 hmm? Dec 09 18:46:28 RS is in battery minus Dec 09 18:46:32 20mOhm is too little to measure it accurately anyway Dec 09 18:49:02 so, i only can use soldering, no other options Dec 09 18:49:44 you ruin your device by soldering battery contacts Dec 09 18:50:19 must not have tin/lead plating which as contact problems Dec 09 18:50:26 has* Dec 09 18:50:42 yep Dec 09 18:51:03 so I will now measure current with simple USB and compare to what driver show Dec 09 18:51:06 maybe believe Nokia? Dec 09 18:51:36 while they never disclosed the RS balue, they use 20m in BME Dec 09 18:52:13 afaik Dec 09 18:53:16 and a new BL-5J(?) battery has a LMD of 1320 with RS=22 Dec 09 18:53:36 1320 to 1340 Dec 09 18:55:44 or believe me, I probed on disassembled device Dec 09 18:56:46 20mR is the correct nominal value. the components (there are two) don't seem that accurate from device to device, I've seen between 21 and 23 in real life devices Dec 09 18:56:55 I'm not sure Nokia programmed *anything* to BQ EEPROM Dec 09 18:57:45 yeah, or you believe ShadowJK who knows his shit Dec 09 18:58:13 i need a way to connect to battery terminals without soldering and short circuit... Dec 09 18:58:50 probably i need to use paper for isolation and something to hold wires Dec 09 18:58:53 funny enough I used exactly same rationale for argumenting why 30m might be more correct, a decade ago Dec 09 18:59:13 it's correct Dec 09 18:59:41 It's actuall 2pcs 10mR connected in series. One of the Nokia-proprietary chips tap off one of the sense resistors, and bq chip taps off of both. Dec 09 18:59:55 ^^^ Dec 09 19:00:07 so probably i gonna do it later, need to think Dec 09 19:00:16 Did anyone ever figure out how it all got put together in bme? Because bme sure as hell never cased for the coloumb counting in bq Dec 09 19:01:26 i was never satisfied how it shows the battery percentage Dec 09 19:01:48 it dropped occasionally very fast Dec 09 19:02:05 I wouldn't be surprised if somewhere in the bme code there was remains of dealing with nicad Dec 09 19:02:19 so I think they just didn't have the time to use all the power bq27200 provides Dec 09 19:02:56 i think they just relied on voltage for measurements Dec 09 19:03:39 ShadowJK: you're right, there is Dec 09 19:03:42 I hope I will measure the current tomorrow, need more time Dec 09 19:03:49 VME is cargop cult Dec 09 19:03:55 BME* Dec 09 19:04:28 spinal_: have fun. Please do _not_ bither me with results Dec 09 19:05:01 what is bither? Dec 09 19:06:28 bother Dec 09 19:08:11 It's not just the design capacity that is not set properly, it's also the voltage thresholds, the chip doesn't work properly in normal use because the device gets shut down before the voltage is low enough for bq27200 to update the current battery capacity Dec 09 19:08:31 ^^^ Dec 09 19:08:45 it's just meant to prove current Dec 09 19:08:51 probe* Dec 09 19:09:11 and voltage Dec 09 19:10:26 I wonder if the next iteration was more sane.. Dec 09 19:10:45 Because the previous N810 had just the nokie proprietary chip, N900 had both Dec 09 19:11:52 N810 had a proprietary chip? Thought it did mere TI OMAP companion chip charging Dec 09 19:12:08 plus software Dec 09 19:12:22 ShadowJK: you've measured RS directly on the board? Dec 09 19:13:38 DocScrutinizer05, no N810 was fully compliant with nokia 2mm barrel charging spec (which shifted a large part of regulation to the powersupply) Dec 09 19:13:43 freemangordon, no Dec 09 19:14:44 ShadowJK: aaj yep Dec 09 19:15:07 freemangordon: I did Dec 09 19:15:23 ok Dec 09 19:16:42 For a generic bq27200 driver, of course different device manufacturers will use different sense resistors Dec 09 19:17:52 though iirc the appnotes also have 20m Dec 09 19:18:25 right Dec 09 19:18:50 doesn't forbid any manuif using 10 or eveb up to 50, so no hardcoding of 20 without module parameter override Dec 09 19:19:37 this been all in my bq27xx.ko specs :-/ Dec 09 19:19:38 it is DTS now, module parameters are forbidden ;) Dec 09 19:19:51 WUT?? Dec 09 19:20:17 fsck DTS Dec 09 19:20:34 the DTS designers had no idea how hw works Dec 09 19:21:46 actually hardcoding 20 would be exactly what I'd expect from DTS devils Dec 09 19:22:32 cpmpletely ignoring the >>doesn't forbid any manuf using 10 or even up to 50<< reality Dec 09 19:22:34 actually it is Nokia that hardcoded it back then Dec 09 19:22:46 before DTS times Dec 09 19:23:02 and seems nobody bothered to make it variable Dec 09 19:23:11 sure, since nokia followed my fav approach of kernel tailored for device Dec 09 19:23:39 which also meant that it was hard to upstream ;) Dec 09 19:23:59 err, nokia never had any bq27xx module Dec 09 19:24:24 nokia had NME Dec 09 19:24:28 BME* Dec 09 19:24:37 which obviously never goes upstream Dec 09 19:25:29 maybe they gad sth similar in N9 Dec 09 19:26:16 though N9 has no bq27200/bq27000 Dec 09 19:35:31 PT: why does a command that works fine under user account try and fail to write to /var/run/upslog.pid and still work? http://termbin.com/hps8 Dec 09 19:35:37 OT even Dec 09 19:36:54 MEH!! UPSLOG(8) Dec 09 19:37:04 WHY??? Dec 09 19:42:41 is /bar/run even supposed to not be world readable, with only owner being able to delete own pid file? Dec 09 19:43:05 would make more sense to me Dec 09 19:44:07 actually upsmon allows -u username If started as root, upsmon will setuid(2) to the user id associated with username for security. Dec 09 19:44:37 so how would it inlink own pid file after that? Dec 09 19:44:43 unlink* Dec 09 19:45:16 and who needs such pid file anyway, and for what? Dec 09 20:44:17 /scroll end Dec 09 21:29:12 20:58 < spinal_> i need a way to connect to battery terminals without soldering and short circuit... << http://n900.elektranox.org/serial-adapter.html .. one neat way by Sebastian reichel Dec 09 21:29:50 sicelo: he's not here anymore, try other chan Dec 09 21:30:54 thanks :) **** ENDING LOGGING AT Mon Dec 10 03:00:00 2018