Re: [QtMoko] Battery

2013-08-05 Thread joerg Reisenweber
On Mon 05 August 2013 15:51:49 Giacomo 'giotti' Mariani wrote:
> Hi Radeck, all,
>I was reading
> http://wiki.openmoko.org/wiki/Battery_Questions_and_Answers in order to
> estimate the remaining power of my battery (the fraction of the maximum
> energy with respect to a new one) and found about bq27k-detail[1] which
> doesn't seem to work on any recent distribution (kernel >= 2.6.34) I
> have on my GTA02.
> 
> Do you have any idea why the file
> /sys/devices/platform/s3c24xx_pwm.0/hdq.0/hdq/dump disappeared? Is there
> another way to achieve the same result of bq27k-detail?
> 
> Thanks a lot,
>   Giacomo
> 
> [1]
> http://wiki.openmoko.org/wiki/Battery_Questions_and_Answers#That_bq27000_ch
> ip_seems_to_be_pretty_cool.2C_how_can_i_read_and_understand_its_raw_registe
> rs.3F

check http://maemo.cloud-7.de/maemo5/usr/local/sbin/ , particularly see how 
bq27k-detail2 does
# v1.2 tries to deal with sysfs path changes on OM kernels, and supports N900 
directly

by using find and, for N900 ic2tools:

#main
dmppath=`find /sys/devices/ -path '*/hdq/*' -name dump`
if [ x$dmppath != x ]; then
  dmpcmd="cat ${1:-${dmppath}}| tr -s '\n ' '  '"
else
  dmpcmd="i2cdump -y 2 0x55 b|tail -n +2|cut -d ' ' -f 2-17"
fi

Alas for GTA02 smart battery there's no way to read out bq27000 via I2C (since 
that's onewire/HDQ), but maybe the improved spotting of dump sysnode location 
already helps.
If above code runs into the "else" branch - i.e. didn't find the dump sysnode - 
then you might try to modprobe the kernel module that handles the HDQ, as 
explained in our battery-FAQ by Paul.

HTH
cheers
jOERG
-- 
()  ascii ribbon campaign - against html e-mail 
/\  www.asciiribbon.org   - against proprietary attachments
(alas the above page got scrapped due to resignation(!!), so here some 
supplementary links:)
http://www.georgedillon.com/web/html_email_is_evil.shtml  
http://www.nonhtmlmail.org/campaign.html
http://www.georgedillon.com/web/html_email_is_evil_still.shtml
http://www.gerstbach.at/2004/ascii/ (German)


signature.asc
Description: This is a digitally signed message part.
___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: [QtMoko] Battery

2013-08-05 Thread NeilBrown
On Mon, 05 Aug 2013 15:51:49 +0200 Giacomo 'giotti' Mariani
 wrote:

> Hi Radeck, all,
>I was reading
> http://wiki.openmoko.org/wiki/Battery_Questions_and_Answers in order to
> estimate the remaining power of my battery (the fraction of the maximum
> energy with respect to a new one) and found about bq27k-detail[1] which
> doesn't seem to work on any recent distribution (kernel >= 2.6.34) I
> have on my GTA02.
> 
> Do you have any idea why the file
> /sys/devices/platform/s3c24xx_pwm.0/hdq.0/hdq/dump disappeared? Is there
> another way to achieve the same result of bq27k-detail?
> 
> Thanks a lot,
>   Giacomo
> 
> [1]
> http://wiki.openmoko.org/wiki/Battery_Questions_and_Answers#That_bq27000_chip_seems_to_be_pretty_cool.2C_how_can_i_read_and_understand_its_raw_registers.3F
> 

On the GTA04 I just read
   /sys/class/power_supply/bq27000-battery/charge_full
and
   /sys/class/power_supply/bq27000-battery/charge_full_design

and divide one by the other.
Does the GTA02 not have something similar?

NeilBrown


signature.asc
Description: PGP signature
___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: [QtMoko] Battery

2013-08-05 Thread joerg Reisenweber
On Mon 05 August 2013 22:57:47 NeilBrown wrote:
> On Mon, 05 Aug 2013 15:51:49 +0200 Giacomo 'giotti' Mariani
> 
>  wrote:
> > Hi Radeck, all,
> > 
> >I was reading
> > 
> > http://wiki.openmoko.org/wiki/Battery_Questions_and_Answers in order to
> > estimate the remaining power of my battery (the fraction of the maximum
> > energy with respect to a new one) and found about bq27k-detail[1] which
> > doesn't seem to work on any recent distribution (kernel >= 2.6.34) I
> > have on my GTA02.
> > 
> > Do you have any idea why the file
> > /sys/devices/platform/s3c24xx_pwm.0/hdq.0/hdq/dump disappeared? Is there
> > another way to achieve the same result of bq27k-detail?
> > 
> > Thanks a lot,
> > 
> >   Giacomo
> > 
> > [1]
> > http://wiki.openmoko.org/wiki/Battery_Questions_and_Answers#That_bq27000_
> > chip_seems_to_be_pretty_cool.2C_how_can_i_read_and_understand_its_raw_reg
> > isters.3F
> 
> On the GTA04 I just read
>/sys/class/power_supply/bq27000-battery/charge_full
> and
>/sys/class/power_supply/bq27000-battery/charge_full_design
> 
> and divide one by the other.
> Does the GTA02 not have something similar?
> 
> NeilBrown

