Battery Monitoring Dotpup for JWM

Stuff that has yet to be sorted into a category.
Message
Author
setecio
Posts: 326
Joined: Wed 01 Nov 2006, 12:09
Location: UK

#61 Post by setecio »

Bookmarked.

setecio
Posts: 326
Joined: Wed 01 Nov 2006, 12:09
Location: UK

#62 Post by setecio »

I tried this on an IBM Thinkpad 560Z 128MB 300MHz pII, Puppy2.14, but it didn't work.
I installed the .pup and then click the batmonsetup.sh, which responds :

It looks like the modules for your battery are not installed. Yes to load at boot. No to load yourself. First of all I tried yes to load on boot, and rebooted but nothing. Then I tried batmonsetup.sh again and this time no to load yourself, asked me about Toshiba which I replied no and then restarted JVM. A -% appears, and if I hover mouse over it gives aasdf, but no indicator for the battery level.

Any advice?
I did read similar problems on page1 but as the pup has been updated since then I wasn't sure if it still applied or if you had fixed all previous bugs. Please give easy instructions to follow . Thanks.
(if I type in console ls /proc/acpi/battery it says: no such file or directory )

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#63 Post by HairyWill »

What do you get at the console if you do
modprobe battery
ls /proc/acpi
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

setecio
Posts: 326
Joined: Wed 01 Nov 2006, 12:09
Location: UK

#64 Post by setecio »

HairyWill wrote:What do you get at the console if you do
modprobe battery
ls /proc/acpi
sh-3.00# modprobe battery
FATAL: Error inserting battery (/lib/modules/2.6.18.1/kernel/drivers/acpi/battery.ko): No such device
sh-3.00# ls /proc/acpi
ls: /proc/acpi: No such file or directory
sh-3.00#


It is running on battery and has been for 30 minutes as I type this.

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#65 Post by HairyWill »

I don't think your model does ACPI though you may be able to monitor the battery using APM.
Have at a look at thinkwiki

http://www.thinkwiki.org/wiki/Category:560Z
http://www.thinkwiki.org/wiki/How_to_make_APM_work

I have no experience using APM and batmon doesn't monitor APM batteries. According to the second link you need to boot with the kernel parameter
acpi=off
and then install apmd though I know nothing about that
good luck
you might want to start a new topic asking about apm
please report back anything that you find
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

setecio
Posts: 326
Joined: Wed 01 Nov 2006, 12:09
Location: UK

#66 Post by setecio »

I dual boot with DSL Linux and DSL has a battery monitor built into the desktop, which works well, and accurately shows the % left (21% right now).

I notice that as DSL boots up, a line comes up:

Skipping APM Bios detecion as requested on boot command line.

Is this relevant ?

brad_chuck
Posts: 286
Joined: Tue 16 Aug 2005, 03:47
Location: Appalachian Mountains

#67 Post by brad_chuck »

All you have to do is figure out how to tell what your battery status is.

From there you can edit the batmon.sh script to use your battery.

Do some digging around and see if you can figure out how to tell. It should be in the form of xxxxxx mAh or something like that ( inside a file ie (cat filename) ). Look in the /proc/?????? dir.

Post questions if you get lost. I will try to monitor this thread for the next few days.

It would be great if you we could figure out how to use APM with batmon....

I don't have a clue as my system has ACPI.....

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#68 Post by HairyWill »

you could try using gkrellm
http://www.murga-linux.com/puppy/viewto ... 930&t=1588
This does have APM support.
If you edit the displayed data so that it only shows the battery I think it is possible to get it to swallow inside the jwm tray.
If gkrellm can't monitor your battery you might want to see if conky can, though it won't go in the tray it might give you some clues
http://www.murga-linux.com/puppy/viewto ... 92&t=16392
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

setecio
Posts: 326
Joined: Wed 01 Nov 2006, 12:09
Location: UK

#69 Post by setecio »

HairyWill wrote:you could try using gkrellm
http://www.murga-linux.com/puppy/viewto ... 930&t=1588
This does have APM support.
If you edit the displayed data so that it only shows the battery I think it is possible to get it to swallow inside the jwm tray.
If gkrellm can't monitor your battery you might want to see if conky can, though it won't go in the tray it might give you some clues
http://www.murga-linux.com/puppy/viewto ... 92&t=16392
Thanks, I've tried both of those, but I can't see anything for battery in either - I have looked for an option to display battery but can't see anything to tick. I thought if it didn't work it would still have something showing 'Battery' but just not registering, but I can't see anything refering to battery in either of the running packages. Any ideas ?

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#70 Post by HairyWill »

kernel parameters
acpi=off apm=on
after booting try
modprobe apm

I don't any more than that
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

brad_chuck
Posts: 286
Joined: Tue 16 Aug 2005, 03:47
Location: Appalachian Mountains

#71 Post by brad_chuck »

and if that works type

Code: Select all

apm
This should give you the output you are looking for.

You could try it before as well. It may work...

setecio
Posts: 326
Joined: Wed 01 Nov 2006, 12:09
Location: UK

#72 Post by setecio »

