<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Battstat, Ubuntu, And You</title>
	<atom:link href="http://ttwhy.org/home/blog/2005/09/09/battstat-ubuntu-and-you/feed/" rel="self" type="application/rss+xml" />
	<link>http://ttwhy.org/home/blog/2005/09/09/battstat-ubuntu-and-you/</link>
	<description>from the seeds of gyrm</description>
	<lastBuildDate>Wed, 25 May 2011 12:10:54 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<item>
		<title>By: gyrmination &#187; Blog Archive &#187; KThinkBat, KDE, And You</title>
		<link>http://ttwhy.org/home/blog/2005/09/09/battstat-ubuntu-and-you/comment-page-1/#comment-28</link>
		<dc:creator>gyrmination &#187; Blog Archive &#187; KThinkBat, KDE, And You</dc:creator>
		<pubDate>Wed, 26 Apr 2006 19:10:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.ttwhy.org/home/blog/?p=99#comment-28</guid>
		<description>[...] I&#8217;ve worked using Arch Linux for a while without a battery monitor app, and finally decided to cure myself of this issue today. (I&#8217;ve dealt with this problem before.) [...]</description>
		<content:encoded><![CDATA[<p>[...] I&#8217;ve worked using Arch Linux for a while without a battery monitor app, and finally decided to cure myself of this issue today. (I&#8217;ve dealt with this problem before.) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Administrator</title>
		<link>http://ttwhy.org/home/blog/2005/09/09/battstat-ubuntu-and-you/comment-page-1/#comment-24</link>
		<dc:creator>Administrator</dc:creator>
		<pubDate>Mon, 17 Oct 2005 17:58:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.ttwhy.org/home/blog/?p=99#comment-24</guid>
		<description>Here&#039;s a record of my correspondence with EdPsych regarding trying to get battstat working on his Breezy system.

gyrm:

StonHaus was able to resolve his problem by going through the compilation steps with gnome-applets for gnome 2.12 (Breezy uses 2.12, Hoary uses 2.10). He shared his binary with me, and it&#039;s posted on the blog entry now. Why don&#039;t you give that a shot and let me know if it works?



EdPsych:

I unzipped StonHaus&#039;s file and added it to my /usr/lib/gnome-applets/ directory.  When I tried adding the applet to the panel, a menu came up saying &quot;The panel encountered a problem while loading &#039;OAFFID:GNOME_BattstatApplet&#039;&quot;.

I also noticed that, when I use your original file, the applet works correctly when the computer isn&#039;t running off the battery.  When the computer is running off battery, nothing appears on the panel.  Any other suggestions?



gyrm:

Did you by chance forget to rename the unzipped file from &quot;battstat-applet-2.12&quot; to &quot;battstat-applet-2&quot;? I didn&#039;t mention this directly aside from within the command line instructions following StonHaus&#039; update. Hmm, I think I&#039;ll change that just to avoid confusion.

If that doesn&#039;t work, could you send me the output of:


% cat /proc/acpi/battery/yourbatt/state


both on AC and off? I&#039;ll take a look.



EdPsych:

I made sure that I renamed the file, and I still got the error message that I referred to before (&quot;panel encountered a problem...&quot;).

Here is my battery state output; it seems like everything is being recognized on some level.

Thanks,
Ed


AC on:
ed@bernie:/proc/acpi/battery/CMB0$ cat state
present:                 yes
capacity state:          ok
charging state:          charging
present rate:            179 mW
remaining capacity:      3340 mWh
present voltage:         16756 mV

AC off:
ed@bernie:/proc/acpi/battery/CMB0$ cat state
present:                 yes
capacity state:          ok
charging state:          discharging
present rate:            179 mW
remaining capacity:      3340 mWh
present voltage:         16741 mV



gyrm:

It looks like ACPI is working. My guess would be that you are experiencing a problem with library linking ... this should be resolved by compiling battstat according to the steps given in the blog entry. In your case you will probably need to start out with the source for gnome-applets-2.12.1. Try this first:


% sudo apt-get source gnome-applets


That&#039;ll get you the zipped source archive. The patching and compilation steps should go smoothly if you follow the instructions from the blog entry.

&lt;a href=&quot;http://www.ttwhy.org/home/blog/2005/09/09/battstat-ubuntu-and-you/&quot; rel=&quot;nofollow&quot;&gt;http://www.ttwhy.org/home/blog/2005/09/09/battstat-ubuntu-and-you/&lt;/a&gt;

Let me know if you need more help, or if it works!!



EdPsych:

Thanks for all your help.  I got the source for gnome-applets-2.12.1 and compiled battstat over again, using your patch in the process.  Upon restarting the battstat applet, my battery is still not recognized (it always says I&#039;m on AC).

I know I&#039;m taking lots of your time and am close to giving up, but let me know if you have any other ideas.



gyrm:

Hmm ... not sure what&#039;s going on. Did you make sure to copy the new (patched) battstat-applet-2 file to /usr/lib/gnome-applets? There are no dumb questions when trying to debug this kind of problem ... :)

If that wasn&#039;t it ... at least we got past the loading step, so the problem you have now is different from the one before.

Can you go to /proc/acpi/ac_adapter and tell me what files / subdirectories you see, if any?

Afterwards, try this:

In the patched file acpi-linux.c, look for this section:



    /* If there are no AC adaptors registered in the system, then we&#039;re
       probably on a desktop (and therefore, on AC power).
    */
    if (have_adaptor == FALSE)
      acpiinfo-&gt;ac_online = 1;



and comment out the last two lines, like this:



    /* If there are no AC adaptors registered in the system, then we&#039;re
       probably on a desktop (and therefore, on AC power).
     */
    /* if (have_adaptor == FALSE)
         acpiinfo-&gt;ac_online = 1;
     */



then recompile the applet, and try it. Kind of a shot in the dark, let&#039;s see what happens.

That&#039;s all I can think of right now. Don&#039;t worry about my time ... it&#039;s no problem really!



EdPsych:

Yes, I copied the patched battstat-applet-2 file to the appropriate directory.  I also tried commenting the lines out of acpi-linux.c and recompiling, with no luck.  Even if I can&#039;t get this to work, I am at least learning alot.

I checked out my /proc/acpi/ac_adapter/ directory. There is a subdirectory called &quot;AC&quot;, which has a single file called &quot;state&quot;.  When the AC is plugged in, I get:


ed@bernie:/proc/acpi/ac_adapter/AC$ cat state
state:                   on-line

When the AC is not plugged in, I get:

ed@bernie:/proc/acpi/ac_adapter/AC$ cat state
state:                   off-line




gyrm:

I must admit I am stumped!

Questions: what does the battstat applet LOOK like now? Do you see a green bar at all? When you hover the mouse over the applet, what does the popup tooltip say? Unplug the computer and wait for a couple of minutes, then hover the mouse again. Anything change? Does changing the battstat Preferences reveal anything?

Just one more shot in the dark:



    /* Update AC info on battery info updates.  This works around
     * a bug in ACPI (as per bug #163013).
     */
    update_ac_info(acpiinfo);



Comment out that last line in acpi-linux.c, recompile, remove from panel, copy, add to panel. Same drill! Anything?



EdPsych:

The battstat applet just looks like an AC plug.  There is no green bar; when I switch to the expanded view, the battery meter looks completely drained (only a small amount of red at the right end), and there is an &quot;N/A&quot; when I select &quot;Show time/percentage&quot;.  Nothing changes when I unplug the AC: the icons look the same, and when I hover the mouse over them, it always says &quot;System is running on AC power, No battery present&quot;. I tried commenting out the other command in acpi-linux.c, and it didn&#039;t help.

I read the help file for the battery applet, and they make a distinction about using Hardware Abstraction Layer vs. using ACPI.  I checked, and I am using the Hardware Abstraction Layer.  I don&#039;t know enough to know whether this makes a difference, but it seems like my ACPI is working correctly.  What do you think?



gyrm:

Aha, I had no idea there were different backends to battstat. Just installed 5.10 on my desktop and was reading the battstat help. Did you try disabling HAL through the steps outlined in the help? It may cause the battery monitor to fall back on ACPI.

From the help:

&quot;Select Configuration Editor from the Applications menu, under System Tools. Search for the key value OAFIID:GNOME_BattstatApplet which should be located in the path /apps/panel/applets.

&quot;Assuming the path is /apps/panel/applets/applet_1. In /apps/panel/applets/applet_1/prefs add a New Key... called no_hal and set it to the boolean value of true. This will disable the usage of HAL (see Section 3.1: Determining the backend to learn how to check this).&quot;



EdPsych:

I did try disabling HAL like it said in the help file. This didn&#039;t work, though.  I&#039;m not sure that it actually disabled HAL, though, because there was always a star next to the guy&#039;s name in the battstat credits (which is supposed to signify that HAL is being used).

I have, however, had some success with getting the battery meter to work.  I found a HOWTO page that shows how to get a new DSDT and put it into your initrd (the web address is below).  After doing this, I got a battery icon but it didn&#039;t tell me how much charge I had left.  So I then patched the applet a la your website, and the battery applet actually reads my battery!

The new DSDT isn&#039;t perfect, though.  The boot time is noticeably slow, I get a &quot;hal couldn&#039;t be started&quot; error message after I log in, and I also get some errors about the applets after I log in.  I feel like hal is causing my problems, and I am wondering if there is a way to generally disable hal when booting with my old DSDT.  Any ideas?

Also, is the battstat icon supposed to change when you plug/unplug?  Although mine tells me the charge that is left, it doesn&#039;t seem to notice changes in the power source.

It&#039;s not perfect, but I&#039;m at least making progress...

that web address is:

&lt;a href=&quot;https://wiki.ubuntu.com/ACPIBattery&quot; rel=&quot;nofollow&quot;&gt;https://wiki.ubuntu.com/ACPIBattery&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Here&#8217;s a record of my correspondence with EdPsych regarding trying to get battstat working on his Breezy system.</p>
<p>gyrm:</p>
<p>StonHaus was able to resolve his problem by going through the compilation steps with gnome-applets for gnome 2.12 (Breezy uses 2.12, Hoary uses 2.10). He shared his binary with me, and it&#8217;s posted on the blog entry now. Why don&#8217;t you give that a shot and let me know if it works?</p>
<p>EdPsych:</p>
<p>I unzipped StonHaus&#8217;s file and added it to my /usr/lib/gnome-applets/ directory.  When I tried adding the applet to the panel, a menu came up saying &#8220;The panel encountered a problem while loading &#8216;OAFFID:GNOME_BattstatApplet&#8217;&#8221;.</p>
<p>I also noticed that, when I use your original file, the applet works correctly when the computer isn&#8217;t running off the battery.  When the computer is running off battery, nothing appears on the panel.  Any other suggestions?</p>
<p>gyrm:</p>
<p>Did you by chance forget to rename the unzipped file from &#8220;battstat-applet-2.12&#8243; to &#8220;battstat-applet-2&#8243;? I didn&#8217;t mention this directly aside from within the command line instructions following StonHaus&#8217; update. Hmm, I think I&#8217;ll change that just to avoid confusion.</p>
<p>If that doesn&#8217;t work, could you send me the output of:</p>
<p>% cat /proc/acpi/battery/yourbatt/state</p>
<p>both on AC and off? I&#8217;ll take a look.</p>
<p>EdPsych:</p>
<p>I made sure that I renamed the file, and I still got the error message that I referred to before (&#8220;panel encountered a problem&#8230;&#8221;).</p>
<p>Here is my battery state output; it seems like everything is being recognized on some level.</p>
<p>Thanks,<br />
Ed</p>
<p>AC on:<br />
ed@bernie:/proc/acpi/battery/CMB0$ cat state<br />
present:                 yes<br />
capacity state:          ok<br />
charging state:          charging<br />
present rate:            179 mW<br />
remaining capacity:      3340 mWh<br />
present voltage:         16756 mV</p>
<p>AC off:<br />
ed@bernie:/proc/acpi/battery/CMB0$ cat state<br />
present:                 yes<br />
capacity state:          ok<br />
charging state:          discharging<br />
present rate:            179 mW<br />
remaining capacity:      3340 mWh<br />
present voltage:         16741 mV</p>
<p>gyrm:</p>
<p>It looks like ACPI is working. My guess would be that you are experiencing a problem with library linking &#8230; this should be resolved by compiling battstat according to the steps given in the blog entry. In your case you will probably need to start out with the source for gnome-applets-2.12.1. Try this first:</p>
<p>% sudo apt-get source gnome-applets</p>
<p>That&#8217;ll get you the zipped source archive. The patching and compilation steps should go smoothly if you follow the instructions from the blog entry.</p>
<p><a href="http://www.ttwhy.org/home/blog/2005/09/09/battstat-ubuntu-and-you/" rel="nofollow">http://www.ttwhy.org/home/blog/2005/09/09/battstat-ubuntu-and-you/</a></p>
<p>Let me know if you need more help, or if it works!!</p>
<p>EdPsych:</p>
<p>Thanks for all your help.  I got the source for gnome-applets-2.12.1 and compiled battstat over again, using your patch in the process.  Upon restarting the battstat applet, my battery is still not recognized (it always says I&#8217;m on AC).</p>
<p>I know I&#8217;m taking lots of your time and am close to giving up, but let me know if you have any other ideas.</p>
<p>gyrm:</p>
<p>Hmm &#8230; not sure what&#8217;s going on. Did you make sure to copy the new (patched) battstat-applet-2 file to /usr/lib/gnome-applets? There are no dumb questions when trying to debug this kind of problem &#8230; <img src='http://ttwhy.org/home/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>If that wasn&#8217;t it &#8230; at least we got past the loading step, so the problem you have now is different from the one before.</p>
<p>Can you go to /proc/acpi/ac_adapter and tell me what files / subdirectories you see, if any?</p>
<p>Afterwards, try this:</p>
<p>In the patched file acpi-linux.c, look for this section:</p>
<p>    /* If there are no AC adaptors registered in the system, then we&#8217;re<br />
       probably on a desktop (and therefore, on AC power).<br />
    */<br />
    if (have_adaptor == FALSE)<br />
      acpiinfo-&gt;ac_online = 1;</p>
<p>and comment out the last two lines, like this:</p>
<p>    /* If there are no AC adaptors registered in the system, then we&#8217;re<br />
       probably on a desktop (and therefore, on AC power).<br />
     */<br />
    /* if (have_adaptor == FALSE)<br />
         acpiinfo-&gt;ac_online = 1;<br />
     */</p>
<p>then recompile the applet, and try it. Kind of a shot in the dark, let&#8217;s see what happens.</p>
<p>That&#8217;s all I can think of right now. Don&#8217;t worry about my time &#8230; it&#8217;s no problem really!</p>
<p>EdPsych:</p>
<p>Yes, I copied the patched battstat-applet-2 file to the appropriate directory.  I also tried commenting the lines out of acpi-linux.c and recompiling, with no luck.  Even if I can&#8217;t get this to work, I am at least learning alot.</p>
<p>I checked out my /proc/acpi/ac_adapter/ directory. There is a subdirectory called &#8220;AC&#8221;, which has a single file called &#8220;state&#8221;.  When the AC is plugged in, I get:</p>
<p>ed@bernie:/proc/acpi/ac_adapter/AC$ cat state<br />
state:                   on-line</p>
<p>When the AC is not plugged in, I get:</p>
<p>ed@bernie:/proc/acpi/ac_adapter/AC$ cat state<br />
state:                   off-line</p>
<p>gyrm:</p>
<p>I must admit I am stumped!</p>
<p>Questions: what does the battstat applet LOOK like now? Do you see a green bar at all? When you hover the mouse over the applet, what does the popup tooltip say? Unplug the computer and wait for a couple of minutes, then hover the mouse again. Anything change? Does changing the battstat Preferences reveal anything?</p>
<p>Just one more shot in the dark:</p>
<p>    /* Update AC info on battery info updates.  This works around<br />
     * a bug in ACPI (as per bug #163013).<br />
     */<br />
    update_ac_info(acpiinfo);</p>
<p>Comment out that last line in acpi-linux.c, recompile, remove from panel, copy, add to panel. Same drill! Anything?</p>
<p>EdPsych:</p>
<p>The battstat applet just looks like an AC plug.  There is no green bar; when I switch to the expanded view, the battery meter looks completely drained (only a small amount of red at the right end), and there is an &#8220;N/A&#8221; when I select &#8220;Show time/percentage&#8221;.  Nothing changes when I unplug the AC: the icons look the same, and when I hover the mouse over them, it always says &#8220;System is running on AC power, No battery present&#8221;. I tried commenting out the other command in acpi-linux.c, and it didn&#8217;t help.</p>
<p>I read the help file for the battery applet, and they make a distinction about using Hardware Abstraction Layer vs. using ACPI.  I checked, and I am using the Hardware Abstraction Layer.  I don&#8217;t know enough to know whether this makes a difference, but it seems like my ACPI is working correctly.  What do you think?</p>
<p>gyrm:</p>
<p>Aha, I had no idea there were different backends to battstat. Just installed 5.10 on my desktop and was reading the battstat help. Did you try disabling HAL through the steps outlined in the help? It may cause the battery monitor to fall back on ACPI.</p>
<p>From the help:</p>
<p>&#8220;Select Configuration Editor from the Applications menu, under System Tools. Search for the key value OAFIID:GNOME_BattstatApplet which should be located in the path /apps/panel/applets.</p>
<p>&#8220;Assuming the path is /apps/panel/applets/applet_1. In /apps/panel/applets/applet_1/prefs add a New Key&#8230; called no_hal and set it to the boolean value of true. This will disable the usage of HAL (see Section 3.1: Determining the backend to learn how to check this).&#8221;</p>
<p>EdPsych:</p>
<p>I did try disabling HAL like it said in the help file. This didn&#8217;t work, though.  I&#8217;m not sure that it actually disabled HAL, though, because there was always a star next to the guy&#8217;s name in the battstat credits (which is supposed to signify that HAL is being used).</p>
<p>I have, however, had some success with getting the battery meter to work.  I found a HOWTO page that shows how to get a new DSDT and put it into your initrd (the web address is below).  After doing this, I got a battery icon but it didn&#8217;t tell me how much charge I had left.  So I then patched the applet a la your website, and the battery applet actually reads my battery!</p>
<p>The new DSDT isn&#8217;t perfect, though.  The boot time is noticeably slow, I get a &#8220;hal couldn&#8217;t be started&#8221; error message after I log in, and I also get some errors about the applets after I log in.  I feel like hal is causing my problems, and I am wondering if there is a way to generally disable hal when booting with my old DSDT.  Any ideas?</p>
<p>Also, is the battstat icon supposed to change when you plug/unplug?  Although mine tells me the charge that is left, it doesn&#8217;t seem to notice changes in the power source.</p>
<p>It&#8217;s not perfect, but I&#8217;m at least making progress&#8230;</p>
<p>that web address is:</p>
<p><a href="https://wiki.ubuntu.com/ACPIBattery" rel="nofollow">https://wiki.ubuntu.com/ACPIBattery</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dakira</title>
		<link>http://ttwhy.org/home/blog/2005/09/09/battstat-ubuntu-and-you/comment-page-1/#comment-23</link>
		<dc:creator>dakira</dc:creator>
		<pubDate>Mon, 17 Oct 2005 15:08:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.ttwhy.org/home/blog/?p=99#comment-23</guid>
		<description>okay.. i was a little too fast. It doesn&#039;t work ;( Worked perfectly for me (and all people I know) in Hoary. Maybe somethings wrong with Breezys ACPI?!</description>
		<content:encoded><![CDATA[<p>okay.. i was a little too fast. It doesn&#8217;t work ;( Worked perfectly for me (and all people I know) in Hoary. Maybe somethings wrong with Breezys ACPI?!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dakira</title>
		<link>http://ttwhy.org/home/blog/2005/09/09/battstat-ubuntu-and-you/comment-page-1/#comment-22</link>
		<dc:creator>dakira</dc:creator>
		<pubDate>Mon, 17 Oct 2005 14:47:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.ttwhy.org/home/blog/?p=99#comment-22</guid>
		<description>THANK you!! I was really pissed that battstat didn&#039;t work anymore after I updated to Breezy. Now it at least recognized when I pull the plug. I&#039;m not sure, yet, if the battery state will be shown correctly. I guess I&#039;ll have to reload my battery completely and it should work again. So thanks!

Btw: Your problem at first just sounded as if you have a messed up DSDT which can (and should) be easily fixed.</description>
		<content:encoded><![CDATA[<p>THANK you!! I was really pissed that battstat didn&#8217;t work anymore after I updated to Breezy. Now it at least recognized when I pull the plug. I&#8217;m not sure, yet, if the battery state will be shown correctly. I guess I&#8217;ll have to reload my battery completely and it should work again. So thanks!</p>
<p>Btw: Your problem at first just sounded as if you have a messed up DSDT which can (and should) be easily fixed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Administrator</title>
		<link>http://ttwhy.org/home/blog/2005/09/09/battstat-ubuntu-and-you/comment-page-1/#comment-21</link>
		<dc:creator>Administrator</dc:creator>
		<pubDate>Mon, 10 Oct 2005 05:58:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.ttwhy.org/home/blog/?p=99#comment-21</guid>
		<description>Hi ANthonyS,

Great to hear that it works!</description>
		<content:encoded><![CDATA[<p>Hi ANthonyS,</p>
<p>Great to hear that it works!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

