maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   RX-51 BME Replacement (https://talk.maemo.org/showthread.php?t=93183)

Kossuth 2014-10-14 05:16

Re: RX-51 BME Replacement
 
Actually I started to drain the battery for calibration controllably by maxing out the current drain and planning to cut the drain down to 20-50mA from the over 300-500mA by the time that the battery comes down to low voltages around 3400mV, but as always life happens and I had to be somewhere else and the battery drained in a flash at the end.

Cursing my failed attempt to calibrate I connected the charger and planned to try the routine again tomorrow. But when I booted the phone I noticed the chip had calibrated itself after all. I was almost sure It didn't have the needed 15secs below the 3248mV to set the EDV1 to 0. Has the procedure changes because of the BME replacement or was I just lucky? Normally with max drain my batteries havent lasted over few seconds below the treshold.

Ofcourse, I'm not complaining, I'm happy with this. I'm just pointing my experience out, so to possibly learn more.

alexporta 2014-10-14 20:55

Re: RX-51 BME Replacement
 
If I insert a fully charged battery (from the wall chargher) a battery that have done the calibrating cycle, my N900 doesn't start, it blinks the white light and turn off... it only start if I insert the charghing plug, then I can see the battery is ok and calibrated...

can I revert the BME pls?

Estel 2014-10-14 21:35

Re: RX-51 BME Replacement
 
Quote:

Originally Posted by Kossuth (Post 1442871)
Has the procedure changes because of the BME replacement or was I just lucky? Normally with max drain my batteries havent lasted over few seconds below the treshold.

Luck - the procedure can't be changed, as it's the chip itself that calibrates itself after 15 seconds below threshold.

BTW, I know you pain - sometimes, I discharged my 3Ah cell with >1A current in the N900 (flashlight, video recording, GPS, FM transmitter, 3G with 1KB pings every 2 seconds, etc) for the same purposes, and boy, how many times I forget to tune it down before shutdown... :D

BTW, just for the record - when discharging battery with artifically high rate (i.e. much quicker, that you would do normally), you're going to get lower max capacity value - because capacity is relative to discharge current (and in our case, even discharge pattern, as we're using variable discharge current along the way). Sometimes it's beneficial, as it gives you safety margin - for when you think you're approaching 6% during normal usage, you have - in fact - few more left. Or a "buffer" for heavy usage. Anyway, I like to have capacity rounded a little down, instead of up, and then being surprised when I need to do some heavy usage late in discharge stage... :cool:

/Estel

Kossuth 2014-10-15 07:10

Re: RX-51 BME Replacement
 
Quote:

Originally Posted by alexporta (Post 1442841)
I try also here, sorry for the cross posting

hi to all
I'm testing the BME replacing from Pali. Great work!
But I have a BIG problem. I use a wall charger with 4 batteries. So when I change a battery the one I insert is not calibrated and I have 0/0.
Can I revert to original or old or CSSU BME? If I try to use the stok one (the link given above) it says is not existing

Thanks in advance

If you are referring to this post giving you something about not existing, then your repositories might be messed up, check them. If you are referring to some other post, can you give a bit more info, for example copy paste from x-term or other more specific info on your action to revert to the stock-BME and the errors you are receiving.

biketool 2014-10-15 07:24

Re: RX-51 BME Replacement
 
Quote:

Originally Posted by malfunctioning (Post 1442859)
(snip) and Zaurus SL-C1000.

OT warning...
In the last posts by Android808 he was looking for someone with a working Z to run petittrack so he could do the full conversion of the source form QTE to QT4. http://www.qsl.net/n1vtn/petittrack.html
any chance you can install and PM him?

alexporta 2014-10-15 07:59

Re: RX-51 BME Replacement
 
Quote:

Originally Posted by Kossuth (Post 1443009)
If you are referring to this post giving you something about not existing, then your repositories might be messed up, check them. If you are referring to some other post, can you give a bit more info, for example copy paste from x-term or other more specific info on your action to revert to the stock-BME and the errors you are receiving.


thanks for your answer
it says me "BME version0.8.55+0m5" was not found

