Reply
Thread Tools
Posts: 458 | Thanked: 783 times | Joined on Jan 2010 @ France
#531
Originally Posted by pali View Post
This values are exported by HAL, not by my program/module, so I cannot change it. And it is correct, see specification battery.charge_level of HAL. BME has bad values (it use its own values which is not correct for HAL).

Do not create duplicate messages!!! (Remove duplicate from other threads!)
Ok, so let me give you more informations :

The values reported are BAD when fetched with the command (you can trust me on that) :

Code:

lshal -u /org/freedesktop/Hal/devices/computer_power_supply_battery_bq27200_0
How can you explain the 'battery.charge_level.percentage' reported as '0' in the example with a 25% charged battery properly reported by the other command :

Code:
lshal -u /org/freedesktop/Hal/devices/bme
Since I also use the 'battery' applet v0.4 you patched to reflect values from the backported driver, I can afirm the values are FALSE ...

Easy to verify step by step, if I modprobe -r bq27x00_battery then on the desktop, after some seconds for the applet refresh, the value revert back to the bme value and report properly 25% of battery available, if I modprobe the backported driver then, the applet refresh and show 0% of battery available ...

I have installed the v47 since you released it, and no problem until today.

So the question is : What I have made today ?

Answer, here is how I triggered this BUG :

I have a desktop battery charger, and yesterday night I have omitted to charge my N900, so this morning I have powered off the N900 because I have no more battery power and the device reported 2%.

Then I have replaced the battery by the one fully charged by my desktop charger some days ago, and during today the problem occur ...

Since the problem occur, the value reported for parameter 'battery.charge_level.percentage' is '0' and this is the value used by the applet 'battery' you patched ...

How can you explain, today, my applet reported 0% battery available during all the afternoon ?

It look like bme values reported take care of this scenario (changing physically the used battery by one fully charged) where the new driver does not ...

So there is really a bug when we fetch information from the backported driver ...

A++

Last edited by colin.stephane; 2011-06-04 at 22:19. Reason: Clarification on step by step procedure to track the problem ...
 
Posts: 2,154 | Thanked: 8,464 times | Joined on May 2010
#532
As I wrote, I cannot change informations exported to HAL. HAL is userspace application which does not have anythink with my patches.

If you have problem with incorrect battery values, check first what kernel driver are reporting. It is in folder /sys/class/power_supply/bq27200-0 and in file uevent.
 

The Following User Says Thank You to pali For This Useful Post:
Posts: 458 | Thanked: 783 times | Joined on Jan 2010 @ France
#533
Originally Posted by pali View Post
As I wrote, I cannot change informations exported to HAL. HAL is userspace application which does not have anythink with my patches.

If you have problem with incorrect battery values, check first what kernel driver are reporting. It is in folder /sys/class/power_supply/bq27200-0 and in file uevent.
Well I don't understand why you ask me to check here :

Code:
-bash-2.05b# cat /sys/class/power_supply/bq27200-0/uevent 
PHYSDEVPATH=/class/i2c-adapter/i2c-2/2-0055
PHYSDEVBUS=i2c
PHYSDEVDRIVER=bq27x00-battery
POWER_SUPPLY_NAME=bq27200-0
POWER_SUPPLY_TYPE=Battery
POWER_SUPPLY_STATUS=Charging
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_VOLTAGE_NOW=4103000
POWER_SUPPLY_CURRENT_NOW=-449463
POWER_SUPPLY_CAPACITY=47
POWER_SUPPLY_TEMP=323
POWER_SUPPLY_TIME_TO_EMPTY_NOW=0
POWER_SUPPLY_TIME_TO_EMPTY_AVG=0
POWER_SUPPLY_TIME_TO_FULL_NOW=9720
POWER_SUPPLY_TECHNOLOGY=Li-ion
POWER_SUPPLY_CHARGE_FULL=1531708
POWER_SUPPLY_CHARGE_NOW=715785
POWER_SUPPLY_CHARGE_FULL_DESIGN=2056320
Then, so ?

Correct me if I'm wrong ...

If I understand properly your patch at http://atrey.karlin.mff.cuni.cz/~pali/battery.patch

Code:
--- battery.c.orig	2011-01-17 13:39:36.000000000 +0100
+++ battery.c	2011-01-18 18:42:10.000000000 +0100
@@ -5,6 +5,7 @@
 #include <dbus/dbus.h>
 
 #include <stdio.h>
