From owner-freebsd-current@FreeBSD.ORG Fri Jul 20 09:58:55 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39364106566B for ; Fri, 20 Jul 2012 09:58:55 +0000 (UTC) (envelope-from erichfreebsdlist@ovitrap.com) Received: from alogreentechnologies.com (alogreentechnologies.com [67.212.224.110]) by mx1.freebsd.org (Postfix) with ESMTP id DC55A8FC19 for ; Fri, 20 Jul 2012 09:58:54 +0000 (UTC) Received: from amd620.ovitrap.com ([49.128.188.2]) (authenticated bits=0) by alogreentechnologies.com (8.13.1/8.13.1) with ESMTP id q6K9wlBt020527; Fri, 20 Jul 2012 03:58:49 -0600 From: Erich Dollansky To: Matthias Apitz Date: Fri, 20 Jul 2012 17:01:09 +0700 User-Agent: KMail/1.13.7 (FreeBSD/8.3-STABLE; KDE/4.7.4; amd64; ; ) References: <201207201004.59451.erichfreebsdlist@ovitrap.com> <201207201545.23915.erichfreebsdlist@ovitrap.com> <20120720091356.GA31015@sh4-5.1blu.de> In-Reply-To: <20120720091356.GA31015@sh4-5.1blu.de> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-Id: <201207201701.10176.erichfreebsdlist@ovitrap.com> Cc: freebsd-current@freebsd.org, Lars Engels Subject: Re: Script to monitor battery status on X220 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2012 09:58:55 -0000 Hi, On Friday 20 July 2012 16:13:56 Matthias Apitz wrote: > El d=EDa Friday, July 20, 2012 a las 03:45:23PM +0700, Erich Dollansky es= cribi=F3: >=20 > > > ...=20 > > > Is it necessary to poll? Usually devd generates an event when the > > > battery status and/or percentage changes. Just read the events from > > > /var/run/devd.pipe. > > >=20 > > this is a good idea. I did not like this solution either but did not ge= t a better idea when I did it. >=20 > I wrote and used something similar for my netbook EeePC 900; it turned > out that the battery is not showing the remaining capacity in a linear this is also true on the X220. > way; the last 5% are 'consumed' in a few seconds, i.e. below 20% I > polled every 2 seconds; I did some tests until I ended at the 2%. There was always enough energy le= ft in the battery to restart the machine. I wonder anyway how they do it. I developed battery monitors a long time ag= o. As the voltage drop is not linear and the tolerances are very high. They= might calibrate each battery when it reaches certain levels. Erich