Battery Monitor

Booting, installing, newbie
Message
Author
User avatar
cimarron
Posts: 292
Joined: Fri 31 May 2013, 01:57

#21 Post by cimarron »

As I understand it, the "sources" from the BK repository are meant to be compiled for your particular puppy, not just extracted somewhere.

Try installing the 0.0.1 pet and see if it works for you. If so, you could try substituting the newer bevent, changing icons, etc. from that point. If it doesn't work, it's easy to uninstall the .pet.

Pbatt also shows time left on the battery, in the tooltip...

zaivala
Posts: 125
Joined: Mon 21 Mar 2011, 07:14

#22 Post by zaivala »

rcrsn51 wrote:@zaivala: Here is another battery monitor. This one shows the time left on the battery instead of the usual percent charge. When the battery gets low, it pops up a warning message.

Hopefully, this one will work for you. Please test and report.
It installed, and informed me it did not have a menu entry. So I just go run it in Console? Does it run at bootup or do I have to load it each time?

Ah, I see a new icon already in my taskbar, shows I'm plugged in. I pulled the plug and it hasn't changed yet but I assume it will soon...

Edit: I rebooted... it still shows me as plugged in LOL. But at least I have an icon, is that progress?

Second Edit: Over an hour later, still shows it plugged in.
Last edited by zaivala on Tue 24 Dec 2013, 16:38, edited 1 time in total.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#23 Post by rcrsn51 »

Hover your mouse over the icon.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#24 Post by rcrsn51 »

zaivala wrote:Second Edit: Over an hour later, still shows it plugged in.
When you hover your mouse over the icon, does it show the remaining time?

I understand your confusion about the icon, but let me explain the software development process. My first objective was to get you a battery monitor that solved your problem. Until I know that the monitor works, there is no point in spending time on pretty icons.

See the new version posted above and the comment about the icon.

zaivala
Posts: 125
Joined: Mon 21 Mar 2011, 07:14

#25 Post by zaivala »

Interesting. Yes, I get something when I hover my mouse pointer over the icon.

If it's plugged in, it say 101 minutes left. If it isn't plugged in, it says 160 minutes left. As I've had it out of the house for a while, it may not be fully charged.

Am I guessing correctly that the minutes left while plugged in is minutes until fully charged? Nope, probably not, as that number is getting larger the longer it's plugged in, would be smaller.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#26 Post by rcrsn51 »

zaivala wrote:If it's plugged in, it say 101 minutes left. If it isn't plugged in, it says 160 minutes left.
Here's why. When you pull the plug and go on battery, laptops often switch to low-power mode - less backlight, etc. Yabatt estimates the time remaining by dividing the current charge in the battery by the usage rate at that moment. So the time that is displayed may increase.
Am I guessing correctly that the minutes left while plugged in is minutes until fully charged?
No. The best way to know if the battery is fully charged is to look at the laptop's own indicator light.

Thanks for testing this.

zaivala
Posts: 125
Joined: Mon 21 Mar 2011, 07:14

#27 Post by zaivala »

LOL Well, the laptop's manual says it goes to a green light when it is at least 85% charged, so that's not the same as 100%. Thanks for all your help.

I was hoping for an indicator which WOULD show me, without mousing, so I would know when to plug in... as I said at the start of this thread, I get no warning that the battery is drained, other than my computer shutting off.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#28 Post by rcrsn51 »

zaivala wrote:I was hoping for an indicator which WOULD show me, without mousing, so I would know when to plug in... as I said at the start of this thread, I get no warning that the battery is drained, other than my computer shutting off.
rcrsn51 wrote:When the battery gets low, it pops up a warning message
Please run a full test and verify that this works for you.

User avatar
nilsonmorales
Posts: 972
Joined: Fri 15 Apr 2011, 14:39
Location: El Salvador

thank you

#29 Post by nilsonmorales »

