[QtMoko] Battery

joerg Reisenweber joerg at openmoko.org
Mon Aug 5 16:13:20 CEST 2013


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)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.openmoko.org/pipermail/community/attachments/20130805/d10e4273/attachment.sig>


More information about the community mailing list