Author |
Message |
rcrsn51

Joined: 05 Sep 2006 Posts: 11896 Location: Stratford, Ontario
|
Posted: Fri 27 Dec 2013, 08:42 Post subject:
Batterup - A Laptop Battery Monitor |
|
As laptop batteries age, they may start to misreport their information to the computer, causing the Puppy battery monitor to fail.
Batterup is a very simple replacement that will keep working. It displays the time remaining until shutdown and pops up a warning message when the battery is getting low.
Please note:
1.The Batterup tray icon does NOT change its appearance with the status of the battery.
2. It will start to show the time remaining AFTER you unplug the charger and the battery begins to discharge.
3. If you need an icon to tell you if your charger is plugged in, this tool is not for you.
4. Your laptop has an LED indicator that tells you when the battery is fully charged. If you need a tray icon to tell you the same thing, this tool is not for you.
Anyone who wants to try Batterup should send me a PM.
--------------------------------
The default warning time is 10 minutes, but you can easily change it.
1. Go to the folder /root/Startup
2. Open the file batterup_start in a text editor.
3. Line 3 is:
Code: | WARNTIME=10 # minutes from shutdown |
4. Change the 10 to whatever time you want.
5. Run Utility > Batterup Restart
-----------------------------
Update: If the warning message pops up while the machine is unattended, it will stay up for two minutes. If no action is taken during that time, the machine will power down.
-----------------------------
Update: Batterup uses two methods for triggering a warning. The primary method is to estimate the time remaining in minutes. But some batteries cannot provide the information required to make that calculation. Then the fallback method is to compare the remaining charge to the battery's own "design capacity warning" value.
But some batteries also fail to provide that information reliably. So here is a third method. It uses the battery voltage as an indicator because voltage tends to drop as batteries discharge. This has been confirmed to work by Don604.
Open /usr/sbin/batterup in a text editor and find line 51.
Code: | WARNCAP=$(grep "design capacity warning:" $BATPATH/info | awk '{print $4}') |
Delete it and insert these lines.
Code: | UNITS="mV"
WARNCAP="10000"
REMCAP=$(grep "present voltage:" $BATPATH/state | awk '{print $3}') |
This will take some trial and error. Adjust the "10000" to get a good warning point for your battery.
--------------------------------
Description |
|
Filesize |
4.59 KB |
Viewed |
1543 Time(s) |

|
Last edited by rcrsn51 on Fri 09 Oct 2015, 09:43; edited 31 times in total
|
Back to top
|
|
 |
mikeb

Joined: 23 Nov 2006 Posts: 11110
|
Posted: Fri 27 Dec 2013, 10:20 Post subject:
|
|
looks neat...quick test on 4.12 was fine so nice an compatible.
One feature I noticed is its easy to alter where it gets the battery info from...I had to make a custom vattery for one persons machine.
mike
|
Back to top
|
|
 |
rcrsn51

Joined: 05 Sep 2006 Posts: 11896 Location: Stratford, Ontario
|
Posted: Fri 27 Dec 2013, 10:56 Post subject:
|
|
Thanks for testing this.
When working with zaivala here, I discovered that some batteries report their data in mWh instead of mAh. I believe that Batterup should also work with these batteries, but it has not been verified.
If you have access to this type of battery, could you please test it?
|
Back to top
|
|
 |
mikeb

Joined: 23 Nov 2006 Posts: 11110
|
Posted: Fri 27 Dec 2013, 11:10 Post subject:
|
|
Well as it happens this notebook does use mwh.... incorrectly (it actually should be mAh) but the time remaining is correct. And yes its a battery in a poor state...gets 25 minutes max ...so perhaps a good test.
I like the flexible wrapper/config
mike
|
Back to top
|
|
 |
nilsonmorales

Joined: 15 Apr 2011 Posts: 938 Location: El Salvador
|
Posted: Fri 27 Dec 2013, 12:50 Post subject:
|
|
Spanish translate
Description |
md5sum 658a1408f8362d2ba87f03b96e6f01e8 mo&po.tar
|

Download |
Filename |
mo&po.tar |
Filesize |
10 KB |
Downloaded |
409 Time(s) |
_________________ My blog | | Github

|
Back to top
|
|
 |
rcrsn51

Joined: 05 Sep 2006 Posts: 11896 Location: Stratford, Ontario
|
Posted: Fri 27 Dec 2013, 13:02 Post subject:
|
|
mikeb wrote: | Well as it happens this notebook does use mwh.... incorrectly (it actually should be mAh) but the time remaining is correct. And yes its a battery in a poor state...gets 25 minutes max ...so perhaps a good test.mike |
Thanks. Since P=VI, I was pretty sure that it would work.
@nilsonmorales: Here is the source.
Description |
Updated 2013-12-30 for v1.2D
|

Download |
Filename |
batterup_tray.c-1.2D.tar.gz |
Filesize |
1.25 KB |
Downloaded |
471 Time(s) |
Last edited by rcrsn51 on Fri 09 Jan 2015, 18:25; edited 2 times in total
|
Back to top
|
|
 |
rcrsn51

Joined: 05 Sep 2006 Posts: 11896 Location: Stratford, Ontario
|
Posted: Sun 29 Dec 2013, 07:16 Post subject:
|
|
Batterup v1.1 is posted above. Please read the Update information.
|
Back to top
|
|
 |
rcrsn51