I'm not sure charge_full_design is correctly flashed to the bq27000 in gat02-
smartbattery. Anyway problems of OP are most likely from changes in kernel 
sysfs pathnames.

/j
-- 
()  ascii ribbon campaign - against html e-mail 
/\  www.asciiribbon.org   - against proprietary attachments
(alas the above page got scrapped due to resignation(!!), so here some 
supplementary links:)
http://www.georgedillon.com/web/html_email_is_evil.shtml  
http://www.nonhtmlmail.org/campaign.html
http://www.georgedillon.com/web/html_email_is_evil_still.shtml
http://www.gerstbach.at/2004/ascii/ (German)


signature.asc
Description: This is a digitally signed message part.
___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: [QtMoko] Battery

2013-08-22 Thread Ben Wong
On Mon, Aug 5, 2013 at 1:57 PM, NeilBrown  wrote:

> On the GTA04 I just read
>/sys/class/power_supply/bq27000-battery/charge_full
> and
>/sys/class/power_supply/bq27000-battery/charge_full_design
>
> and divide one by the other.
> Does the GTA02 not have something similar?

Did anyone ever figure this one out? On my GTA02 (Linux 2.6.34), I see
/sys/class/power_supply/battery/charge_full, but no
charge_full_design.

--B

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: [QtMoko] Battery

2013-08-22 Thread joerg Reisenweber
On Thu 22 August 2013 19:46:05 Ben Wong wrote:
> On Mon, Aug 5, 2013 at 1:57 PM, NeilBrown  wrote:
> > On the GTA04 I just read
> > 
> >/sys/class/power_supply/bq27000-battery/charge_full
> > 
> > and
> > 
> >/sys/class/power_supply/bq27000-battery/charge_full_design
> > 
> > and divide one by the other.
> > Does the GTA02 not have something similar?
> 
> Did anyone ever figure this one out? On my GTA02 (Linux 2.6.34), I see
> /sys/class/power_supply/battery/charge_full, but no
> charge_full_design.
> 
> --B


charge_full_design is usually bogus anyway. bq27000 on gta02 battery has a 
bogus value for that. On other phones/batteries the 3rd pin is used as BSI 
(battery size indicator) with a resistor or thermistor to ground. The 
resistance values also are not defined by any standard and no battery second 
source manuf adheres to them. So your best bet is to assume whatever you feel 
is reasonable for battery_full_design,  since by no means you can read out 
reliable reasonable values from hardware

/j
-- 
()  ascii ribbon campaign - against html e-mail 
/\  www.asciiribbon.org   - against proprietary attachments
(alas the above page got scrapped due to resignation(!!), so here some 
supplementary links:)
http://www.georgedillon.com/web/html_email_is_evil.shtml  
http://www.nonhtmlmail.org/campaign.html
http://www.georgedillon.com/web/html_email_is_evil_still.shtml
http://www.gerstbach.at/2004/ascii/ (German)


signature.asc
Description: This is a digitally signed message part.
___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: [qtmoko] battery level indicator

2009-09-25 Thread Jim Morris
Jim Morris wrote:
> It looks like the battery indicator does not work, at least after a suspend, 
> maybe these errors have 
> something to do with it, they appear after coming out of the first suspend, 
> after that the battery 
> always looks full, unless its charging which does indicate.
> 
> [  814.75] Restarting tasks ... done.
> [  814.87] bq27000-battery bq27000-battery.0: battery service reschedule 
> failed
> [  817.695000] pcf50633 0-0073: usb curlim to 500 mA
> [ 3254.28] HDQ error: 1
> [ 3254.295000] HDQ responds again
> [ 3254.435000] power_supply battery: driver failed to report `temp' property
> [ 4977.83] HDQ error: 1
> [ 4977.845000] HDQ responds again
> [ 5129.84] HDQ error: 1
> [ 5129.855000] HDQ responds again
> [ 5129.995000] power_supply battery: driver failed to report `temp' property
> [ 5712.895000] HDQ error: 1
> [ 5712.915000] power_supply battery: driver failed to report `voltage_now' 
> property
> [ 5737.91] HDQ responds again
> [ 6929.315000] HDQ error: 1
> [ 6929.33] HDQ responds again
> [ 7005.32] HDQ error: 1
> [ 7005.335000] HDQ responds again
> [ 7005.585000] power_supply battery: driver failed to report `charge_full' 
> property
> [ 7664.26] HDQ error: 1
> [ 7664.275000] HDQ responds again
> [ 7664.52] power_supply battery: driver failed to report `charge_full' 
> property
> 

Ok I have done some research, and the above messages do come from the kernel, 
but may be transient 
errors, and not affecting this bug.

The battery indicator showing full when it should show 75% does not always 
happen, but after a few 
suspend/resume cycles I can make it happen.

When it does happen I can cat /sys/class/power_supply/battery/capacity
and get the correct answer of 75.

but both the value space 
/Hardware/Accessories/QPowerSource/DefaultBattery/Charge (which is what the 
battery indicator uses) and the QPowerSource::capacity() calls return 100, 
which is obviously wrong.

This points to a bug in QtMoko (actually Qt Extended). It is odd because 
tracing the calls they 
ultimately just read /sys/class/power_supply/battery/capacity, so I suspect the 
QPowerSource service 
is dying or something like that. I'll continue to track this down, as it is 
quite a serious bug.

I also got a dialog pop up saying the battery was critically low, when in fact 
it was at 75%.


-- 
Jim Morris, http://blog.wolfman.com

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community