Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 May 2005 16:11:03 -0400
From:      Martin Cracauer <cracauer@cons.org>
To:        Kevin Oberman <oberman@es.net>
Cc:        freebsd-acpi@freebsd.org
Subject:   Thinkpad R40 secondary battery swap (was: Porting code from the Linux ibm-acpi sourceforge package)
Message-ID:  <20050510161103.A63566@cons.org>
In-Reply-To: <20050510185251.9E2A15D09@ptavv.es.net>; from oberman@es.net on Tue, May 10, 2005 at 11:52:51AM -0700
References:  <20050510141405.A61946@cons.org> <20050510185251.9E2A15D09@ptavv.es.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Kevin Oberman wrote on Tue, May 10, 2005 at 11:52:51AM -0700: 
> > Date: Tue, 10 May 2005 14:14:05 -0400
> > From: Martin Cracauer <cracauer@cons.org>
> > 
> > > FreeBSD ATA has supported bus detach since ATAng (whenever that was). I
> > > have had no problem detaching ATA bus 1 and removing the drive (CD or
> > > HD) in the bay and replacing it with another or with a battery. Of
> > > course, it MUST be dismounted before the detach or a panic is to be
> > > expected.
> > > 
> > > Also, if you use a second battery, you must have it in the system at
> > > boot time or it won't be seen, used, or even charged. If you boot with
> > > the battery, you can:
> > > atacontrol detach 1
> > > remove the battery
> > > insert a disk drive
> > > atacontrol attach 1
> > > use the disk and dismount it.
> > > atacontrol detach 1
> > > remove the disk
> > > insert the battery
> > > Battery will be seen and used
> > 
> > Thank you!
> > 
> > This works from a detchament/attachment standpoint.
> > 
> > However, after booting with the secondary battery, the battery is seen
> > and it says "charging", but the charge never goes above 0% (output of
> > apm(1), not sure how to see than in ACPI).
> > 
> > Any clues?
> 
> Is the primary battery fully charged? The secondary battery  won't start
> charging unless the primary is at 100%.

The primary hovers between 98% and 100%.  When it is at < 100% the
secondary is reported as not charging, right now the primary is at
100% and the report for the secondary changed to "charging".  However,
"remaining battery life" for the secondary never goes above 0%.  But
see below.

> If you are running ACPI, the apm is just a shim on ACPI and the data
> seen from the apm command is really from ACPI. or a direct ACPI view,
> use "acpiconf -i 1". It will probably tell you a LOT more than you
> wanted to know and several important things APM would not tell you.

Ah.  Actually it looks like apm(1)s translation of acpi output is
broken.  acpiconf -i 1 reports a remaining capacity > 0 and it is
raising.  See below for cut'n'paste.

I think I'm all set except for a bug in apm(1).

Thanks so much for your help.  Seems I can use the secondary battery
with no problems and even swap in and out freely.  BTW, is it safe to
remove the primary battery when running and A.C. is plugged in? I
assume not.


Here is the output:

APM version: 1.2
APM Management: Disabled
AC Line status: on-line
Battery Status: charging
Remaining battery life: 98%
Remaining battery time: unknown
Number of batteries: 2
Battery 0:
	Battery Status: high
	Remaining battery life: 100%
	Remaining battery time:  0:00:00
Battery 1:
	Battery Status: charging
	Remaining battery life: 0%
	Remaining battery time:  0:00:00


Battery 1 information
Design capacity:	38880 mWh
Last full capacity:	40000 mWh
Technology:		secondary (rechargeable)
Design voltage:		10800 mV
Capacity (warn):	2000 mWh
Capacity (low):		200 mWh
Low/warn granularity:	1 mWh
Warn/full granularity:	1 mWh
Model number:		IBM-02K6817
Serial number:		  208
Type:			LION
OEM info:		SANYO
State:			Charging
Present Rate:		1988 mWh
Remaining Capacity:	38620 mWh
Volt:			12587 mV

Martin
-- 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Martin Cracauer <cracauer@cons.org>   http://www.cons.org/cracauer/
 No warranty.    This email is probably produced by one of my cats 
 stepping on the keys. No, I don't have an infinite number of cats.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050510161103.A63566>