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)

gabby131 2010-08-18 12:47

Re: Pybattery - battery statusbar applet with candies
 
tried killing xorg via xterm. so it gave me a reboot, but still same issue

IceJunior 2010-08-18 12:49

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by 412b (Post 790396)
Is there line 'USING: Nokia's BME'? It should be in the log file.


Nope. Just the lines I posted.

Quote:

Originally Posted by 412b (Post 790396)
Yep... For unknown for me at the moment reason Xorg starts using CPU at the level of 100%, when apmonitord is stopped... Right after reboot it's normal on my device...

Not the same here, even after de-install an reboot, xorg kills my battery and CPU. ;)

412b 2010-08-18 13:08

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by IceJunior (Post 790422)
Nope. Just the lines I posted.

That's odd... It should write it, if loaded properly.
Quote:

Originally Posted by IceJunior (Post 790422)
Not the same here, even after de-install an reboot, xorg kills my battery and CPU. ;)

I got a mistype in upstart script.
As root edit /etc/event.d/apmonitord:
Change line starting with
Code:

stop on ...
to
Code:

stop on starting shutdown
And post the results. It should help.

pedro-25 2010-08-18 13:20

Re: Pybattery - battery statusbar applet with candies
 
i have uninstalled advance power cause i did not work but now i have xorg running at 100% any way of sorting this without reflashing?

fw190 2010-08-18 13:25

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by 412b (Post 790460)
That's odd... It should write it, if loaded properly.


I got a mistype in upstart script.
As root edit /etc/event.d/apmonitord:
Change line starting with
Code:

stop on ...
to
Code:

stop on starting shutdown
And post the results. It should help.

Did as You wrote and saved the file. Then made a reboot and the same thing.

412b 2010-08-18 14:30

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by fw190 (Post 790484)
Did as You wrote and saved the file. Then made a reboot and the same thing.

Then the last thing to change is
Code:

console owner
to
Code:

console none
as Xorg uses console to write its log.

IceJunior 2010-08-18 14:49

Re: Pybattery - battery statusbar applet with candies
 
It seems that the xorg problem is solved, your fix worked... Thanks for that! :)

But the app problem still exists... ;) still battery icon with a cross inside, and it sasy 'APMD disconnected' and when I click on it, it changes to 'Starting APMD'

412b 2010-08-18 15:48

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by IceJunior (Post 790579)
It seems that the xorg problem is solved, your fix worked... Thanks for that! :)

But the app problem still exists... ;) still battery icon with a cross inside, and it sasy 'APMD disconnected' and when I click on it, it changes to 'Starting APMD'

Heh... Moving right way is a good way :)
Can you attach a screenshot of statusbar and status-menu? Because I don't remember such an icon used in AP )))

I'll upload package with Xorg fix tomorrow as I won't be at home tonight.

IceJunior 2010-08-18 16:29

Re: Pybattery - battery statusbar applet with candies
 
Here they are :)

http://img691.imageshack.us/img691/6...eenshot02x.png



http://img713.imageshack.us/img713/8...reenshot00.png


I took them right after a fresh install of AP(M).

brandonc 2010-08-18 16:52

Re: Pybattery - battery statusbar applet with candies
 
any fix for the Xorg locking at 100% problem? Its kind of a drag seeing as it just drains the battery

bitrocky 2010-08-18 17:53

Re: Pybattery - battery statusbar applet with candies
 
hi,

the change in the "console" line did the trick with Xorg! Thx!

I noticed the last line (respawn) in apmonitord didn't had a linefeed, but I didn't reinstalled apm to test if it makes a different, no time yet.

BTW: I also had the same problem like IceJunior.

bitrocky 2010-08-18 18:19

Re: Pybattery - battery statusbar applet with candies
 
ok, I just reinstalled apm and still the "Startnig APMD" button...

IceJunior 2010-08-19 04:40

Re: Pybattery - battery statusbar applet with candies
 
Hopefully we'll find a solution today..

IceJunior 2010-08-19 16:14

Re: Pybattery - battery statusbar applet with candies
 
No news is good news I hope ;)

412b 2010-08-19 19:08

Re: Pybattery - battery statusbar applet with candies
 
Ok. I've reread posts. Somehow upstart doesn't start Advanced Power Monitor, which is quite strange.
For now just run as root
Code:

