Active Topics

 


Reply
Thread Tools
Posts: 2,154 | Thanked: 8,464 times | Joined on May 2010
#1
After long time I'm announcing BME Replacement project for testing.

This project aims to replace Nokia proprietary closed source software BME which is used for Battery Management on Nokia N900 in Maemo 5 system. It is responsible for charging battery, broadcasting battery status to maemo applications, reporting battery health status, capacity, temperature, charge time, ...

Project is divided into 4 parts:

1. kernel drivers: isp1704_charger, bq2415x_charger, bq27x00_battery, rx51_battery

2. userspace daemon hald-addon-bme which exporting battery and charger information to HAL, checking health status and setting correct LED charging patterns

3. usbmode script & GUI for switching between USB peripheral & host mode

4. maemo compatiblity scripts & libraries:

* fake libbmeipc library which has same interface as closed Nokia library but implemented functions use above new kernel drivers (instead direct RAW i2c access)

* dsme-thermalobject-surface plugin which reading battery temperature from new kernel drivers

* bme-rx-51 upstart script for loading kernel drivers


Kernel drivers are included in upstream linux kernel (version 3.14) and also backported to maemo kernel-power (v52).

Package usbmode for switching between peripheral & host mode is in Maemo Extras repository and thread for discussion here.

Userspace daemons, libraries and scripts are in packages in new bme-replacement repository:

deb http://maemo.merlin1991.at/cssu/bme-replacement/ fremantle free

If you want to test new bme replacement project on top of Maemo 5, you can do it at your own risk. You must have installed kernel-power v52 and after that you can add above apt repository to system. Basic apt-get upgrade should update all packages.

Please note that packages from bme-replacement repository replacing system Maemo packages! And this can cause breaking Maemo system or make it unbootable.

Also using bme replacement kernel or userspace packages could damage battery or phone. Battery Management is critical part of SW and HW! You are using it at your own risk!

Source code is on gitorious: https://gitorious.org/rx51-bme-replacement

Just to note: I'm using it for more than year and I have no problem.

Last edited by pali; 2020-10-02 at 23:22.
 

The Following 54 Users Say Thank You to pali For This Useful Post:
Posts: 1,424 | Thanked: 2,623 times | Joined on Jan 2011 @ Touring
#2
This is great, good work Pali for building OSS BME replacement and for USB mode.

Since you are intimate with the system I wonder if the following are possible in software.

One improvement in the charging system itself would be to have a timed reset or renegotiate of the charging every few minutes for the users who use bicycle dynamos, solar chargers, maybe even home mains chargers when they experience a brownout.
When there is an interruption in charging the N900 will dial back the amps(charging rate) to keep voltage from dropping and even when power is restored like the sun comes out of the clouds or a cyclist hits a downhill the low charge rate is maintained. Cases like this where there might only be one or two sun breaks in an afternoon or ten minutes of downhill for every hour of mountain climb in a long bike tour mean that the N900 user has to remember to unplug and replug when incoming power will be high, otherwise they miss out on that vital charging opportunity. If not standard perhaps having an "unreliable power" option in USB mode which resets charging every few minutes if below a determined charge rate.

Another improvement is if possible to free the charging from requiring the shorted data leads, this might not be ideal for a smart charging system, if so requiring a change in config file would be reasonable. Users who for example have ripped out their USB port or installed an inductive charging system need to also install a battery charge manager board and solder directly to battery connectors rather that using the very nice charge management system internal to the N900,fitting the Li-po manager is tricky with a regular cover and even with a double battery/mugen cover. It would be great to run one wire to a ground and the other to the positive USB pad and actually see my charging, one hack used was to actually solder a switch across the secondary data pads int he battery area, this is a crude hack since it requires removing the battery to switch to normal USB operation.

Last edited by biketool; 2014-05-14 at 14:39.
 

The Following 6 Users Say Thank You to biketool For This Useful Post:
Posts: 159 | Thanked: 217 times | Joined on Oct 2011
#3
It seems that the behavior with the new BME is still the same as reported in the old BME replacement thread http://talk.maemo.org/showpost.php?p...2&postcount=17. Is there something I can check where the problem migt lie in my system.

So basically my phone shows three levels for battery: full, 50% or low. And basically they fluctuate between the half and low depending on how much current I draw from the battery. Also when charging, the applet shows no data or battery not calibrated.
 

The Following User Says Thank You to Kossuth For This Useful Post:
Posts: 2,154 | Thanked: 8,464 times | Joined on May 2010
#4
@Kossuth: this means your battery is not caliberated. Fully discharge it, then it charge to full and discharge again.
 

The Following User Says Thank You to pali For This Useful Post:
Posts: 159 | Thanked: 217 times | Joined on Oct 2011
#5
I will do the full calibration routine when I have spare time in my hands for it. Is it really neccessary to have calibrated battery to use the new BME, because I frequently change batteries (3 separate), and the Nokia BME worked reasonable (not perfectly) with the info it got from the batterys capacity resistor? It also showed the battery status when charging.
 
Posts: 2,154 | Thanked: 8,464 times | Joined on May 2010
#6
yes it is needed. bme replacement reading all values from hw chips registers and you need to "calibrate" chip to work...
 

The Following 4 Users Say Thank You to pali For This Useful Post:
Posts: 1,378 | Thanked: 1,604 times | Joined on Jun 2010 @ Göteborg, Sweden
#7
Originally Posted by pali View Post
@Kossuth: this means your battery is not caliberated. Fully discharge it, then it charge to full and discharge again.
I recall somewhere you wrote that one should wait a few hours between a discharge and the recharge. You don't mention that here. Am I mistaken, and if not, what was the rationale?

Also, do you recommend leaving then phone unused towards the end of battery life for a gentle full-discharge, or a normal-type use until lights-out?

Are the bme replacement files you put in the "merlin" repo any different to those you had on your own server?

Last edited by handaxe; 2014-05-15 at 23:29.
 

The Following User Says Thank You to handaxe For This Useful Post:
Posts: 159 | Thanked: 217 times | Joined on Oct 2011
#8
What comes to light use towards the end of the battery, at least in my case it is required, because if I load the phone too much when the battery is almost empty (over 200mA current, WLAN, GPS, Screen up, etc.) the device shuts down before the bq27200.sh 5 reports the EDV1 bit changing from 0 to 1, which is required for calibration.

The battery voltage has to remain between 3248mV and 3198mV for 15secs for the EDV1 bit change to 1, and if it drops below 3198mV too quickly, the device shuts down before correct calibration. This info from Estels guide.

Edit: It's around 3300mV that the drop becomes fast, so at that point I shut down the gps and screen. Wlan was changed to GPRS at 3350mV, because GPRS connection at start draws a lot (600mA) so it could empty the battery too quickly if done too late. Of course change to offline mode could be done later.

Last edited by Kossuth; 2014-05-16 at 05:38. Reason: Drop info
 
nokiabot's Avatar
Posts: 1,974 | Thanked: 1,834 times | Joined on Mar 2013 @ india
#9
Can bme help on something here ??? http://talk.maemo.org/showthread.php...0&goto=newpost
 
Posts: 159 | Thanked: 217 times | Joined on Oct 2011
#10
So far I've only charged to full and discharged once, but already I'm seeing info while charging. I'll charge the battery to full and see how the gauge works now.

It is strange that the Applet informed me about the missing calibration only when charging, and not during normal usage. I thought I've done calibration with this phone, but it might have been my previous machine that suffered the fate of the dreaded usb port coming loose.
 
Reply

Tags
bme-replacement


 
Forum Jump


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