Kossuth 2014-10-15 08:41

Re: RX-51 BME Replacement
 
Quote:

Originally Posted by alexporta (Post 1443014)
thanks for your answer
it says me "BME version0.8.55+0m5" was not found

Did you copy/paste the command? I tried the command with -s tag (to simulate it, not to install) and it said that the file was found from downloads.maemo.nokia.com.

If I misspelled the filename, I got the error that the version was not found. Can you try to copy/paste the command and copy/paste the contents of the x-term then here? If the command is right, and you still get the error, you should check that the standard nokia and ovi repositories are enabled in HAM.

BTW I'm not sure, but you might want to read the whole thread again, where the quote came from, as there might be some other packages that have to be downgraded also. They might get downgraded automatically with the BME, but I can't be sure about this. There is always risk of screwing up your N900 when up/downgrading core system packages manually.

malfunctioning 2014-10-15 14:50

Re: RX-51 BME Replacement
 
Quote:

Originally Posted by biketool (Post 1443011)
OT warning...
In the last posts by Android808 he was looking for someone with a working Z to run petittrack so he could do the full conversion of the source form QTE to QT4. http://www.qsl.net/n1vtn/petittrack.html
any chance you can install and PM him?

Thank you for letting me know about this, biketool.

I just checked the OESF forum and I only saw a few posts about petittrack on the 5500. I will contact Android808 and see how I can help! :)

Kossuth 2014-10-16 07:50

Re: RX-51 BME Replacement
 
Quote:

Originally Posted by Estel (Post 1442977)
Luck - the procedure can't be changed, as it's the chip itself that calibrates itself after 15 seconds below threshold.

BTW, I know you pain - sometimes, I discharged my 3Ah cell with >1A current in the N900 (flashlight, video recording, GPS, FM transmitter, 3G with 1KB pings every 2 seconds, etc) for the same purposes, and boy, how many times I forget to tune it down before shutdown... :D
/Estel

Maybe OT, but this got me thinking, does the chip itself power down with the OS, or is it possible that it stays awake for at least 15 sec after shutdown, so it calibrates itself and I have actually myself corrupted the calibration before, by connecting the changer too fast? Also the scenario could be that when I drain the battery with high current and it drops down below the shutdown limit, the batterys voltage bounces little bit back just over the 3248mV after the phone is shutdown thus corrupting the calibration. Or just as you said, luck!

Estel 2014-10-17 11:29

Re: RX-51 BME Replacement
 
Quote:

Originally Posted by Kossuth (Post 1443104)
Maybe OT, but this got me thinking, does the chip itself power down with the OS

Chip memory is kept using power from main battery (negligible) or bupbat (the same one that keeps clock). It requires much less power than real-time clock, so even in the cases where you lose hour/date instantly on removing battery, your calibration data will persists for a ~10-20 seconds longer, allowing to replace batteries without need to re-calibrate.

Removing battery for longer (without working bupbat) results in chip losing data, and resetting itself to default 2048 mAh full charge capacity.

Device must be powered on for calibration to take effect. In fact, shutting it down for too long/too often during single discharge cycle, invalidate VDQ (valid discharge quality) flag, resulting in NOT taking that discharge cycle into account for calibration. Charging to full sets VDQ flag to 1, again.

/Estel

impeham 2014-10-18 22:01

Re: RX-51 BME Replacement
 
Is it possible to uninstall the replacement?

i can see that the following packages were changed during installation:

bme-rx-51 -> changed from 0.8.55+0m5 to 1.0-1
dsme-thermalobject-surface -> changed from 0.0.1+0m5 to 1.0-1
hald-addon-bme -> changed from 0.0.17+0m5 to 1.0-1
hostmode-gui -> changed from 0.4-1 (ii) to 0.4-1 (rc)
libbmeipc0 -> changed from 0.8.55+0m5 to 1.0-2
usbmode -> added

Thanks.

Estel 2014-10-19 11:28

Re: RX-51 BME Replacement
 