start apmonitord
And attach output.
Anyway it should help me to figure out, why apmonitord isn't starting at startup (crossed fingers :D)

IceJunior 2010-08-19 20:10

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by IceJunior (Post 790382)
Code:

apmonitord (start) waiting
apmonitord (start) starting
apmonitord (start) pre-start
apmonitord (start) spawned, process 1602
apmonitord (start) post-start, (main) process 1602
apmonitord (start) running, process 1602


still the same output (with other PID's for sure), the process is runnig but nothning else...

maybe I should reflash and just install apm on a fresh os?

412b 2010-08-19 20:21

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by IceJunior (Post 792243)
still the same output (with other PID's for sure), the process is runnig but nothning else...

maybe I should reflash and just install apm on a fresh os?

Hmmm... In build 7, log should be in /home/user, can you attach it to be sure.

I really don't know, what could happen with OS for APM to stop working... You can try, if it isn't harmful and abusing.

DaSilva 2010-08-19 20:46

Re: Pybattery - battery statusbar applet with candies
 
Nokia-N900:~# cat /home/user/apmonitord.log
Advanced Power Monitor 0.5.2-7
Loaded modules (1/1): DeviceName

Loading wrappers...
Loading packages list...
LOADED: Nokia's BME
FAILED: BME Free
LOADED: Dummy

Fionn 2010-08-19 21:01

Re: Pybattery - battery statusbar applet with candies
 
Thanks for the recent Diablo update.
I particularly like the single click for "Flight mode + Lock". :)

412b 2010-08-19 21:04

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by DaSilva (Post 792290)
Nokia-N900:~# cat /home/user/apmonitord.log
Advanced Power Monitor 0.5.2-7
Loaded modules (1/1): DeviceName

Loading wrappers...
Loading packages list...
LOADED: Nokia's BME
FAILED: BME Free
LOADED: Dummy

why do i get required 'USING...' line...
do APM and AP work for you?

412b 2010-08-19 21:08

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by Fionn (Post 792307)
Thanks for the recent Diablo update.
I particularly like the single click for "Flight mode + Lock". :)

I just finally pushed it from extras-devel to extras ;)
unfortunatelly, now without Diablo device it's hard to finish the brand new version (((

DaSilva 2010-08-19 21:12

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by 412b (Post 792312)
why do i get required 'USING...' line...
do APM and AP work for you?

Yes, I think so:

Nokia-N900:~# start apmonitord
apmonitord (start) waiting
apmonitord (start) starting
apmonitord (start) pre-start
apmonitord (start) spawned, process 24606
apmonitord (start) post-start, (main) process 24606
apmonitord (start) running, process 24606

IceJunior 2010-08-19 21:33

Re: Pybattery - battery statusbar applet with candies
 
Code:

Advanced Power Monitor 0.5.2-7
Loaded modules (1/1): DeviceName

Loading wrappers...
Loading packages list...
LOADED: Nokia's BME
LOADED: Dummy
FAILED: BME Free

new version same issues... :(

412b 2010-08-19 22:03

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by IceJunior (Post 792355)
Code:

Advanced Power Monitor 0.5.2-7
Loaded modules (1/1): DeviceName

Loading wrappers...
Loading packages list...
LOADED: Nokia's BME
LOADED: Dummy
FAILED: BME Free

new version same issues... :(

There were no fixes made in fact, I'm keep on gathering info :)
Do you use kernel-power?

DaSilva 2010-08-19 22:17

Re: Pybattery - battery statusbar applet with candies
 
Yes I do. :)

EDIT: I have just installed 0.5.2-8 and rebooted and APMD was disconnected. After a click on the the icon it now says "Starting APMD" but the battery is still crossed out and it doesn't work :(

412b 2010-08-19 22:43

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by DaSilva (Post 792414)
Yes I do. :)

EDIT: I have just installed 0.5.2-8 and rebooted and APMD was disconnected. After a click on the the icon it now says "Starting APMD" but the battery is still crossed out and it doesn't work :(

And build 7 worked fine?
I' ll add some sudoers settings in build 9 of APMD and build 12 of APM to work correctly in 15 minutes :) So it can be started right from applet...

DaSilva 2010-08-19 22:44