Joined: 05 Sep 2006 Posts: 11896 Location: Stratford, Ontario
|
Posted: Mon 30 Dec 2013, 08:34 Post subject:
|
|
Batterup v1.2D is posted above. Please read the Update information.
|
Back to top
|
|
 |
rcrsn51

Joined: 05 Sep 2006 Posts: 11896 Location: Stratford, Ontario
|
Posted: Fri 17 Oct 2014, 15:23 Post subject:
|
|
Batterup v1.4 is posted above. Please read the Update information. Additional test results would be appreciated.
|
Back to top
|
|
 |
sheldonisaac
Joined: 21 Jun 2009 Posts: 717 Location: Philadelphia, PA
|
Posted: Thu 08 Jan 2015, 14:22 Post subject:
ver 1.4 |
|
rcrsn51 wrote: | Batterup v1.4 is posted above. Please read the Update information. Additional test results would be appreciated. |
You'd said Quote: | Update: Batterup uses the battery's present rate of discharge to calculate the time remaining. But some batteries do not report this information. In that case, v1.4 displays the amount of charge remaining in mAh or mWh and triggers a warning message when the charge drops below the battery's design capacity warning level. |
I just installed ver 1.4 on this Dell Latitude E6410, Lucid Puppy "Super 2".
Hovering over the yellow icon shows Quote: | Battery BAT0: stopped charging | Does that seem OK?
Thanks,
Sheldon
_________________ Dell E6410: Xenial, etc
Dell Mini 9, Acer Aspire One, EeePC 1018P, PowerBook G4
Intel D865GBF, Intel DQ35JOE
|
Back to top
|
|
 |
rcrsn51

Joined: 05 Sep 2006 Posts: 11896 Location: Stratford, Ontario
|
Posted: Thu 08 Jan 2015, 14:31 Post subject:
Re: ver 1.4 |
|
sheldonisaac wrote: | Hovering over the yellow icon shows Quote: | Battery BAT0: stopped charging | Does that seem OK? |
Is the AC currently plugged in? That message appears when Batterup checks the "charging state" of the battery and gets the report "charged". That means that the battery is not currently discharging. Batterup needs to see the battery discharging in order to determine how much time is left.
|
Back to top
|
|
 |
sheldonisaac
Joined: 21 Jun 2009 Posts: 717 Location: Philadelphia, PA
|
Posted: Thu 08 Jan 2015, 14:39 Post subject:
Re: ver 1.4 |
|
rcrsn51 wrote: | sheldonisaac wrote: | Hovering over the yellow icon shows Quote: | Battery BAT0: stopped charging | Does that seem OK? |
Is the AC currently plugged in? That message appears when Batterup checks the "charging state" of the battery and gets the report "charged". That means that the battery is not currently discharging. Batterup needs to see the battery discharging in order to determine how much time is left. | OK, I unplugged the charger.. AHA! Now it says Quote: | BAT0: 152 minutes left |
_________________ Dell E6410: Xenial, etc
Dell Mini 9, Acer Aspire One, EeePC 1018P, PowerBook G4
Intel D865GBF, Intel DQ35JOE
|
Back to top
|
|
 |
rcrsn51

Joined: 05 Sep 2006 Posts: 11896 Location: Stratford, Ontario
|
Posted: Thu 08 Jan 2015, 14:54 Post subject:
|
|
Excellent. Now you need to experiment a bit. You currently have 152 minutes, based on your CURRENT rate of discharge. If you start watching a video, your discharge rate will increase and your remaining time will decrease quickly. So the default warning time of 10 minutes may not give you enough time to shut down before the battery dies. I originally had it set at 5 minutes but it sometimes wasn't enough if the discharge rate suddenly jumped.
|
Back to top
|
|
 |
darry1966

Joined: 26 Feb 2012 Posts: 898
|
Posted: Thu 08 Jan 2015, 17:20 Post subject:
Re: Batterup - A Laptop Battery Monitor |
|
rcrsn51 wrote: | As laptop batteries age, they may start to misreport their information to the computer, causing the Puppy battery monitor to fail.
Batterup is a very simple replacement that will keep working. It displays the time remaining until shutdown and pops up a warning message when the battery is getting low.
Please note that the Batterup tray icon does NOT change with the status of the battery.
--------------------------------
The default warning time is 10 minutes, but you can easily change it.
1. Go to the folder /root/Startup
2. Open the file batterup_start in a text editor.
3. Line 3 is:
Code: | WARNTIME=10 # minutes from shutdown |
4. Change the 10 to whatever time you want.
5. Run Utility > Batterup Restart
-----------------------------
Update: Batterup uses the battery's present rate of discharge to calculate the time remaining. But some batteries do not report this information. In that case, v1.4 displays the amount of charge remaining in mAh or mWh and triggers a warning message when the charge drops below the battery's design capacity warning level.
-------------------------------- |
Excellent will try with 3.01 and AnitaOS based on Mikeb's report will be excellent if it reports a true reading, great work thanks.
|
Back to top
|
|
 |
rcrsn51

Joined: 05 Sep 2006 Posts: 11896 Location: Stratford, Ontario
|
Posted: Fri 09 Jan 2015, 17:54 Post subject:
Re: Batterup - A Laptop Battery Monitor |
|
darry1966 wrote: | Excellent will try with 3.01 and AnitaOS . |
No reply? There has been almost no feedback on this project. If it has no practical value, I will remove it.
|
Back to top
|
|
 |
|