maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   Pybattery - battery statusbar applet with candies (https://talk.maemo.org/showthread.php?t=24905)

dazalfolks 2011-07-30 01:45

Re: Pybattery - battery statusbar applet with candies
 
i just updated to the latest version also and now the status bar applet isn't working. it says "APMD Starting" and stays like that after i tried to start it.

412b 2011-07-30 09:12

Re: Pybattery - battery statusbar applet with candies
 
Well, I think problem is some obsolete files not cleaned up by dpkg and apm.
But can anybody also attach output of running
Code:

python -OO /opt/maemo/usr/lib/advanced-power-monitor/apmdaemon.py
and
Code:

ls -Rls /opt/maemo/usr/lib/advanced-power-monitor/
The simpliest solution at the moment is to run as root
Code:

rm -r /opt/maemo/usr/lib/advanced-power-monitor/wrappers/device_mode

RuiDC 2011-07-30 22:15

Re: Pybattery - battery statusbar applet with candies
 
2 Attachment(s)
Same problem frpm the latest update. Output attached.
(And your workaround also worked for me, so thanks for posting)

412b 2011-07-31 23:28

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by RuiDC (Post 1061299)
Same problem frpm the latest update. Output attached.
(And your workaround also worked for me, so thanks for posting)

I'll find a good solution someday later.
Tonite I had another release: a daughter )))

br1zer 2011-08-01 00:22

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by 412b (Post 1061938)
I'll find a good solution someday later.
Tonite I had another release: a daughter )))

Hey, Congrats!!!

Estel 2011-08-01 00:44

Re: Pybattery - battery statusbar applet with candies
 
Congratulations! Take Your time :)

CasTTeLLo 2011-08-03 07:44

Re: Pybattery - battery statusbar applet with candies
 
Which module should i choose to have longer battery?? Now iam using nokias bme...can u xplain wat the differences betw them??

sr00t 2011-08-03 12:27

Re: Pybattery - battery statusbar applet with candies
 
BQ27200 is really buggy in my cellphone: it says my battery is between 50%-29% before (without even displaying it) shuts down completely.
Not accurate at all. I've been using it since the problem with battery temperature display without problems.
After last update, is so inaccurate!
I tried BQ27200 alternative but is more unstable than the original module (it changes battery charge percentages very fast, based on the power usage @ the moment) but even this modified module would warn me that I'm draining out of battery.

I'll try Nokia BME next. Please verify what I say because if this is general, we're in front of an ugly, ugly bug. Thanks a lot.

vi_ 2011-08-03 12:37

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by 412b (Post 1061938)
I'll find a good solution someday later.
Tonite I had another release: a daughter )))

Be careful with the daughter, while the initial release is stripped down and compact it tends to grow over the course of the project.

412b 2011-08-04 06:46

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by CasTTeLLo (Post 1063173)
Which module should i choose to have longer battery?? Now iam using nokias bme...can u xplain wat the differences betw them??

Dummy mdoule will make your battery last longer, unfortunateely it doesn't show any real info ))) According to computations and its frequency inside APM I would place modules in folowing order:
1. Nokia's BME (incl. Alternative)
2. BQ27200 (incl. Alternative)

If you don't know what is BME and what is bq27x00, use BME.

412b 2011-08-04 06:49

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by sr00t (Post 1063393)
BQ27200 is really buggy in my cellphone: it says my battery is between 50%-29% before (without even displaying it) shuts down completely.
Not accurate at all. I've been using it since the problem with battery temperature display without problems.
After last update, is so inaccurate!
I tried BQ27200 alternative but is more unstable than the original module (it changes battery charge percentages very fast, based on the power usage @ the moment) but even this modified module would warn me that I'm draining out of battery.

I'll try Nokia BME next. Please verify what I say because if this is general, we're in front of an ugly, ugly bug. Thanks a lot.

BQ27200 works fine for me. If it shows weird values to you, you better dig into values bq27x00 kernel module providing.

sr00t 2011-08-04 12:34

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by 412b (Post 1063862)
BQ27200 works fine for me. If it shows weird values to you, you better dig into values bq27x00 kernel module providing.

Using kernel-powerv47 here. What should I grep?
I'm sorry if I bother you.