Re: Pybattery - battery statusbar applet with candies
 
No, the same for build 7. I didn't know what you changed in build 8 (always the same changelog) so I just reported.

EDIT: Now the log says

Code:

Nokia-N900:~# cat /home/user/apmonitord.log
Advanced Power Monitor 0.5.2-8
RX-51_2009SE_10.2010.19-1_PR_MR0

Loaded modules (2/2): DeviceName OSVersion_Maemo

Loading wrappers...

LOADING battery
Loading packages list...
[L] Nokia's BME
[L] Dummy

and after the second try to start it I get

Code:

Nokia-N900:~# start apmonitord
apmonitord (start) waiting
apmonitord (stop) starting
apmonitord (stop) starting
apmonitord (stop) waiting
start: apmonitord respawning too fast, stopped

even with a stop apmonitord before that it says:

Code:

Nokia-N900:~# stop apmonitord
stop: Job not changed: apmonitord


AlMehdi 2010-08-19 22:49

Re: Pybattery - battery statusbar applet with candies
 
It's a long thread and it looks very cool. I have not read all of it.. the thing is. Do it have support for the Humanity-theme? I am using the Humanity-theme and the place for the battery is empty. In the OP it didn't say it supported Humanity-theme so i guess it does not. Is there a howto to make it support Humanity-theme?

I do not know how it works.. but wouldn't it be better if you put the icons in "/usr/share/icons/hicolor" so that all themes would be supported? Or would that be bad?

412b 2010-08-19 23:01

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by DaSilva (Post 792453)
No, the same for build 7. I didn't know what you changed in build 8 (always the same changelog) so I just reported.

EDIT: Now the log says

Code:

Nokia-N900:~# cat /home/user/apmonitord.log
Advanced Power Monitor 0.5.2-8
RX-51_2009SE_10.2010.19-1_PR_MR0

Loaded modules (2/2): DeviceName OSVersion_Maemo

Loading wrappers...

LOADING battery
Loading packages list...
[L] Nokia's BME
[L] Dummy

and after the second try to start it I get

Code:

Nokia-N900:~# start apmonitord
apmonitord (start) waiting
apmonitord (stop) starting
apmonitord (stop) starting
apmonitord (stop) waiting
start: apmonitord respawning too fast, stopped

even with a stop apmonitord before that it says:

Code:

Nokia-N900:~# stop apmonitord
stop: Job not changed: apmonitord


It seems not to fail using correct wrapper according to output.
Here comes one more debug command:
Code:

python /opt/maemo/usr/lib/advanced-power-monitor/apmdaemon.py

412b 2010-08-19 23:05

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by AlMehdi (Post 792458)
I do not know how it works.. but wouldn't it be better if you put the icons in "/usr/share/icons/hicolor" so that all themes would be supported? Or would that be bad?

It uses standard Maemo icons (which are already in /usr/share/icons/hicolor), nothing custom. So the question is what going on with non-standard themes :)

DaSilva 2010-08-19 23:17

Re: Pybattery - battery statusbar applet with candies
 
New version after a reboot still disconnected:

Code:

Nokia-N900:~# cat /home/user/apmonitord.log
Advanced Power Monitor 0.5.2-9
RX-51_2009SE_10.2010.19-1_PR_MR0

Loaded modules (2/2): DeviceName OSVersion_Maemo

Loading wrappers...

LOADING battery
Loading packages list...
[L] Nokia's BME
[L] Dummy

After a click on "Start APMD" in the status bar it displays "Starting APMD" as with previous builds and nothing else happens.
After "start apmonitord" the text changes back to "APMD disconnected" even if it seemed to work in the console:

Code:

Nokia-N900:~# start apmonitord
apmonitord (start) waiting
apmonitord (start) starting
apmonitord (start) pre-start
apmonitord (start) spawned, process 2185
apmonitord (start) post-start, (main) process 2185
apmonitord (start) running, process 2185

Your latest debug command shows this:

Code:

Nokia-N900:~# python /opt/maemo/usr/lib/advanced-power-monitor/apmdaemon.py
Advanced Power Monitor 0.5.2-9
RX-51_2009SE_10.2010.19-1_PR_MR0

Loaded modules (2/2): DeviceName OSVersion_Maemo