You got your answer - just install old packages (minus the usbmode and hostmode-gui things, they're unrelated). You can do it by giving apt specific version during reinstall, like:

apt-get install --reinstall bme-rx-51=0.8.55+0m5 dsme-thermalobject-surface=0.0.1+0m5

...etc, for all packages. Of course, you need to have repository containing it enabled, and if you don't want to get new stuff installed again next time you do apt-get upgrade, either disable bme replacement repo, or set all packages in question to hold:
echo "bme-rx-51 hold | dpkg --set-selections

...and so goes on for all packages. Unhold them by replacing "hold" with "install" when you want to upgrade to BME replacement, again.

/Estel

branja 2014-11-05 17:34

Re: RX-51 BME Replacement
 
Hi guys...

I have a bit of a problem...I installed everything (KP, CSSU-T, BME replacement packages, BNF...) And it worked well. Fully charged my phone, used it untill it shut itself of and then fully charged it again...it shows only three stages: 100 %, 50% and 4%...and it often changes from 50 to 100. Olso, I can't use BNF anymore cuz it won't start. Don't know how to give output from x-term, please help.
P.s. When I charge my phone it says that battery is not calibrated.

Estel 2014-11-06 11:59

Re: RX-51 BME Replacement
 
Are you sure that you're using most recent version of BNF (from -devel)? There were some changes aimed at supporting both bq27x00_battery module, and i2c read access, detecting which one is required.

To give output from x-term, just run said program in x-term (if required do it as root or with sudo - "sudo bnf", for example).

/Estel

branja 2014-11-06 15:24

Re: RX-51 BME Replacement
 
I'm using version 1.2, don't know if it's the latest...
The craziest thing is that it all worked well, I was able to use BNF to check everything that I wanted. I've probably installed something or deleted something by accident. This is the output from x-term after trying to start BNF.
~ $ root


BusyBox v1.10.2 (Debian 3:1.10.2.legal-1osso31+0cssu0) built-in shell (ash)
Enter 'help' for a list of built-in commands.

Nokia-N900:~# bnf
cat: read error: No data available
cat: read error: No data available
cat: read error: No data available
/usr/sbin/bnf-bq27x00: line 21: syntax error: / 1000
Nokia-N900:~#

If you guys can't figure it out, no problemo...I'll just flash it and start from scratch when I find some spare time. ;)

Kossuth 2014-11-06 18:04

Re: RX-51 BME Replacement
 
Quote:

Originally Posted by branja (Post 1446010)
Hi guys...

I have a bit of a problem...I installed everything (KP, CSSU-T, BME replacement packages, BNF...) And it worked well. Fully charged my phone, used it untill it shut itself of and then fully charged it again...it shows only three stages: 100 %, 50% and 4%...and it often changes from 50 to 100. Olso, I can't use BNF anymore cuz it won't start. Don't know how to give output from x-term, please help.
P.s. When I charge my phone it says that battery is not calibrated.

This has been asked and answerd in the first page of this thread, which you should have read before installing everything, or at least before asking, but here is the answer for the 100/50/4 battery problem.

Actually you have already answered yourself, as you said the phone informs you that the battery is not calibrated. Look at Estels signature and follow the link about mesuring batterys capacity on device. There you will find extraordinary good and well written guide to solve your problem by calibrating the charging chip.

Estel 2014-11-06 18:08

Re: RX-51 BME Replacement
 
OK, it fails due to lack of calibration data + the behavior of bq27x00_battery module, that stops giving any data on actual max capacity when device is uncalibrated, instead of kindly giving exactly what the hardware is telling it (default value of 2048 mAh). I tried to convince Pali that arbitrary breaking sysfsnode ''because'' is a bad idea, and that it should report whatever chip is telling it, no matter if we, (again) arbitrary decided it's good or bad... Whatever. Probably, I should stop taking care and just put some "ERROR: Battery doesn't seem to be calibrated and kernel module is broken in this case, send bug reports to (...)" into BNF when sysnode fails, instead of it failing silently.

Anyway, you will get BNF reports back if you (as root):

Code:

modprobe -r bq27x00_battery
Then, check what it reports, but I bet it's just uncalibrated. No idea why it havent calibrated itself - I would suggest charging it to max, again, disconnecting charger (checking if bnf says "VDQ: 1"), then using it normally, until it shuts itself down. If it doesn't calibrate *again*, we might want to debug it further - Pali ensured that device doesn't shut down before calibration takes place, and it seemed to work well. Maybe you just discovered a case, where it doesn't ;)

Or you just haven't had VDQ bit set since start, for some reason, or it got invalidated (for example, by shutting device down or rebooting it too many times - play it safe, don't shut down/reboot between charging to full and shutting down itself due to low power. And check BNf output if VDQ is still 1, from time to time... It should turn to 0 in the very last moment before shutdown, jsut after device calibrates itself).

/Estel

// Edit

Kossuth beat me to it. Thanks for the compliments, although I must admit that my guide is a little outdated, in the sense that it describes pre- BME-Replacement scenario, and while using BME replacement it should be much, much more simple - just install everything, charge to full, and discharge 'till it shuts down. unlike standard BMe, BME-Replacement *is* supposed to *not* shut down before calibration takes place.

Of course, things from the guide aren't obsolete in the meaning that it won't work - is just more "complicated" than it may be required for end user using BME Replacement . Of course, when something goes wrong, it's still perfectly usable for debugging, thanks to big sections explaining inner workings and why we're doing this or that.

branja 2014-11-06 19:34

Re: RX-51 BME Replacement
 
BNF works again. I will do all that in the incoming days. Fully charge it and wait 'till it shut itself of. Hopefully it wil be calibrated correct this time.
Thanks again fellas and sorry for not reading everything and posting...

pali 2014-12-24 08:31

Re: RX-51 BME Replacement
 
Quote:

Originally Posted by Raimu (Post 1432243)
After I moved to BMEreplacement, sometimes when I charge the battery full nowadays, the green "full" led light gets stuck somehow so that even after I remove the charger cord, if I set the screen off the green led returns. Is it something others experience and if so. is there a quick fix for this?

New version of hald-addon-bme package which should fix this problem is in bme-replacement repository. Update via apt-get. Thanks kolp for patches!

rewan 2015-01-13 19:50

Re: RX-51 BME Replacement
 
I have problem when booting to NITdroid. The red LED is blinking some times and battery applet shows [0]. This is after BME replacement. The module bq27x00_battery disapear for 3 seconds in /sys/class/power_supply/ and back to normal 2 seconds.

colin.stephane 2015-01-19 10:40

Re: RX-51 BME Replacement
 
Hi all,


From what package 'bnf' belong ???

Code:

-bash-2.05b$ root
-bash-2.05b# bnf
-bash: bnf: command not found
-bash-2.05b#

Thanks.

saponga 2015-01-19 10:45

Re: RX-51 BME Replacement
 
Quote:

Originally Posted by colin.stephane (Post 1457219)
Hi all,


From what package 'bnf' belong ???

Code:

-bash-2.05b$ root
-bash-2.05b# bnf
-bash: bnf: command not found
-bash-2.05b#

Thanks.

It's a "package" it self but AFAIK it'll run only in a N900. :)

colin.stephane 2015-01-19 10:55

Re: RX-51 BME Replacement
 
Quote:

Originally Posted by saponga (Post 1457220)
It's a "package" it self but AFAIK it'll run only in a N900. :)

Thanks, just installed it right now ...

A++

Aydan 2015-01-26 19:33

Re: RX-51 BME Replacement
 
2 Attachment(s)
I recently installe BME replacement and just noticed that if you leave the phone on the charger for a long time (e.g. overnight) it will cycle between charging and discharging too often for my tastes. I think this will wear the battery unnecessarily fast.
See the attachments.
If i remember correctly the original bme would only cycle 3-4 hours on idle and the replacement BME cycles about every 1.5 hours.
I can also provide batteryeye logs if requested.
Please increase the hysteresis between stop charging and start charging states

Regards
Aydan

PS: I patched batteryeye to log charge and capacity while charging.

Aydan 2015-01-26 19:37

Re: RX-51 BME Replacement
 
Could you also have a look at this thread?
It might be solvable with a change in the replacement BME.

