Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 22 Oct 2014, 11:35
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Unsorted
Battery Monitoring Dotpup for JWM
Moderators: deshlab, Flash, GuestToo, Ian, JohnMurga, Lobster
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 6 [87 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6 Next
Author Message
kirk

Joined: 11 Nov 2005
Posts: 1419
Location: florida

PostPosted: Fri 03 Nov 2006, 11:17    Post subject:  

Just tried the dotpup. Works for me!

I'm running 2.12 beta. When I ran "Batmon" from the DotPups menu, a window popped up saying that the zdrv file was being copied to the same place as my pup_save file. It just sat there for a while, probably because there's just a couple Mbytes left on that partition. So I clicked in the corner to close the window and the computer rebooted. When I ran "Batmon" from the DotPups menu again, the percent of battery showed up in the task bar.

Maybe a 2.12 bug?

Thnaks!
Back to top
View user's profile Send private message 
plinej

Joined: 13 Aug 2006
Posts: 1522

PostPosted: Fri 03 Nov 2006, 11:25    Post subject:  

Might be, I'm in 2.11 right now.
Back to top
View user's profile Send private message 
Rickrandom

Joined: 21 Jan 2006
Posts: 195
Location: Bedfordshire, UK

PostPosted: Fri 03 Nov 2006, 14:18    Post subject:  

I installed the dotpup, but just got the -%.

I tried in a terminal modprobe battery and modprobe ac (both seemed OK) and batmon.sh (some errors).

I've restarted JWM a couple of times.

I got confused about what to click, etc. Any suggestions?

Puppy 2.10, frugal install.
Back to top
View user's profile Send private message 
brad_chuck

Joined: 15 Aug 2005
Posts: 284
Location: Appalachian Mountains

PostPosted: Fri 03 Nov 2006, 14:52    Post subject:  

I updated the main post again with some updated work. This time the main executable will alternate between battery status and free memory. By default it switches about every 10 seconds or so.

Also I fixed the script so that the problem with the mWh vs mAh should work. If your battery status is "mILIKECHICKENSh" it will work...

With the new program you should replace the freememapplet with batmon and this executable should do both tasks ( because it switches ).

This is what I plan on implementing in the next few days.

** Detecting if you have a battery and if so modprobeing it
** Making the color change if your battery is low
** Flashing and warning messages
** If you don't have a battery turning the batmon function off
** Eliminating the batmon.sh script and coding it in c

Kirk, use the tar.gz file at the top it is easy to install and the new one will work bettor.

I need testers because I have a suspicion that the structure of the /proc dir is different on different machines.
Back to top
View user's profile Send private message 
brad_chuck

Joined: 15 Aug 2005
Posts: 284
Location: Appalachian Mountains

PostPosted: Fri 03 Nov 2006, 15:03    Post subject: idea  

Rickrandom, Try the new batmon-0.0.2.tar.gz first then if that does not work copy and paste the exact error message and I will try to work it out.

I just had an idea..... What do you guys think?

If we made the batmon into a front for a shell script that could control it

so say you could do something like
Code:

while [ 1 ] ;do
batmon -bg #000000 -fg #ffffff `batmon.sh`
sleep 10
batmon -bg #000000 -fg #ffffff `getfreemem.sh`
sleep 10
done


this way you could just update the shell script and bam it would do your bidding. Flash when battery is low or when it goes below freezing whatever.

Temperature , stock prices.........
Back to top
View user's profile Send private message 
plinej

Joined: 13 Aug 2006
Posts: 1522

PostPosted: Fri 03 Nov 2006, 16:36    Post subject:  

Sounds good to me Brad. I'll be happy to test it out.
Back to top
View user's profile Send private message 
brad_chuck

Joined: 15 Aug 2005
Posts: 284
Location: Appalachian Mountains

PostPosted: Fri 03 Nov 2006, 19:22    Post subject: Thanks  

Thanks it will take me a few days... I have a lot to do this weekend.

I think the best way to do it it to is like this

Code:
script.sh | executable


Then the script would do something like

Code:

while [ 1 ];do
echo "#000000"
echo "#ffffff"
echo "`batmon.sh`"
sleep 10
echo "#000000"
echo "#ffffff"
echo "`freemem.sh`"
sleep 10
done
Back to top
View user's profile Send private message 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7047
Location: Perth, Western Australia

PostPosted: Fri 03 Nov 2006, 19:30    Post subject:  

This is great! I won't put it into 2.12 yet, as it's "under heavy development"!
Back to top
View user's profile Send private message Visit poster's website 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7047
Location: Perth, Western Australia

PostPosted: Fri 03 Nov 2006, 20:14    Post subject:  

This is great! I won't put it into 2.12 yet, as it's "under heavy development"!
Back to top
View user's profile Send private message Visit poster's website 
JB4x4

Joined: 30 Jul 2006
Posts: 256

PostPosted: Fri 03 Nov 2006, 21:41    Post subject:  

Tried out the 0.2 version and my battery now reads without any extra work, Thanks.

Just my opinion: Not sure if I care for the switching feature, I myself would prefer two separate readouts (one for battery / one for free space).

Keep up the good work though.

JB
Back to top
View user's profile Send private message Yahoo Messenger 
brad_chuck

Joined: 15 Aug 2005
Posts: 284
Location: Appalachian Mountains

PostPosted: Sat 04 Nov 2006, 00:09    Post subject: This should work for you  

When I get the above idea working you can set it up however you like...


For now this is an exe that does not change.. it just stays on battery.
noswapbatmon.tar.gz
Description 
gz

 Download 
Filename  noswapbatmon.tar.gz 
Filesize  8.51 KB 
Downloaded  416 Time(s) 
Back to top
View user's profile Send private message 
pakt


Joined: 04 Jun 2005
Posts: 1089
Location: Sweden

PostPosted: Sat 04 Nov 2006, 06:14    Post subject:  

Thanks, brad_chuck!

batmon.pup 0.2 works great with Puppy 2.12beta on my Dell Inspiron 510m laptop.

Here is a hack of batmon.sh to display the CPU temperature. Useful for seeing the effect of running CPU frequency scaling or for monitoring cooling status.
Requires: modprobe thermal to work.

Could also be used alternating: freemem/battery charge/CPU temp
Code:
#!/bin/sh
#batmon.sh hack for displaying CPU temperature, by pakt

cd /proc/acpi/thermal_zone/
for a in `ls`
do
if [ "`grep C /proc/acpi/thermal_zone/$a/temperature`" != "" ]; then
temp="`cat /proc/acpi/thermal_zone/$a/temperature | grep "temperature:" | sed -n 's/temperature:            //p'`"
fi
done
echo -n "${temp}"

Note that the $a variable is necessary. The folder name varies from machine to machine. On my Dell 510m it is THM, on a Thinkpad it is THM0.
Paul
batmon_temp.png
 Description   batmon.sh hacked to show CPU temp
 Filesize   2.29 KB
 Viewed   1681 Time(s)

batmon_temp.png


_________________
Testing Puppy since v0.9.2 - my desktop OS since v1.0.7
Running SlaxerPup-4.12 - Puppy with a Slackware 12.2 heart Cool
Back to top
View user's profile Send private message 
Rickrandom

Joined: 21 Jan 2006
Posts: 195
Location: Bedfordshire, UK

PostPosted: Sat 04 Nov 2006, 10:27    Post subject:  

I still have the -% displayed, with version 0.2 (I think - I'm not very good with tar and all that stuff Embarassed ). It swaps between free memory and the -%, so I assume that it's v0.2.

Does this mean anything from typing batmon.sh?

/usr/local/bin/batmon.sh: line 19: let: per=((*100)/()): syntax error: operand expected (error token is "*100)/())")

Anyway, a couple of comments:

1. As any such feature takes up some screen space, I'd suggest it doesn't display the decimal place or MB, just M, for the free memory. 123M is plenty, 123.2MB takes up a bit more space, but seems unnecessary.

2. I'd agree with a previous poster, that swapping is less preferable to one fixed display. (I guess it sort of contradicts my other comment!)

Thinking further ahead, would it be possible for batmon to also perform a graceful shutdown if the % gets below a threshold? I usually use my laptop on mains power, but have left it on battery once or twice and found it dead when I've come back. Thus it hasn't saved to disk, so there is a risk of losing stuff.
Back to top
View user's profile Send private message 
pakt


Joined: 04 Jun 2005
Posts: 1089
Location: Sweden

PostPosted: Sat 04 Nov 2006, 11:01    Post subject:  

Rickrandom wrote:
I still have the -% displayed, with version 0.2 (I think - I'm not very good with tar and all that stuff Embarassed ). It swaps between free memory and the -%, so I assume that it's v0.2.

I also got the '-%' until I remembered to 'modprobe battery' and 'modprobe ac'.

The 'modprobe ac' is needed if you want the '-' sign to change to '+' when the laptop is running on ac power.

Hope that helps
Paul

_________________
Testing Puppy since v0.9.2 - my desktop OS since v1.0.7
Running SlaxerPup-4.12 - Puppy with a Slackware 12.2 heart Cool
Back to top
View user's profile Send private message 
Rickrandom

Joined: 21 Jan 2006
Posts: 195
Location: Bedfordshire, UK

PostPosted: Sat 04 Nov 2006, 11:20    Post subject:  

pakt,

Thanks for the suggestion, but modprobe battery and ac both seem ok (no errors) and there is no change to the -%, even if I restart JWM.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 2 of 6 [87 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Unsorted
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0791s ][ Queries: 13 (0.0047s) ][ GZIP on ]