412b 2011-08-05 07:43

Re: Pybattery - battery statusbar applet with candies
 
Just run in XTerm to get values provided by bq27x00 to HAL:
Code:

hal-device computer_power_supply_battery_bq27200_0

teewan 2011-08-08 18:21

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by 412b (Post 1061020)
Well, I think problem is some obsolete files not cleaned up by dpkg and apm.
But can anybody also attach output of running
Code:

python -OO /opt/maemo/usr/lib/advanced-power-monitor/apmdaemon.py
and
Code:

ls -Rls /opt/maemo/usr/lib/advanced-power-monitor/
The simpliest solution at the moment is to run as root
Code:

rm -r /opt/maemo/usr/lib/advanced-power-monitor/wrappers/device_mode

Thanks a million!
Solved my problem too after executing.

CasTTeLLo 2011-08-13 15:30

Re: Pybattery - battery statusbar applet with candies
 
Wat does this mean

Nokia-N900:~# rm -r /opt/maemo/usr/lib/advanced-power-monitor/wrappers/device_mode
rm: cannot remove '/opt/maemo/usr/lib/advanced-power-monitor/wrappers/device_mode': No such file or directory

Nokia-N900:~# python -OO /opt/maemo/usr/lib/advanced-power-monitor/apmdaemon.py
Traceback (most recent call last):
File "/opt/maemo/usr/lib/advanced-power-monitor/apmdaemon.py", line 8, in <module>
import AdvancedPowerMonitor
File "/opt/maemo/usr/lib/advanced-power-monitor/AdvancedPowerMonitor.py", line 14, in <module>
from advpowcommon.util.loader import ClassLoader
ImportError: No module named advpowcommon.util.loader
Nokia-N900:~# ls -Rls /opt/maemo/usr/lib/advanced-power-monitor/

412b 2011-08-13 19:03

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by CasTTeLLo (Post 1069255)
Wat does this mean

Nokia-N900:~# rm -r /opt/maemo/usr/lib/advanced-power-monitor/wrappers/device_mode
rm: cannot remove '/opt/maemo/usr/lib/advanced-power-monitor/wrappers/device_mode': No such file or directory

Nokia-N900:~# python -OO /opt/maemo/usr/lib/advanced-power-monitor/apmdaemon.py
Traceback (most recent call last):
File "/opt/maemo/usr/lib/advanced-power-monitor/apmdaemon.py", line 8, in <module>
import AdvancedPowerMonitor
File "/opt/maemo/usr/lib/advanced-power-monitor/AdvancedPowerMonitor.py", line 14, in <module>
from advpowcommon.util.loader import ClassLoader
ImportError: No module named advpowcommon.util.loader
Nokia-N900:~# ls -Rls /opt/maemo/usr/lib/advanced-power-monitor/

try reinstalling advanced-power-common
and ls couldn't give you no output.

canuckkat 2011-08-18 04:15

Re: Pybattery - battery statusbar applet with candies
 
Just wanted to say that 412b's solution worked for me as well. Was getting "devicemodepowerlaunch has not attribute 'get_type'" or some such nonsense before :)

Estel 2011-08-18 18:29

Re: Pybattery - battery statusbar applet with candies
 
I think I *may* have found a bug.

When, for some reasons, applet (or daemon?) can't get some modes data (i.e. bq27200 or nokia bme when bme is disabled), but daemon himself is working right, any attempt to switch mode ends up in control panel (of advanced power monitor) becoming unresponsive.

In fact, it does *not* "hand" - just clicking "save" does nothing. Button highlights, but pop-up with controls doesn't hide. If we cancel it, open it again and try another time, it *does* close as normal upon "save":, but no changes are made. If You check again, GUI returns info about other mode running (from example, if we try to switch from nokia bme to bq27200, 1st attempt fail, 2nd seems to succeed, GUI now tell us that bq27200 is active), but info is still from "old" mode.

Then, 3th attempt to switch fail again - need to cancel it. 4th attempt "succeed" without real change, and so goes on. Just like control panel has got compulsive-obsessive disorder ;)

I know, it's little hard to explain, but I hope my report was understandable. If there is any way that I can help debugging - i.e. some output from somewhere ;) I'll be glad to help.

