libera/#maemo/ Sunday, 2018-12-09

freemangordonShadowJK: ping18:53
spinal_ping18:53
freemangordonDocScrutinizer05: ping18:54
DocScrutinizer05?18:54
freemangordonDocScrutinizer05: have a coule of minutes?18:54
freemangordonin regards of bq chip18:55
DocScrutinizer05a few18:55
DocScrutinizer05shoot18:55
freemangordonwhile 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 wrong18:56
freemangordon*leste18:56
DocScrutinizer05it shouldn't be hardcoded anyway18:56
freemangordonwhy?18:56
DocScrutinizer0520 and 22 milli both make sense18:56
DocScrutinizer05why? because the driver is opretty generic18:57
freemangordonbut he said that if 30 is used, the reported value for design capacity on n900 starts making sense18:57
freemangordoninstead of > 2000 mAh it becomes closer to 1350 or somesuch18:58
DocScrutinizer05you don't want drivers named bq27xxx-10.ko bq27xxx-20.ko etc18:58
spinal_May paste little fragment from datasheet?18:58
freemangordonsure, now the question is - did anyone ever measured the current withdrawn from the battery and compared it with what is reported?18:59
DocScrutinizer05well, this shows that design capacity as flashed to bq27299 is incorrect18:59
DocScrutinizer05yes, I did18:59
freemangordonyep, my vague memories told me so :)19:00
freemangordonspinal_: see ^^^19:00
spinal_EEPROM Data Registers (EE_DATA) — Address 0x76 — 0x7F19:00
spinal_The EEPROM data registers contain information vital to the performance of the device. These registers are to be19:00
spinal_programmed during pack manufacturing to allow flexibility in the design values of the battery to be monitored.19:00
spinal_The EEPROM data registers are listed in Table 2. Detailed descriptions of what should be programmed follow.19:00
spinal_See the Programming the EEPROM section for detailed information on writing the values to EEPROM.19:00
spinal_0x76 ILMD Initial last measured discharge high byte19:00
freemangordonif reported current value is correct, then sense resistor value MUST be correct as well19:00
spinal_that's not a big deal for Nokia just to program right values to bq2720019:00
freemangordonand by correct I mean - matches the measured value19:01
spinal_we can only measure USB current when charging the phone19:01
freemangordonno19:01
freemangordonyou can measure the current directly on battery terminals19:01
spinal_you are right19:01
spinal_need to disconnect battery and connect it by wires19:02
spinal_i'll do it19:02
freemangordonand thats what DocScrutinizer05 did back then iirc19:02
freemangordonspinal_: please do19:02
freemangordonthat would definitely show if RS value is correct19:02
DocScrutinizer05>><spinal_> that's not a big deal for Nokia just to program right values to bq27200<< however they didn't19:03
spinal_i bet they did19:03
freemangordonok, measure the current and we'll see19:03
spinal_give me 10-15 minutes19:04
freemangordonsure19:04
freemangordonno hurry :)19:04
freemangordonI'll be glad if you;re right19:04
DocScrutinizer05grecheck 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 2019:04
DocScrutinizer05freemangordon: ^^^19:04
DocScrutinizer05then you also can check RS easily between minus of battery connector and GND e.g. on USB19:05
freemangordonyes, but I guess spinal_ has an old battery with unknown capacity19:05
DocScrutinizer05so what?19:06
DocScrutinizer0520 milliohms19:06
freemangordon:)19:06
DocScrutinizer05NOT hardcoded19:06
freemangordonyeah19:06
freemangordonthat's another issue19:06
freemangordonthe question now is whether 20 is the correct value for n90019:06
DocScrutinizer05yes, tis19:06
freemangordonatherwise for sure it should not be hardcoded19:06
freemangordonDocScrutinizer05: thanks a lot!19:08
DocScrutinizer05yw19:08
DocScrutinizer05my own fault, I came up with this 30mR a 7 years ago ;-OP19:08
freemangordonspinal_: ^^^ ;)19:09
DocScrutinizer05but... >><spinal_> that's not a big deal for Nokia just to program right values to bq27200<< however they didn't19:09
DocScrutinizer05freemangordon: http://maemo.cloud-7.de/maemo5/patches_n_tools/bq27k.py19:22
DocScrutinizer05original:  http://maemo.cloud-7.de/maemo5/usr/local/sbin/bq27200.sh19:23
DocScrutinizer05note the obsolete "30" in comment19:24
spinal_hm19:36
spinal_do I need to connect middle terminal too?19:36
spinal_that's gonna be hard19:36
spinal_doesn't start with just 2 terminals connected19:37
DocScrutinizer05http://termbin.com/ni5819:37
DocScrutinizer05yes, BSI disconnect causes emergency shutdown19:38
spinal_freemangordon, i thought....19:39
spinal_how do you propose to measure the current?19:40
spinal_with ampermeter19:40
spinal_ammeter19:40
freemangordonyes19:40
spinal_how?19:40
spinal_if I connect all wires and measure it when the phone is on19:40
spinal_what value should i get?19:40
spinal_the value going to the battery exclusively or to battery + working device?19:41
freemangordonthe same value that is reported by bq for current19:41
spinal_really?19:41
spinal_i19:41
freemangordonbattery + working device19:41
spinal_the value reported by the kernel is the current going from/to the battery19:41
freemangordonspinal_: I still think LMD is way easier19:41
freemangordonyes19:42
spinal_that's why you get message "The device consumes more memory than it gets from charge"19:42
freemangordonnot, this is nother story19:42
spinal_ah, sorry, my mistake you're right19:42
freemangordonyou should not connect charger/usb when measuring19:42
spinal_yep19:42
spinal_i still thinking how to connect all terminals without soldering :p19:43
spinal_seems i need more time19:44
DocScrutinizer05you shouldn't, it's pretty pointless and honestly I only was able to do wuth a frabkenstein battery with wires retrofitted to protection circuit19:44
DocScrutinizer05you shouldn't, it's pretty pointless and honestly I only was able to do with a frankenstein battery with wires retrofitted to protection circuit19:44
freemangordonspinal_: listen to what doc says, he knows what he is talking about. usually :p19:45
freemangordontry with LMD19:45
DocScrutinizer05measure resustance between battery connector - and device GND19:45
freemangordonwhy is that?19:45
freemangordonRS is serial to the batteru19:45
DocScrutinizer05or simply check LMD and compare to what you get when charging battery externally19:45
freemangordon*battery19:45
DocScrutinizer05hmm?19:46
DocScrutinizer05RS is in battery minus19:46
spinal_20mOhm is too little to measure it accurately anyway19:46
spinal_so, i only can use soldering, no other options19:49
DocScrutinizer05you ruin your device by soldering battery contacts19:49
DocScrutinizer05must not have tin/lead plating which as contact problems19:50
DocScrutinizer05has*19:50
spinal_yep19:50
spinal_so I will now measure current with simple USB and compare to what driver show19:51
DocScrutinizer05maybe believe Nokia?19:51
DocScrutinizer05while they never disclosed the RS balue, they use 20m in BME19:51
DocScrutinizer05afaik19:52
DocScrutinizer05and a new BL-5J(?) battery has a LMD of 1320 with RS=2219:53
DocScrutinizer051320 to 134019:53
DocScrutinizer05or believe me, I probed on disassembled device19:55
ShadowJK20mR 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 devices19:56
DocScrutinizer05I'm not sure Nokia programmed *anything* to BQ EEPROM19:56
DocScrutinizer05yeah, or you believe ShadowJK who knows his shit19:57
spinal_i need a way to connect to battery terminals without soldering and short circuit...19:58
spinal_probably i need to use paper for isolation and something to hold wires19:58
DocScrutinizer05funny enough I used exactly same rationale for argumenting why 30m might be more correct, a decade ago19:58
spinal_it's correct19:59
ShadowJKIt'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.19:59
DocScrutinizer05^^^19:59
spinal_so probably i gonna do it later, need to think20:00
ShadowJKDid anyone ever figure out how it all got put together in bme? Because bme sure as hell never cased for the coloumb counting in bq20:00
spinal_i was never satisfied how it shows the battery percentage20:01
spinal_it dropped occasionally very fast20:01
ShadowJKI wouldn't be surprised if somewhere in the bme code there was remains of dealing with nicad20:02
spinal_so I think they just didn't have the time to use all the power bq27200 provides20:02
spinal_i think they just relied on voltage for measurements20:02
DocScrutinizer05ShadowJK: you're right, there is20:03
spinal_I hope I will measure the current tomorrow, need more time20:03
DocScrutinizer05VME is cargop cult20:03
DocScrutinizer05BME*20:03
DocScrutinizer05spinal_: have fun. Please do _not_ bither me with results20:04
spinal_what is bither?20:05
ShadowJKbother20:06
ShadowJKIt'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 capacity20:08
DocScrutinizer05^^^20:08
DocScrutinizer05it's just meant to prove current20:08
DocScrutinizer05probe*20:08
DocScrutinizer05and voltage20:09
ShadowJKI wonder if the next iteration was more sane..20:10
ShadowJKBecause the previous N810 had just the nokie proprietary chip, N900 had both20:10
DocScrutinizer05N810 had a proprietary chip? Thought it did mere TI OMAP companion chip charging20:11
DocScrutinizer05plus software20:12
freemangordonShadowJK: you've measured RS directly on the board?20:12
ShadowJKDocScrutinizer05, no N810 was fully compliant with nokia 2mm barrel charging spec (which shifted a large part of regulation to the powersupply)20:13
ShadowJKfreemangordon, no20:13
DocScrutinizer05ShadowJK: aaj yep20:14
DocScrutinizer05freemangordon: I did20:15
freemangordonok20:15
ShadowJKFor a generic bq27200 driver, of course different device manufacturers will use different sense resistors20:16
DocScrutinizer05though iirc the appnotes also have 20m20:17
freemangordonright20:18
DocScrutinizer05doesn't forbid any manuif using 10 or eveb up to 50, so no hardcoding of 20 without module parameter override20:18
DocScrutinizer05this been all in my bq27xx.ko specs :-/20:19
freemangordonit is DTS now, module parameters are forbidden ;)20:19
DocScrutinizer05WUT??20:19
DocScrutinizer05fsck DTS20:20
DocScrutinizer05the DTS designers had no idea how hw works20:20
DocScrutinizer05actually hardcoding 20 would be exactly what I'd expect from DTS devils20:21
DocScrutinizer05cpmpletely ignoring the >>doesn't forbid any manuf using 10 or even up to 50<< reality20:22
freemangordonactually it is Nokia that hardcoded it back then20:22
freemangordonbefore DTS times20:22
freemangordonand seems nobody bothered to make it variable20:23
DocScrutinizer05sure, since nokia followed my fav approach of kernel tailored for device20:23
Wizzupwhich also meant that it was hard to upstream ;)20:23
DocScrutinizer05err, nokia never had any bq27xx module20:23
DocScrutinizer05nokia had NME20:24
DocScrutinizer05BME*20:24
DocScrutinizer05which obviously never goes upstream20:24
DocScrutinizer05maybe they gad sth similar in N920:25
DocScrutinizer05though N9 has no bq27200/bq2700020:26
DocScrutinizer05PT: 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/hps820:35
DocScrutinizer05OT even20:35
DocScrutinizer05MEH!!  UPSLOG(8)20:36
DocScrutinizer05WHY???20:37
DocScrutinizer05is /bar/run even supposed to not be world readable, with only owner being able to delete own pid file?20:42
DocScrutinizer05would make more sense to me20:43
DocScrutinizer05actually upsmon allows     -u username            If started as root, upsmon will setuid(2) to the user id associated with username for security.20:44
DocScrutinizer05so how would it inlink own pid file after that?20:44
DocScrutinizer05unlink*20:44
DocScrutinizer05and who needs such pid file anyway, and for what?20:45
Maxdamantus/scroll end21:44
sicelo20: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 reichel22:29
Wizzupsicelo: he's not here anymore, try other chan22:29
sicelothanks :)22:30

Generated by irclog2html.py 2.17.0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!