Regards
Aydan

Estel 2015-02-05 12:23

Re: RX-51 BME Replacement
 
In my opinion, all the thresholds (which voltage/capacity should we charge to, when to start charging again, etc) should be configurable for power-users, via sysfsnodes. This way, more creative use cases (like, charging only to 80% of capacity during "regular" daily usage, for tremendous saves on battery life wear) would be possible.

I've suggested it long time ago, but it seems that Pali haven't had time - or will - to implement those. Considering, that bug with graphical indication of battery level in status menu still isn't fixed (it uses "design capacity", not real one, as a max, so 1200 mAh on 3000 mAh battery will be shown as full battery icon, 600 mAh as half-full, etc), I think that the former (time) is more likely case. Anyone knowledgeable with source code is highly encouraged to send patches...

/Estel

Estel 2015-02-05 12:24

Re: RX-51 BME Replacement
 
In my opinion, all the thresholds (which voltage/capacity should we charge to, when to start charging again, etc) should be configurable for power-users, via sysfsnodes. This way, more creative use cases (like, charging only to 80% of capacity during "regular" daily usage, for tremendous saves on battery life wear) would be possible.

I've suggested it long time ago, but it seems that Pali haven't had time - or will - to implement those. Considering, that bug with graphical indication of battery level in status menu still isn't fixed (it uses "design capacity", not real one, as a max, so 1200 mAh on 3000 mAh battery will be shown as full battery icon, 600 mAh as half-full, etc), I think that the former (time) is more likely case. Anyone knowledgeable with source code is highly encouraged to send patches...

/Estel

pali 2015-02-05 12:28

Re: RX-51 BME Replacement
 
All what can be set to bq24150a chip is already exported via sysfs. Also bq2415x_charger driver can be switched to "manual" operation when userspace is responsible for charging, setting values, etc, ... So it is already implemented, you just need to write own script/SW/whatever which will set what you want on your own.

xes 2015-02-07 14:36

Re: RX-51 BME Replacement
 
Just one thumb up to highlight the great work done with bme replacement.

I have installed it since a few days and so far it works better than stock bme!

Thanks!

muto 2015-02-07 16:16

Re: RX-51 BME Replacement
 
The bme replacement seems to be a very nice and useful but i have one problem. After i install it the host mode/usb functionality stops working. Host mode says something about connected charger and does not work. Any ideas how to solve this issue? Luckily i have some extra N900s i can use for testing :).

marmistrz 2015-05-14 07:44

Re: RX-51 BME Replacement
 
I'm having severe problems with my phone, bme replacement is one of the suspects. Is this enough to remove the bme replacement?

Code:

apt-get install bme-rx-51=0.8.55+0m5 dsme-thermalobject-surface=0.
0.1+0m5 hald-addon-bme=0.0.17+0m5 libbmeipc0=0.8.55+0m5


Akkumaru 2015-06-06 03:34

Re: RX-51 BME Replacement
 
after multiple times of trying to calibrate I have been unsuccessful all the time. As reaching low battery, I turn on offline mode and turn display brightness to minimum while having the screen on all the time. I've also just let it die without changing any settings. I've also made it die while playing a video. All unsuccessful. Also I am sure the VDQ states 1 but idk it never calibrates. Help?

zod 2021-08-24 07:15

Re: RX-51 BME Replacement
 
1 Attachment(s)
After strugging to calibrate battery almost a year I decided to take deeper look.
Correct solution is to calibrate according to instructions. Tried this two times but failed. VDQ turned to 0 too early. Next time i'll also disable modem and maybe kill some more proccesses.
Next was to fix status-area-applet-battery or hald-addon-bme to report LMD when /sys/class/power_supply/bq27200-0/capacity is empty and LMD itself has reasonable value but I went easiest way and just disabled Pali's code in bq27x00_battery kernel module.
Works fine for me as my Last Measured Discharge (LMD) is 1155mAh. When the calibration succeeds I'll probably revert to original module so this will be temporary workaround.