412b 2011-08-19 12:01

Re: Pybattery - battery statusbar applet with candies
 
Do you start/stop bme and load bq27200 on the fly (w/o rebooting)?

Estel 2011-08-19 15:35

Re: Pybattery - battery statusbar applet with candies
 
2x nope. It just happens sometime, can't reproduce, but it wasn't "one time mystery error" either. *if* it happens - and I've seen it 2-3 times in last 2 days - it last until reboot.

If it's relevant - I use KP47, with bq27200 enabled as by default.

412b 2011-08-19 17:35

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by Estel (Post 1073115)
2x nope. It just happens sometime, can't reproduce, but it wasn't "one time mystery error" either. *if* it happens - and I've seen it 2-3 times in last 2 days - it last until reboot.

If it's relevant - I use KP47, with bq27200 enabled as by default.

I've tested on KP47 and had no issue.
Nevertheless when it happens again as root edit /opt/maemo/usr/lib/hildon-desktop/advpowlib/core/maemo5.py
Remove # sign in line # self.__create_settings_box() (about line 112).
Then run that often posted line (python /usr/lib/hildon-desktop/advanced_power.py 1) and attach log. Also as root run 'stop apmonitord && start apmonitord' and attach /home/user/apmonitord.log

Estel 2011-08-29 06:41

Re: Pybattery - battery statusbar applet with candies
 
As for kp48, bq27x00 module is depreciated, and can't be used together with bme.

ho ever, all bq27200 (fuel gaude) data can be accessed by other means - via i2cget tools.

I've attached file with method of getting data via i2cget. I've took this from shadowjk's bq27200 script. It need i2cget placed in "./", but maybe You can use i2ctools as dependency and use other path for accessing it.

Of course, it requires root privileges, to access data via i2cget.

Currently, it's only thing lacking in Your wonderful application to be fully compatible with kp48, so, if by any chance, You can replace bq27x00 with this, it would be great.

Of course, method via i2cget works also in kp47 or earlier version, so it's more compatible method.

412b 2011-08-29 07:50

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by Estel (Post 1078279)
As for kp48, bq27x00 module is depreciated, and can't be used together with bme.

ho ever, all bq27200 (fuel gaude) data can be accessed by other means - via i2cget tools.

I've attached file with method of getting data via i2cget. I've took this from shadowjk's bq27200 script. It need i2cget placed in "./", but maybe You can use i2ctools as dependency and use other path for accessing it.

Of course, it requires root privileges, to access data via i2cget.

Currently, it's only thing lacking in Your wonderful application to be fully compatible with kp48, so, if by any chance, You can replace bq27x00 with this, it would be great.

Of course, method via i2cget works also in kp47 or earlier version, so it's more compatible method.

Attachment missing unfortunatelly )
Polling data from i2c can bring additional overhead to APM and partly is an exception of async nature of wrappers in APM, nevertheless, I'll try to make a beta wrapper module for it ASAP, 'cause at the moment I'm more looking into adding Bleeding Edge to AIS than upgrading AP/APM.

zimon 2011-08-29 08:35

Re: Pybattery - battery statusbar applet with candies
 
(After vacation and happily forgotten all N900-tweaking stuff I couldn't recognize this "Pybattery" thread was related to problems why my "apmd" doesn't work anymore after upgrading from KP47 to KP48. The apmd thread was so quiet. Maybe the title of this thread could be changed abit to mention apmd or apmonitord?)

Code:

# uname -a
Linux Nokia-N900 2.6.28.10-power48 #1 PREEMPT Mon Aug 22 15:09:51 EEST 2011 armv7l unknown

# lsmod|grep bq
bq27x00_battery        5264  0
power_supply            7044  1 bq27x00_battery


# python -OO /opt/maemo/usr/lib/advanced-power-monitor/apmdaemon.py
Advanced Power Monitor 0.6.0
RX-51_2009SE_20.2010.36-2_PR_MR0

Loaded modules (2/2): OSVersion_Maemo DeviceName

Loading wrappers...