sources please rcrsn51
[b][url=http://nilsonmorales.blogspot.com/]My blog |[/url][/b][b][url=https://github.com/woofshahenzup]| Github[/url][/b]
[img]https://i.postimg.cc/5tz5vrrX/imag018la6.gif[/img]
[img]http://s5.postimg.org/7h2fid8pz/botones_logos3.png[/img]

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

Re: thank you

#30 Post by rcrsn51 »

nilsonmorales wrote:sources please rcrsn51
The attachment has the source for yabatt_tray. It is a cut-down version of Pbatt. The compile command is listed inside. The other key file, yabatt_check, is a script.

Did the pop-up warning message work for you? I am still waiting for confirmation on this.

Zaivala has actually discovered a bug in the Puppy powerapplet_tray, which I also saw. If you let a battery completely discharge, it may start reporting its maximum capacity as zero. So when powerapplet_tray calculates the remaining charge as a percent of the maximum, it divides by zero and crashes. That's why yabatt calculates the remaining time instead.

[Edit] I looked at the powerapplet_tray code again and I'm not sure if I have the right explanation for the crash.

I am surprised that this situation has not been reported more often.
Attachments
yabatt_tray.c.tar.gz
(1.15 KiB) Downloaded 183 times

zaivala
Posts: 125
Joined: Mon 21 Mar 2011, 07:14

#31 Post by zaivala »

rcrsn51 wrote:
zaivala wrote:I was hoping for an indicator which WOULD show me, without mousing, so I would know when to plug in... as I said at the start of this thread, I get no warning that the battery is drained, other than my computer shutting off.
rcrsn51 wrote:When the battery gets low, it pops up a warning message
Please run a full test and verify that this works for you.
As usual, I missed that line. I'm running a test now but it says I have 205 minutes...

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#32 Post by rcrsn51 »

No rush.

In the meantime, could you go to /proc/acpi/battery/BATx , locate the file "info" and post it here. I think I understand why I originally got the "floating point exception" error, but your problem may be different.

I have posted v1.2 above with some improvements.

zaivala
Posts: 125
Joined: Mon 21 Mar 2011, 07:14

#33 Post by zaivala »

# /proc/acpi/battery/BATx
bash: /proc/acpi/battery/BATx: No such file or directory

LOL see what an idiot I am... did cd /proc/acpi/battery , found BAT0, did ls and found there is a file... let me see if I can open it...

present: yes
design capacity: 0 mWh
last full capacity: 37752 mWh
battery technology: rechargeable
design voltage: 1 mV
design capacity warning: 14520 mWh
design capacity low: 3775 mWh
cycle count: 377
capacity granularity 1: -1 mWh
capacity granularity 2: -1 mWh
model number: ÿÿÿÿ
serial number: X550A26
battery type:
OEM info: LIon

zaivala
Posts: 125
Joined: Mon 21 Mar 2011, 07:14

#34 Post by zaivala »

At "66 minutes left" I got a text box on my screen "Low Battery". So it works, in a very rudimentary but effective way.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#35 Post by rcrsn51 »

There are some wonky things about your battery. Those numbers should be in mAh, not mWh. Is that just a typo?

[Edit] I found an example where the numbers were in mWh.
design capacity: 0 mWh
This value is causing the "floating point exception" error. It should be the factory-fresh maximum capacity, not zero.
design capacity warning: 14520 mWh
This value triggers the warning message and is far higher than any of my batteries. That's why you are getting a warning with 66 minutes left.

Could you please also post the "state" file from the same folder?

zaivala
Posts: 125
Joined: Mon 21 Mar 2011, 07:14

#36 Post by zaivala »

rcrsn51 wrote:
Could you please also post the "state" file from the same folder?
present: yes
capacity state: ok
charging state: charged
present rate: 0 mW
remaining capacity: 35486 mWh
present voltage: 14520 mV

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#37 Post by rcrsn51 »

@zaivala: Please try v1.3 above. It triggers the warning message 5 minutes from shutdown. If this time doesn't work properly with your system, you can set it to something else.

I'm hoping that this version also works with batteries that use mWh instead of mAh.

With older batteries like ours, trying to calculate the capacity during charging can be either misleading or dangerous. So I have removed it. Now the message just says "Battery is charging".

Post Reply