+#include <stdlib.h>
  
 #include <libhildondesktop/libhildondesktop.h>
 
@@ -55,7 +56,12 @@ static gboolean battery_plugin_on_timeou
 	}
 	else
 	{
-		battery->percent = libhal_device_get_property_int(ctx, "/org/freedesktop/Hal/devices/bme", "battery.charge_level.percentage", NULL);
+		if ( libhal_device_property_exists(ctx, "/org/freedesktop/Hal/devices/computer_power_supply_battery_bq27200_0", "battery.charge_level.percentage", NULL) )
+			battery->percent = libhal_device_get_property_int(ctx, "/org/freedesktop/Hal/devices/computer_power_supply_battery_bq27200_0", "battery.charge_level.percentage", NULL);
+		else if ( system("pgrep -f ^/usr/sbin/bme_RX-51") == 0 )
+			battery->percent = libhal_device_get_property_int(ctx, "/org/freedesktop/Hal/devices/bme", "battery.charge_level.percentage", NULL);
+		else
+			battery->percent = 0;
 	}
 	
 	//GtkWidget *widget = GTK_WIDGET(data);
The patch say :

Code:
+		if ( libhal_device_property_exists(ctx, "/org/freedesktop/Hal/devices/computer_power_supply_battery_bq27200_0", "battery.charge_level.percentage", NULL) )
+			battery->percent = libhal_device_get_property_int(ctx, "/org/freedesktop/Hal/devices/computer_power_supply_battery_bq27200_0", "battery.charge_level.percentage", NULL);
Translate in human language :

If Kernel module driver 'bq27x00_battery' IS loaded, then we can access '/org/freedesktop/Hal/devices/computer_power_supply_battery_bq27200_0' values and we use the value from the field 'battery.charge_level.percentage'.

After that :

Code:
+		else if ( system("pgrep -f ^/usr/sbin/bme_RX-51") == 0 )
+			battery->percent = libhal_device_get_property_int(ctx, "/org/freedesktop/Hal/devices/bme", "battery.charge_level.percentage", NULL);
Translate in human language :

Else, Kernel module driver 'bq27x00_battery' IS NOT loaded, and we cannot access '/org/freedesktop/Hal/devices/computer_power_supply_battery_bq27200_0', so we check if bme IS loaded, and if so, then we can access '/org/freedesktop/Hal/devices/bme' values and we use the value from the field 'battery.charge_level.percentage'.

And finally :

Code:
+		else
+			battery->percent = 0;
Translate in human language :

Else, we cannot access any parameters, so just report battery percent as '0%'

Do you agree with my analyze of your patch ?

If so, how can you explain that :

Code:
-bash-2.05b# lshal -u /org/freedesktop/Hal/devices/computer_power_supply_battery_bq27200_0 | grep battery.charge_level.percentage && lshal -u /org/freedesktop/Hal/devices/bme | grep battery.charge_level.percentage
  battery.charge_level.percentage = 56  (0x38)  (int)
  battery.charge_level.percentage = 95  (0x5f)  (int)
And what is your opinion about the right and the false value ???

You can trust me, the right is the one reported by bme !!!

A++
 

The Following 2 Users Say Thank You to colin.stephane For This Useful Post:
joerg_rw's Avatar
Posts: 2,222 | Thanked: 12,651 times | Joined on Mar 2010 @ SOL 3
#534
bq27x00.ko kernel module is deprecated as it breaks bme by exclusively occupying the I2C bus to that chip. BME otoh wants to access the chip directly, and so segfaults whenever bq27x00.ko is loaded.

Please keep this in mind

thanks
/jOERG
__________________
Maemo Community Council member [2012-10, 2013-05, 2013-11, 2014-06 terms]
Hildon Foundation Council inaugural member.
MCe.V. foundation member

EX Hildon Foundation approved
Maemo Administration Coordinator (stepped down due to bullying 2014-04-05)
aka "techstaff" - the guys who keep your infra running - Devotion to Duty http://xkcd.com/705/

IRC(freenode): DocScrutinizer*
First USB hostmode fanatic, father of H-E-N
 