LOADING battery
Loading packages list...
[L] Nokia's BME Alternative
[L] Nokia's BME
[L] BQ27200
[L] Dummy
[L] BQ27200 Alternative
Traceback (most recent call last):
  File "/opt/maemo/usr/lib/advanced-power-monitor/apmdaemon.py", line 30, in <module>
    daemon.run()
  File "/opt/maemo/usr/lib/advanced-power-monitor/apmdaemon.py", line 16, in run
    self.apm = AdvancedPowerMonitor.apm()
  File "/opt/maemo/usr/lib/advanced-power-monitor/AdvancedPowerMonitor.py", line 89, in __init__
    self.__init_wrappers()
  File "/opt/maemo/usr/lib/advanced-power-monitor/AdvancedPowerMonitor.py", line 165, in __init_wrappers
    self.change_wrapper(key, self.get_available_wrappers(key)[0])
  File "/opt/maemo/usr/lib/advanced-power-monitor/AdvancedPowerMonitor.py", line 218, in change_wrapper
    self.__wrappers[key]['object'].finish_init()
  File "/opt/maemo/usr/lib/advanced-power-monitor/wrappers/AbstractWrappers.py", line 35, in finish_init
    self.__end_init()
  File "/opt/maemo/usr/lib/advanced-power-monitor/wrappers/AbstractWrappers.py", line 43, in __end_init
    self.get_status()
  File "/opt/maemo/usr/lib/advanced-power-monitor/wrappers/battery/BatteryBQ27200.py", line 68, in get_status
    self.handle_battery_status(0, [], True)
  File "/opt/maemo/usr/lib/advanced-power-monitor/wrappers/battery/BatteryBQ27200.py", line 37, in handle_battery_status
    values['voltage'] = int(self.interfaces['BQ27200'].GetPropertyInteger(u'battery.voltage.current'))
  File "/usr/lib/pymodules/python2.5/dbus/proxies.py", line 140, in __call__
    **keywords)
  File "/usr/lib/pymodules/python2.5/dbus/connection.py", line 622, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.Hal.NoSuchDevice: No device with id /org/freedesktop/Hal/devices/computer_power_supply_battery_bq27200_0

# ls -Rls /opt/maemo/usr/lib/advanced-power-monitor/
/opt/maemo/usr/lib/advanced-power-monitor/:
  16 -rw-r--r--    1 root    root        14226 Jul 29 11:26 AdvancedPowerMonitor.py
  20 -rw-r--r--    1 root    root        16484 Aug 26 21:41 AdvancedPowerMonitor.pyc
  4 -rw-r--r--    1 root    root          97 Apr  6 03:00 __init__.py
  4 -rw-r--r--    1 root    root          648 Jul 25 16:17 apmdaemon.py
  4 drwxr-xr-x    4 root    root        4096 Aug 26 21:41 modules
  4 drwxr-xr-x    3 root    root        4096 Aug 29 11:15 wrappers

/opt/maemo/usr/lib/advanced-power-monitor/modules:
  4 -rw-r--r--    1 root    root        3727 Apr  6 03:00 AbstractModules.py
  8 -rw-r--r--    1 root    root        8150 Aug 26 21:41 AbstractModules.pyc
  4 -rw-r--r--    1 root    root          47 Apr  6 03:00 __init__.py
  4 -rw-r--r--    1 root    root          150 Aug 26 21:41 __init__.pyc
  4 drwxr-xr-x    2 root    root        4096 Aug 26 21:41 device_name
  4 drwxr-xr-x    2 root    root        4096 Aug 26 21:41 os_version

/opt/maemo/usr/lib/advanced-power-monitor/modules/device_name:
  4 -rw-r--r--    1 root    root          334 Apr  6 03:00 DeviceName.py
  4 -rw-r--r--    1 root    root          964 Aug 26 21:41 DeviceName.pyc
  4 -rw-r--r--    1 root    root          58 Apr  6 03:00 __init__.py
  4 -rw-r--r--    1 root    root          162 Aug 26 21:41 __init__.pyc

/opt/maemo/usr/lib/advanced-power-monitor/modules/os_version:
  4 -rw-r--r--    1 root    root          360 Apr  6 03:00 OSVersion_Maemo.py
  4 -rw-r--r--    1 root    root          991 Aug 26 21:41 OSVersion_Maemo.pyc
  4 -rw-r--r--    1 root    root          57 Apr  6 03:00 __init__.py
  4 -rw-r--r--    1 root    root          161 Aug 26 21:41 __init__.pyc