Loading wrappers...

LOADING battery
Loading packages list...
[L] Nokia's BME
[L] Dummy
Traceback (most recent call last):
  File "/opt/maemo/usr/lib/advanced-power-monitor/apmdaemon.py", line 21, 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 159, in __init_wrappers
    self.change_wrapper(key, self.get_available_wrappers(key)[0])
  File "/opt/maemo/usr/lib/advanced-power-monitor/AdvancedPowerMonitor.py", line 199, in change_wrapper
    self.__wrappers[key]['object'] = self.__wrappers[key]['list'][self.__wrappers[key]['available'][new_wrapper]](self.__bus)
  File "/opt/maemo/usr/lib/advanced-power-monitor/wrappers/battery/AbstractBattery.py", line 16, in __init__
    AbstractWrapper.__init__(self, bus, check)
  File "/opt/maemo/usr/lib/advanced-power-monitor/wrappers/AbstractWrappers.py", line 25, in __init__
    self.__end_init()
  File "/opt/maemo/usr/lib/advanced-power-monitor/wrappers/AbstractWrappers.py", line 33, in __end_init
    self.post_init()
  File "/opt/maemo/usr/lib/advanced-power-monitor/wrappers/battery/BatteryBME.py", line 27, in post_init
    self.update_percent()
  File "/opt/maemo/usr/lib/advanced-power-monitor/wrappers/battery/BatteryBME.py", line 40, in update_percent
    self.battery_percent = get_formatted_percentage(self.interfaces['BME'].GetPropertyInteger(u'battery.reporting.current'), self.battery_design)
NameError: global name 'get_formatted_percentage' is not defined


412b 2010-08-19 23:55

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by DaSilva (Post 792493)
Your latest debug command shows this:

Code:

Nokia-N900:~# python /opt/maemo/usr/lib/advanced-power-monitor/apmdaemon.py
Advanced Power Monitor 0.5.2-9
RX-51_2009SE_10.2010.19-1_PR_MR0

Loaded modules (2/2): DeviceName OSVersion_Maemo

Loading wrappers...

LOADING battery
Loading packages list...
[L] Nokia's BME
[L] Dummy
Traceback (most recent call last):
  File "/opt/maemo/usr/lib/advanced-power-monitor/apmdaemon.py", line 21, 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 159, in __init_wrappers
    self.change_wrapper(key, self.get_available_wrappers(key)[0])
  File "/opt/maemo/usr/lib/advanced-power-monitor/AdvancedPowerMonitor.py", line 199, in change_wrapper
    self.__wrappers[key]['object'] = self.__wrappers[key]['list'][self.__wrappers[key]['available'][new_wrapper]](self.__bus)
  File "/opt/maemo/usr/lib/advanced-power-monitor/wrappers/battery/AbstractBattery.py", line 16, in __init__
    AbstractWrapper.__init__(self, bus, check)
  File "/opt/maemo/usr/lib/advanced-power-monitor/wrappers/AbstractWrappers.py", line 25, in __init__
    self.__end_init()
  File "/opt/maemo/usr/lib/advanced-power-monitor/wrappers/AbstractWrappers.py", line 33, in __end_init
    self.post_init()
  File "/opt/maemo/usr/lib/advanced-power-monitor/wrappers/battery/BatteryBME.py", line 27, in post_init
    self.update_percent()
  File "/opt/maemo/usr/lib/advanced-power-monitor/wrappers/battery/BatteryBME.py", line 40, in update_percent
    self.battery_percent = get_formatted_percentage(self.interfaces['BME'].GetPropertyInteger(u'battery.reporting.current'), self.battery_design)
NameError: global name 'get_formatted_percentage' is not defined


That's the point :)
What version of Advanced Power Common is installed? 0.4.1-5?

IceJunior 2010-08-20 05:04

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by DaSilva (Post 792493)

Code:

Nokia-N900:~# python /opt/maemo/usr/lib/advanced-power-monitor/apmdaemon.py
Advanced Power Monitor 0.5.2-9
RX-51_2009SE_10.2010.19-1_PR_MR0

Loaded modules (2/2): DeviceName OSVersion_Maemo

Loading wrappers...