If you have same problem, ie battery needs calibration but LMD is something reasonable then you can install kernel-power==1:2.6.28-10power53 and use attached Attachment 41486.
After coping bq27x00_battery.ko to /lib/modules/current/ just 'rmmod bq27x00_battery && modprobe bq27x00_battery'

To revert back just reinstall kernel-power-modules

Patches to Pali's patches:
Code:

--- kernel-power.bak/debian/patches/bq27x00-fix-nac.diff    2021-08-19 14:18:10.000000000 +0300
+++ kernel-power-2.6.28/debian/patches/bq27x00-fix-nac.diff    2021-08-19 16:18:07.299138619 +0300
@@ -10,7 +10,7 @@
 +    bool is_bq27500 = di->chip == BQ27500;
 +
 +    flags = bq27x00_read(di, BQ27x00_REG_FLAGS, !is_bq27500);
-+    if (flags >= 0 && !is_bq27500 && (flags & BQ27000_FLAG_CI))
++    if (0 && flags >= 0 && !is_bq27500 && (flags & BQ27000_FLAG_CI))
 +        return -ENODATA;
 +
      return bq27x00_battery_read_charge(di, BQ27x00_REG_NAC);
--- kernel-power.bak/debian/patches/bq27x00-upstream.diff    2021-08-19 14:18:10.000000000 +0300
+++ kernel-power-2.6.28/debian/patches/bq27x00-upstream.diff    2021-08-24 08:13:24.560397092 +0300
@@ -38,7 +38,7 @@
 +#include <linux/power/bq27x00_battery.h>
 
 -#define DRIVER_VERSION            "1.0.0"
-+#define DRIVER_VERSION            "1.2.0"
++#define DRIVER_VERSION            "1.2.0x"
 
  #define BQ27x00_REG_TEMP        0x06
  #define BQ27x00_REG_VOLT        0x08
@@ -362,9 +362,14 @@
 +
 +    cache.flags = bq27x00_read(di, BQ27x00_REG_FLAGS, is_bq27500);
 +    if (cache.flags >= 0) {
-+        if (!is_bq27500 && (cache.flags & BQ27000_FLAG_CI)) {
++        /* We only have to read charge design full once */
++        if (di->charge_design_full <= 0)
++            di->charge_design_full = bq27x00_battery_read_ilmd(di);
++        cache.charge_full = bq27x00_battery_read_lmd(di);
++
++        if (!is_bq27500 && ((cache.flags & BQ27000_FLAG_CI) || 1) && cache.charge_full==di->charge_design_full) {
 +            dev_info(di->dev, "battery is not calibrated! ignoring capacity values\n");
-+            cache.capacity = -ENODATA;
++            cache.capacity = -ENODATA; // or BL-5J default 1320mAh ?
 +            cache.energy = -ENODATA;
 +            cache.time_to_empty = -ENODATA;
 +            cache.time_to_empty_avg = -ENODATA;
@@ -376,14 +381,9 @@
 +            cache.time_to_empty = bq27x00_battery_read_time(di, BQ27x00_REG_TTE);
 +            cache.time_to_empty_avg = bq27x00_battery_read_time(di, BQ27x00_REG_TTECP);
 +            cache.time_to_full = bq27x00_battery_read_time(di, BQ27x00_REG_TTF);
-+            cache.charge_full = bq27x00_battery_read_lmd(di);
 +        }
 +        cache.temperature = bq27x00_battery_read_temperature(di);
 +        cache.cycle_count = bq27x00_battery_read_cyct(di);
-+
-+        /* We only have to read charge design full once */
-+        if (di->charge_design_full <= 0)
-+            di->charge_design_full = bq27x00_battery_read_ilmd(di);
      }

Some useful links:
https://wiki.maemo.org/Bme_replacement
https://talk.maemo.org/showpost.php?...&postcount=846
https://talk.maemo.org/showpost.php?...93&postcount=2
https://talk.maemo.org/showthread.php?t=95816
http://maemo.org/packages/view/bnf/ // use bnf-i2c when CI=1 and using original bq27x00_battery.ko


All times are GMT. The time now is 17:53.

vBulletin® Version 3.8.8