/opt/maemo/usr/lib/advanced-power-monitor/wrappers:
  8 -rw-r--r--    1 root    root        5028 Jul 29 11:35 AbstractWrappers.py
  12 -rw-r--r--    1 root    root        9426 Aug 26 21:41 AbstractWrappers.pyc
  4 -rw-r--r--    1 root    root          48 Apr  6 03:00 __init__.py
  4 -rw-r--r--    1 root    root          151 Aug 26 21:41 __init__.pyc
  4 drwxr-xr-x    2 root    root        4096 Aug 26 21:41 battery

/opt/maemo/usr/lib/advanced-power-monitor/wrappers/battery:
  4 -rw-r--r--    1 root    root          515 Jul 23 02:05 AbstractBattery.py
  4 -rw-r--r--    1 root    root        1289 Aug 26 21:41 AbstractBattery.pyc
  4 -rw-r--r--    1 root    root        3217 Jul 26 00:50 BatteryBME.py
  8 -rw-r--r--    1 root    root        4938 Aug 26 21:41 BatteryBME.pyc
  4 -rw-r--r--    1 root    root        3676 Jul 28 13:28 BatteryBMEA.py
  8 -rw-r--r--    1 root    root        5292 Aug 26 21:41 BatteryBMEA.pyc
  4 -rw-r--r--    1 root    root        3019 Jul 29 11:19 BatteryBQ27200.py
  8 -rw-r--r--    1 root    root        4402 Aug 26 21:41 BatteryBQ27200.pyc
  4 -rw-r--r--    1 root    root        3406 Jul 29 11:36 BatteryBQ27200A.py
  8 -rw-r--r--    1 root    root        4750 Aug 26 21:41 BatteryBQ27200A.pyc
  4 -rw-r--r--    1 root    root          489 Jul 29 13:00 BatteryDummy.py
  4 -rw-r--r--    1 root    root        1507 Aug 26 21:41 BatteryDummy.pyc
  4 -rw-r--r--    1 root    root          56 Apr  6 03:00 __init__.py
  4 -rw-r--r--    1 root    root          159 Aug 26 21:41 __init__.pyc

--reinstalling apmonitord didn't fix the problem, neither does stop+start apmnitord.

The battery icon in the status bar is grey and in the status menu "Start APMD. APMD disconnected".

start apmonitord gives:
# start apmonitord
apmonitord (start) waiting
apmonitord (stop) starting
apmonitord (stop) starting
apmonitord (stop) waiting
start: apmonitord respawning too fast, stopped

412b 2011-08-29 08:53

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by zimon (Post 1078308)
(After vacation and happily forgotten all N900-tweaking stuff I couldn't recognize this "Pybattery" thread was related to problems why my "apmd" doesn't work anymore after upgrading from KP47 to KP48.

What version of APM do you have? If less than 0.6.0-2, try upgradeing. But I think you've got the bug posted by Estel. I;ll take a closer look in the evening. It seems not to be hard to fix.
Can uoy also attach output of
Code:

lshal | grep bq
Quote:

Originally Posted by zimon (Post 1078308)
Maybe the title of this thread could be changed abit to mention apmd or apmonitord?)