LOADING battery
Loading packages list...
[L] Nokia's BME
[L] Dummy
Traceback (most recent call last):
  File "/opt/maemo/usr/lib/advanced-power-monitor/apmdaemon.py", line 21, 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 159, in __init_wrappers
    self.change_wrapper(key, self.get_available_wrappers(key)[0])
  File "/opt/maemo/usr/lib/advanced-power-monitor/AdvancedPowerMonitor.py", line 199, in change_wrapper
    self.__wrappers[key]['object'] = self.__wrappers[key]['list'][self.__wrappers[key]['available'][new_wrapper]](self.__bus)
  File "/opt/maemo/usr/lib/advanced-power-monitor/wrappers/battery/AbstractBattery.py", line 16, in __init__
    AbstractWrapper.__init__(self, bus, check)
  File "/opt/maemo/usr/lib/advanced-power-monitor/wrappers/AbstractWrappers.py", line 25, in __init__
    self.__end_init()
  File "/opt/maemo/usr/lib/advanced-power-monitor/wrappers/AbstractWrappers.py", line 33, in __end_init
    self.post_init()
  File "/opt/maemo/usr/lib/advanced-power-monitor/wrappers/battery/BatteryBME.py", line 27, in post_init
    self.update_percent()
  File "/opt/maemo/usr/lib/advanced-power-monitor/wrappers/battery/BatteryBME.py", line 40, in update_percent
    self.battery_percent = get_formatted_percentage(self.interfaces['BME'].GetPropertyInteger(u'battery.reporting.current'), self.battery_design)
NameError: global name 'get_formatted_percentage' is not defined


Oh, btw, I got the same output, I noticed that yesterday but I forgot to attach :-D

DaSilva 2010-08-20 08:19

Re: Pybattery - battery statusbar applet with candies
 
Thanks, now with the latest version it is working (finally)! :)
Great work!
Just one question: Is it possible to show "Charging (∞)" while charging instead of "0:00 / 23:00" (the ∞ should be the unlimited ASCII character)?

btw: is APM "learning" to do a better estimation after a while?

fw190 2010-08-20 11:47

Re: Pybattery - battery statusbar applet with candies
 
I can report that it also works for me on Titans kernel 40!

412b 2010-08-20 12:01

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by DaSilva (Post 792765)
Just one question: Is it possible to show "Charging (∞)" while charging instead of "0:00 / 23:00" (the ∞ should be the unlimited ASCII character)?

I'm thinking of just removing that text while charging.

Quote:

Originally Posted by DaSilva (Post 792765)
btw: is APM "learning" to do a better estimation after a while?

It's left for Nokia's BME. APM just gets battery capacity and current charge.
I have some patches for correcting estimation in unstable branch, but it's not good enough from my point of view.

CasTTeLLo 2010-08-20 14:59

Re: Pybattery - battery statusbar applet with candies
 
have u done with batt remaining status applet? just for sure..
http://talk.maemo.org/attachment.php...1&d=1281971319

DaSilva 2010-08-20 21:39

Re: Pybattery - battery statusbar applet with candies
 
Quote:

Originally Posted by 412b (Post 792938)
I'm thinking of just removing that text while charging.


It's left for Nokia's BME. APM just gets battery capacity and current charge.
I have some patches for correcting estimation in unstable branch, but it's not good enough from my point of view.

I think a text information like "Charging" would be better than nothing.

It would be nice to see a better estimation because currently it is extremely pessimistic.

snookh 2010-08-21 01:26

Re: Pybattery - battery statusbar applet with candies
 
very nice applet, this is how it should have been made by nokia really.
Anyway, would it be possible to add localization in perhaps a ini file or something? Many of us doesn't use english language on our devices, it just would look better if the applet was the same language as the rest of the OS.

412b 2010-08-21 14:54

Re: Pybattery - battery statusbar applet with candies
 
There is a small bug in second number for timeleft. Fixed in upcoming release.

Quote:

Originally Posted by snookh (Post 793617)
very nice applet, this is how it should have been made by nokia really.
Anyway, would it be possible to add localization in perhaps a ini file or something? Many of us doesn't use english language on our devices, it just would look better if the applet was the same language as the rest of the OS.

Next release is a bugfix and after it I'll add Russian locale and looking for translators for other locales.


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

vBulletin® Version 3.8.8