The Following 7 Users Say Thank You to joerg_rw For This Useful Post:
Posts: 458 | Thanked: 783 times | Joined on Jan 2010 @ France
#535
Originally Posted by joerg_rw View Post
bq27x00.ko kernel module is deprecated as it breaks bme by exclusively occupying the I2C bus to that chip. BME otoh wants to access the chip directly, and so segfaults whenever bq27x00.ko is loaded.

Please keep this in mind

thanks
/jOERG
Thanks, problem finally solved with this command line :

Code:
clear && ID=$(id -un) ; if [ ${ID} != "root" ] ; then echo "You are not 'root', please use this command line as 'root' ..." ; else echo "Ok, you are 'root' ..." ; if grep -q "blacklist bq27x00_battery" /etc/modprobe.d/blacklist 2>/dev/null ; then echo "Patch already applyed, nothing to be done ..." ; echo "" ; else echo "Applying patch now ..." ; echo "blacklist bq27x00_battery" >>/etc/modprobe.d/blacklist ; echo "" ; echo "DONE, PLEASE REBOOT YOUR DEVICE ..." ; echo "" ; fi ; fi
And rebooted ...

A++

Last edited by colin.stephane; 2011-06-09 at 18:20. Reason: Corrected the script with correct command "blacklist bq27x00_battery", sorry ...
 

The Following 4 Users Say Thank You to colin.stephane For This Useful Post:
kyros's Avatar
Posts: 44 | Thanked: 7 times | Joined on Feb 2010 @ Vienna / Austria
#536
I have "Linux kernel for power users v.1:2.6.28-10power47" installed (additionally CSSU and multiboot-kernel-power v.0.3.1).
Since some days the system denies updating to "linux kernel for power users (boot image) 2.6.28.10" with showing the following screens:

Name:  screenshot04.jpg
Views: 1510
Size:  21.6 KB
Linux kernel for power users (boot image) 2.6.28.10 in order to be updated in the program manager

Name:  screenshot07.jpg
Views: 1444
Size:  19.7 KB
Error message that this is breaks the 3rd party package policiy

Name:  screenshot12.jpg
Views: 1329
Size:  21.9 KB
Program details summary

Name:  screenshot13.jpg
Views: 1357
Size:  19.5 KB
Program details description

Name:  screenshot15.jpg
Views: 1360
Size:  19.5 KB
Program details problem info

Does someone has an idea to solve the problem?
Regards, Kyros
 
Posts: 650 | Thanked: 497 times | Joined on Oct 2008 @ Ghent, Belgium
#537
Regarding my GPS/network location issue, possibly related to v47, I have split it to another thread:
http://talk.maemo.org/showthread.php...53#post1004853

Any hint/confirmation/... welcome!

EDIT: as one report of v46 + CSSU claims there is no problem, this probably rules out CSSU, meaning v47 has our attention :/
__________________
Affordable mobile internet in Belgium: Try Mobile Vikings
2 GB, 1000 SMS and 15 euro of talk time for.... 15 euro

Last edited by petur; 2011-05-12 at 18:28.
 
Posts: 289 | Thanked: 49 times | Joined on Jun 2010
#538
How can we use uboot with kernel power 47v
 

The Following 2 Users Say Thank You to shardul For This Useful Post:
Posts: 2,225 | Thanked: 3,822 times | Joined on Jun 2010 @ Florida
#539
Originally Posted by shardul View Post
How can we use uboot with kernel power 47v
Take extracted zImage of the power47 kernel.
Convert zImage to uImage using mkimage.
Take the available for download uboot image that works on your hardware revision.
Use dd to write the kernel image to the end of the uboot image.
Flash this combined image.

Each of these directions can be found with actual detailed directions on this very forum.
 

The Following 2 Users Say Thank You to Mentalist Traceur For This Useful Post:
elie-7's Avatar
Posts: 968 | Thanked: 663 times | Joined on Jun 2010 @ Australia (Melbourne/vic) / Lebanon (Zgharta/north)
#540
i have to say that i'm now back to power v47, the battery seems to drain slower than v42 ! and as always v47's performance is just awesome, loving it so far .....
__________________
rolling down the street, smoking ENDO, sipping on gin and juice
laid back, with my mind on my money and my money on my mind .
 
Reply

Tags
battery-status, bq27x00_battery, kernel, kernel-power, misiak4king, noobs-cant-read, pali4president, patches, readdirections, revolverspinyou


 
Forum Jump


All times are GMT. The time now is 22:46.