If only I could (((

Estel 2011-08-29 15:27

Re: Pybattery - battery statusbar applet with candies
 
1 Attachment(s)
Sorry, of course lack of attachment is my mistake. Here it is:

As for changing topic name - can't you do that by editing Your first post? you should see thread title there...

412b 2011-08-29 20:06

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by Estel (Post 1078485)
As for changing topic name - can't you do that by editing Your first post? you should see thread title there...

Nope, it doesn't work )))

zimon 2011-08-29 21:47

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by 412b (Post 1078310)
What version of APM do you have? If less than 0.6.0-2, try upgradeing. But I think you've got the bug posted by Estel. I;ll take a closer look in the evening. It seems not to be hard to fix.
Can uoy also attach output of
Code:

lshal | grep bq

Code:

Nokia-N900:~/battery# lshal | grep bq
Nokia-N900:~/battery# dpkg -l advanced-power-monitor
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name          Version        Description
+++-==============-==============-============================================
ii  advanced-power 0.6.0-2        Daemon providing information via D-Bus about

lshal does not output anything with "bq"

412b 2011-08-30 06:25

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by zimon (Post 1078674)
Code:

Nokia-N900:~/battery# lshal | grep bq
Nokia-N900:~/battery# dpkg -l advanced-power-monitor
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name          Version        Description
+++-==============-==============-============================================
ii  advanced-power 0.6.0-2        Daemon providing information via D-Bus about

lshal does not output anything with "bq"

Quote:

Originally Posted by pali (Post 1078695)
I know, that it is not possible to use bq module in v48. Patch which disabled autoloading (in board code) also disable registring board info. So solution is disable autoloading by blacklist. Now it is fixed on git (will be released in v49). So v48 cant use bq module (who want must downgrade to v47 or upgrade from git)!

(full post)
So at the moment I can only fix bug with BQ module being marked as available.

Temporal 2011-09-08 01:05

Re: Pybattery - battery statusbar applet with candies
 
Hi, sorry for bothering, but I believe I have a feature request:

Whilst I love to be able to see the percentage, I find the hours it shows kinda... not really helpful. They almost never match or make much sense. SO, would you mind to take a look at what is implemented on Battery-Eye (not Battery-Graph) on its statistics tab, where it shows almost "exactly" what will happen to your phone based in previous data? (1/3 lowest consumption, 1/3 normal consumption, 1/3 highest consumption)÷(present consumption) and then use this data to make predictions?

I believe something like that would make PyBattery 100 times more useful than it already is.

Thank you!

zimon 2011-09-13 21:44

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by Temporal (Post 1083928)
SO, would you mind to take a look at what is implemented on Battery-Eye (not Battery-Graph) on its statistics tab, where it shows almost "exactly" what will happen to your phone based in previous data? (1/3 lowest consumption, 1/3 normal consumption, 1/3 highest consumption)÷(present consumption) and then use this data to make predictions?

I believe something like that would make PyBattery 100 times more useful than it already is.

I second this!
Battery-Eye like statistics would be nice to have when status menu bar is clicked.
And without clicking, I would like to see the direct voltage (mV) (and maybe not percentage), because the percentage usually doesn't tell the right value with double-battery-pack-hack but the current voltage would.

Estel 2011-09-14 01:27

Re: Pybattery - battery statusbar applet with candies
 
With dual batteries, percentage used to show most accurate value of all (after proper calibration of fuel gauge, check my signature "measuring real capacity of battery"). but, it was in times of bq27x00 module.

Now, there is option to check it via i2cget, but according to 412b, there is currently no good approach to probe this info constantly, without using too much power/resources.

yrannadx 2011-12-08 19:08

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by Estel (Post 1087858)
With dual batteries, percentage used to show most accurate value of all (after proper calibration of fuel gauge, check my signature "measuring real capacity of battery"). but, it was in times of bq27x00 module.

With the new great kp49, the now working bq27x00 module really display extremely accurate values. I am specially amazed with the fact that I can display now also the charge time and all values also during charging and not only for discharging as it was the case before.

Knowing how much time is left for full charge and how much fuel is needed to charge, is a feature I have never seen before in any other phone.

Current now is also very useful value, I could see for example that immediately after stand-by, the consumption is usually at 5-6 mAh and with this value the phone will stay in stand-by for about 9 days which is amazing. I am using only original batter at about 1236 mA full.

I also calibrated the fuel gauge before, with kp48, I am not sure if this calibration method is possible with kp49.

People wanting to check real battery values, can use the following commands in either Queen BeeCon either in Desktop Commands:

Code:

cat /sys/class/power_supply/bq27200-0/uevent | awk '{FS="="} /CAPACITY/ {cap = $2}; /CHARGE_NOW/ {chnow = int($2/1000)}; /CHARGE_FULL=/ {chfull = int($2/1000)}; /CURRENT_NOW/ {curnow = int($2/1000)}; /EMPTY_NOW/ {empt1 = int($2/3600); empt2 = int($2%3600/60)}; /EMPTY_AVG/ {avg1 = int($2/3600); avg2 = int($2%3600/60)}; /FULL_NOW/ {full1 = int($2/3600); full2 = int($2%3600/60)}; /STATUS/ {isch=$2} END if (isch == "Discharging") {print "Bat: "cap"% ("chnow" /"chfull" mAh)""\nNow: "curnow" mAh ("empt1":"empt2" h/ "avg1":"avg2" hAv)"} else {print "Bat: "cap"% ("chnow" /"chfull" mAh)""\nNow: "curnow" mAh ("full1":"full2" h/ "avg1":"avg2"hAv)"}';echo CPU: `awk '{print " " $1/1000 "MHz /"}' /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq` `cat /sys/class/power_supply/bq27200-0/temp | awk '{print int($0/10) " C"}'`

Estel 2011-12-08 23:24

Re: Pybattery - battery statusbar applet with candies
 
For some reasons, advanced power monitor doesn't allow me to choose bq27200 as data source. No big deal, cause using bq27200 disallow HEN usage (to be precise, disallow restarting BME, so after closing hen, resulting BME start causes device to reboot).

But still, I wonder why it's like that. APM just doesn't show bq27200 in list, even if bq27x00_battery module is enabled.

/Estel

yrannadx 2011-12-09 08:46

Re: Pybattery - battery statusbar applet with candies
 
I have all 5 modules listed in APM, Nokia's BME, BQ27200, etc. When choosing BME the percentage is wrong, but when choosing BQ the percentage is very accurate. Unfortunately, I don't know low level details of how these things works.

412b 2011-12-12 11:20

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by Estel (Post 1135250)
For some reasons, advanced power monitor doesn't allow me to choose bq27200 as data source. No big deal, cause using bq27200 disallow HEN usage (to be precise, disallow restarting BME, so after closing hen, resulting BME start causes device to reboot).

But still, I wonder why it's like that. APM just doesn't show bq27200 in list, even if bq27x00_battery module is enabled.

/Estel

Is it listed in HAL? If not, everything is correct )

Estel 2011-12-12 13:04

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by 412b (Post 1136524)
Is it listed in HAL? If not, everything is correct )

It seems that it is (listed), but could You specific exact bulletproof method of checking that, so all interested people can use one way of "measuring"? I think that it's going to help avoiding mistakes, and trace down origins of problem (be it on my device side or APM bug).

Thanks in advance,

/Estel

412b 2011-12-12 13:15

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by Estel (Post 1136548)
It seems that it is (listed), but could You specific exact bulletproof method of checking that, so all interested people can use one way of "measuring"? I think that it's going to help avoiding mistakes, and trace down origins of problem (be it on my device side or APM bug).

Thanks in advance,

/Estel

Quote:

Originally Posted by 412b (Post 1078310)
Code:

lshal | grep bq

(ten characters here)

Estel 2011-12-12 17:34

Re: Pybattery - battery statusbar applet with candies
 
Sorry - of course method was mentioned before.

Anyway, despite being listed in HAL:
Code:

lshal | grep bq
udi = '/org/freedesktop/Hal/device/computer_power_supply_battery_bq27200_0'
  info.udi = '/org/freedesktop/Hal/devices/computer_power_supply_battery_bq27200_0'  (string)
  linux.sysfs_path = '/sys/class/power_supply/bq27200-0'  (string)

...bq27200 doesn't appear as possible data source in APM settings. the only options I have, are "Nokia's BME", "Nokia's BME Alternative", and "Dummy".

/Estel

412b 2011-12-12 18:53

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by Estel (Post 1136664)
Sorry - of course method was mentioned before.

Anyway, despite being listed in HAL:
Code:

lshal | grep bq
udi = '/org/freedesktop/Hal/device/computer_power_supply_battery_bq27200_0'
  info.udi = '/org/freedesktop/Hal/devices/computer_power_supply_battery_bq27200_0'  (string)
  linux.sysfs_path = '/sys/class/power_supply/bq27200-0'  (string)

...bq27200 doesn't appear as possible data source in APM settings. the only options I have, are "Nokia's BME", "Nokia's BME Alternative", and "Dummy".

/Estel

What's about restarting APM? (sudo stop apmonitord; sudo start apmonitord) What's your way of loading bq module?


All times are GMT. The time now is 20:56.

vBulletin® Version 3.8.8