For any Puppy developers who want to know, the inbuilt DSL linux desktop system monitors show an accurate indication of my battery power remaining. It is a nicely designed inbuilt system monitor that sits in the very top left of the desktop and shows some useful info (in this case the battery has just been fully charged to 99%)

It is called Torsmo and here is the web page

http://torsmo.sourceforge.net/

If I knew how to I would develop it as a pup, but that is way beyond me.

Thanks all for the input but this is a bit beyond me so I'll just do without for now.

Image

User avatar
trapster
Posts: 2117
Joined: Mon 28 Nov 2005, 23:14
Location: Maine, USA
Contact:

#73 Post by trapster »

It's been around for a while now.

Check Here
trapster
Maine, USA

Asus eeepc 1005HA PU1X-BK
Frugal install: Slacko
Currently using full install: DebianDog

setecio
Posts: 326
Joined: Wed 01 Nov 2006, 12:09
Location: UK

#74 Post by setecio »

trapster wrote:It's been around for a while now.

Check Here
Excellent. That displays the battery level perfectly, along with the other info but blinked every 5 secs when it updated, so I changed the update to 2 mins as described here :

http://www.murga-linux.com/puppy/viewto ... 72&t=15400

. Thanks.

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#75 Post by HairyWill »

To satisfy my/our curiosity in exchange for the advice given.
Please can you type "apm" in a console and post the output here, maybe we could make batmon apm aware. Also it would be interesting to see what you get for "ls /proc/apm"

It is interesting that torsmo works when conky didn't as conky is a fork of the no longer developed torsmo. I presume one of the things they have changed is the APM support, unless this is controlled at compile time.
<edit>conky does support APM so I'm unsure why it didn't work in this case</edit>
Last edited by HairyWill on Fri 13 Apr 2007, 08:04, edited 1 time in total.
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

setecio
Posts: 326
Joined: Wed 01 Nov 2006, 12:09
Location: UK

#76 Post by setecio »

Certainly, I'll watch the post for a few days, so post if you want any more info / terminal results / details ...... (just give me beginner instructions.) I wasn't sure whether conky worked or not - I just couldn't see anything referring to 'battery' anywhere ? If it was hidden somewhere? One reading on conky, MPD, said MPD not responding, I'm not sure what that means ?

sh-3.00# apm
sh: apm: command not found
sh-3.00# ls /proc/apm
/proc/apm
sh-3.00#

How can I easily confirm if the laptop uses ACPI or APM ?

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#77 Post by HairyWill »

setecio wrote:One reading on conky, MPD, said MPD not responding, I'm not sure what that means ?[/qote]I think that stands for Music Player Daemon
http://www.musicpd.org/
this isn't included in vanilla puppy and I don't think I've ever seen a dotpup / pet for it
sh-3.00# ls /proc/apm
/proc/apm
sorry I think I meant

Code: Select all

cat /proc/apm
How can I easily confirm if the laptop uses ACPI or APM ?
As you have a file /proc/apm I think you can assume apm support. My laptop does acpi and has a directory in /proc called acpi with a whole load of files inside containing system info.
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

setecio
Posts: 326
Joined: Wed 01 Nov 2006, 12:09
Location: UK

#78 Post by setecio »

Battery is now low

sh-3.00# cat /proc/apm
1.16ac 1.2 0x03 0x00 0x02 0x04 3% 3 min
sh-3.00#

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#79 Post by HairyWill »

thanks for that

After I posted last a light bulb came on in my head.
Just because I have acpi it doesn't mean I have to use it.
I changed my kernel boot parameters to include
acpi=off apm=on
and bingo I'm now using apm. For test purposes only as acpi is much more powerful.
so on battery I get

Code: Select all

sh-3.00# cat /proc/apm 
1.16ac 1.2 0x03 0x00 0x00 0x01 55% 29 min
and on charge I get

Code: Select all

sh-3.00# cat /proc/apm                      
1.16ac 1.2 0x03 0x01 0x03 0x09 52% -1 ?
For the record I didn't need to modprobe apm the module was loaded automatically.
Last edited by HairyWill on Fri 13 Apr 2007, 01:32, edited 1 time in total.
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#80 Post by HairyWill »

To make batmon work for apm try replacing the contents of /root/my-applications/bin/batmon.sh with the following. Leaving Brads copyright intact of course.

Code: Select all

per=`awk '{print $7}' /proc/apm | awk -F % '{print $1}'`

if [ $per -lt "6" ]; then
        if [ "`cat /tmp/batmon.warn.txt | grep warned`" == "" ]; then
                Xdialog --msgbox "WARNING! Your battery is low." 0 0 &
                echo "warned" >> /tmp/batmon.warn.txt
        fi      
fi

if [ $per -gt "5" ]; then
        rm /tmp/batmon.warn.txt 2> /dev/null
fi

if [ `awk '{print $8}' /proc/apm` -gt 0 ]
then
        acon="-"
else
        acon="+"
fi

echo -n "${acon}${per}%"
To make a batmon that supports apm and acpi just requires a test for /proc/apm or /proc/acpi before deciding which code to use.
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

Post Reply