thinkpads.com Support Community Forum Index Bill Morrow's thinkpads.com Open Forum - The Original Thinkpad Support Forum
Follow ThinkpadsForum on Twitter
eCoupons
Save hundreds direct from Lenovo Thinkpad
Exclusive 4% CASH BACK from eCoupons.com
Checkout the New thinkpads.com blog and web site
The NEW
thinkpads.com
website
Hard Drive Caddys - newmodeus.com
We also offer Drive Cloning solutions
Checkout the post here: http://forum.thinkpads.com/viewtopic.php?f=2&t=73945
Reflow
your T40
UK & EU
ThinkPad BIOS Recovery
ThinkPad BIOS Recovery
SALE Day - Everyday, all day! Deals & Rare Coupons
LogicBUY Coupons and Deals
It is currently Thu Sep 02, 2010 1:41 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: Linux, T61p, Ultrabay Battery Compatability
PostPosted: Fri Sep 05, 2008 5:21 pm 
Offline

Joined: Wed Feb 20, 2008 7:15 pm
Posts: 13
Location: Plano, TX
Hello,

How is the compatibility with the Ultrabay Battery on Linux? I'm running Ubuntu 8.04 x64 (2.6.24-19-generic) on a T61p (specs in sig). I've read some general things from thinkwiki, which says that the switchover from a dead main battery to a full ultrabay battery should be automatic, but I was hoping for some more specificity with my own setup. Also, are there any GUIs that can show the discharge level of each battery and other sort of stats like that? And how is the hotswapping compatibility?

Thanks

_________________
Gamera: Lenovo ThinkPad T61p 6459-CTO | Chipset: PM965 Crestline (South: ICH8-M) | CPU: Core 2 Duo T9300 2.50 GHz (Penryn) | HDD: Hitachi Travelstar 200GB 7200rpm SATA | GPU: NVIDIA Quadro FX 570M | RAM: 2x2GB G.SKILL DDR2-667 | Wi-Fi: Intel Wireless 4965AGN


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 05, 2008 7:20 pm 
Offline
Sophomore Member

Joined: Sat Jun 30, 2007 10:56 pm
Posts: 234
Location: L. A.
tp_smapi gives good control of the ultrabay battery assuming there is hardware support. I have an ugly one liner in this thread that will switch from the ultrabay to the main battery in this thread, if wanted: http://forum.thinkpads.com/viewtopic.php?t=64288

You can monitor your battery stats with a
Code:
cat /proc/acpi/battery/BAT{0,1}/*


If you want to spit this to a log file so you can watch it by, say, day, add this to your crontab:
Code:
(date; cat /proc/acpi/battery/BAT{0,1}/*) > ~/battery_state


For a GUI of battery status, all desktops (XFCE, Gnome, KDE, etc) have one. If you're looking for lean, you could do it with conky or xbattbar. All of these methods just parse proc/acpi/battery.

_________________
Have: x60s ultralight 1705-CTO, Debian SiD, Linux 2.6.25-2 | x61s ultralight 7668-CTO, Debian SiD/Experimental, Linux 2.6.27-git5 | Model M 1391401, white label, 07-17-91
Had: x22, Debian Testing/SiD, Linux 2.6.18-22


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 05, 2008 7:31 pm 
Offline

Joined: Wed Feb 20, 2008 7:15 pm
Posts: 13
Location: Plano, TX
Thanks for the info lightweight, but have there been any reports about specific compatibility between the T61p and Ultrabay battery?

Also, I see from your script that it echos to /sys/devices/platform/smapi/BAT0/force_discharge. I can't seem to find that directory, but if I modprobe -l, tp_smapi is loaded

Code:
user@GAMERA:~$ modprobe -l *smapi*
/lib/modules/2.6.24-19-generic/ubuntu/misc/tp_smapi.ko


Code:
user@GAMERA:~$ ls -a /sys/devices/platform/
.   bay.0  bluetooth  i8042     pcspkr  serial8250     thinkpad_hwmon
..  bay.1  dock.0     iTCO_wdt  power   thinkpad_acpi  uevent


Thanks.

_________________
Gamera: Lenovo ThinkPad T61p 6459-CTO | Chipset: PM965 Crestline (South: ICH8-M) | CPU: Core 2 Duo T9300 2.50 GHz (Penryn) | HDD: Hitachi Travelstar 200GB 7200rpm SATA | GPU: NVIDIA Quadro FX 570M | RAM: 2x2GB G.SKILL DDR2-667 | Wi-Fi: Intel Wireless 4965AGN


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 05, 2008 7:52 pm 
Offline
Sophomore Member

Joined: Sat Jun 30, 2007 10:56 pm
Posts: 234
Location: L. A.
Glad to help. Thinkwiki's based on submissions and I would hope their T61 entry is based on realy input: http://www.thinkwiki.org/wiki/Tp_smapi#T_series

What's in bay.0 and bay.1?

_________________
Have: x60s ultralight 1705-CTO, Debian SiD, Linux 2.6.25-2 | x61s ultralight 7668-CTO, Debian SiD/Experimental, Linux 2.6.27-git5 | Model M 1391401, white label, 07-17-91
Had: x22, Debian Testing/SiD, Linux 2.6.18-22


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 05, 2008 8:34 pm 
Offline

Joined: Wed Feb 20, 2008 7:15 pm
Posts: 13
Location: Plano, TX
lightweight wrote:
What's in bay.0 and bay.1?


Code:
user@GAMERA:~$ ls -a /sys/devices/platform/bay.*/*
/sys/devices/platform/bay.0/eject     /sys/devices/platform/bay.1/eject
/sys/devices/platform/bay.0/modalias  /sys/devices/platform/bay.1/modalias
/sys/devices/platform/bay.0/present   /sys/devices/platform/bay.1/present
/sys/devices/platform/bay.0/uevent    /sys/devices/platform/bay.1/uevent

/sys/devices/platform/bay.0/power:
.  ..  wakeup

/sys/devices/platform/bay.0/subsystem:
.  ..  devices  drivers  drivers_autoprobe  drivers_probe  uevent

/sys/devices/platform/bay.1/power:
.  ..  wakeup

/sys/devices/platform/bay.1/subsystem:
.  ..  devices  drivers  drivers_autoprobe  drivers_probe  uevent


I haven't bought the battery yet since I don't want to burn ~$120 on something that may turn into a brick.

Do you think that it would show up once I plug it in? But I would think that there would be entries for battery 0 (main battery)?

_________________
Gamera: Lenovo ThinkPad T61p 6459-CTO | Chipset: PM965 Crestline (South: ICH8-M) | CPU: Core 2 Duo T9300 2.50 GHz (Penryn) | HDD: Hitachi Travelstar 200GB 7200rpm SATA | GPU: NVIDIA Quadro FX 570M | RAM: 2x2GB G.SKILL DDR2-667 | Wi-Fi: Intel Wireless 4965AGN


Last edited by eateryofpiza on Sat Sep 06, 2008 12:09 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 05, 2008 10:25 pm 
Offline
ThinkPadder
ThinkPadder

Joined: Fri Jun 08, 2007 2:36 pm
Posts: 1059
My opinion is that it should work automatically, don't see how software support comes into play except for finer-grained control of the battery. You should be able see individual battery stats, have automatic switchover, etc. I have not tried this myself though, only on T4x (which works fine even without tp_smapi).


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 05, 2008 10:49 pm 
Offline

Joined: Wed Feb 20, 2008 7:15 pm
Posts: 13
Location: Plano, TX
hrmm... When I was reading the thread you linked to, it said that fully discharging the battery would lead to reduced battery life. I would like to avoid this, so do you know of another way for me to trigger the switchover manually?

_________________
Gamera: Lenovo ThinkPad T61p 6459-CTO | Chipset: PM965 Crestline (South: ICH8-M) | CPU: Core 2 Duo T9300 2.50 GHz (Penryn) | HDD: Hitachi Travelstar 200GB 7200rpm SATA | GPU: NVIDIA Quadro FX 570M | RAM: 2x2GB G.SKILL DDR2-667 | Wi-Fi: Intel Wireless 4965AGN


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 05, 2008 11:13 pm 
Offline
ThinkPadder
ThinkPadder

Joined: Fri Jun 08, 2007 2:36 pm
Posts: 1059
eateryofpiza wrote:
hrmm... When I was reading the thread you linked to, it said that fully discharging the battery would lead to reduced battery life. I would like to avoid this, so do you know of another way for me to trigger the switchover manually?


On my T40, which doesn't have the fine-grained battery control in hardware, the only way to keep it running the battery down to 0 before switching is to remove the battery.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 06, 2008 12:01 am 
Offline
Sophomore Member

Joined: Sat Jun 30, 2007 10:56 pm
Posts: 234
Location: L. A.
Check this out:
Code:
:~$ ls /sys/devices/platform
bay.0      dock.0  iTCO_wdt    pcspkr  serial8250  thinkpad_acpi   uevent
bluetooth  i8042   nsc-ircc.0  power   smapi       thinkpad_hwmon  vesafb.0
:~$ lsmod |grep api
tp_smapi               21296  0
thinkpad_ec             6960  1 tp_smapi
:~$ sudo modprobe -r tp_smapi
:~$ lsmod |grep api

:~$ ls /sys/devices/platform
bay.0      dock.0  iTCO_wdt    pcspkr  serial8250     thinkpad_hwmon  vesafb.0
bluetooth  i8042   nsc-ircc.0  power   thinkpad_acpi  uevent

So, unloading tp_smapi on my boxes removes /sys/devices/platform/smapi, which makes sense. Are you sure tp_smapi is loaded? (modprobe -l lists all modules, loaded or not.) If not, this should be as easy as a
Code:
sudo modprobe tp_smapi


You'll have a BAT0 and a BAT1 whether the batteries are in there or not -- empty devices will just be empty, like

(no ultrabay battery)
Code:
:~$ cat /sys/devices/platform/smapi/BAT1/power_now
cat: /sys/devices/platform/smapi/BAT1/power_now: No such device or address


Hope this helps.

_________________
Have: x60s ultralight 1705-CTO, Debian SiD, Linux 2.6.25-2 | x61s ultralight 7668-CTO, Debian SiD/Experimental, Linux 2.6.27-git5 | Model M 1391401, white label, 07-17-91
Had: x22, Debian Testing/SiD, Linux 2.6.18-22


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 06, 2008 2:23 pm 
Offline

Joined: Wed Feb 20, 2008 7:15 pm
Posts: 13
Location: Plano, TX
@lightweight:

Oh hey, that worked. I didn't know modprobe -l listed every package.

How do I ensure the module is loaded every time I boot?

Thanks a bunch.

_________________
Gamera: Lenovo ThinkPad T61p 6459-CTO | Chipset: PM965 Crestline (South: ICH8-M) | CPU: Core 2 Duo T9300 2.50 GHz (Penryn) | HDD: Hitachi Travelstar 200GB 7200rpm SATA | GPU: NVIDIA Quadro FX 570M | RAM: 2x2GB G.SKILL DDR2-667 | Wi-Fi: Intel Wireless 4965AGN


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 06, 2008 2:40 pm 
Offline
Sophomore Member

Joined: Sat Jun 30, 2007 10:56 pm
Posts: 234
Location: L. A.
I didn't know that about modprobe either, and was initially too lazy to go past a modprobe --help. I had to man it :)

Append /etc/modules (only writeable by root) with "tp_smapi". You can do this from a terminal with a
Code:
echo tp_smapi |sudo tee -a /etc/modules

_________________
Have: x60s ultralight 1705-CTO, Debian SiD, Linux 2.6.25-2 | x61s ultralight 7668-CTO, Debian SiD/Experimental, Linux 2.6.27-git5 | Model M 1391401, white label, 07-17-91
Had: x22, Debian Testing/SiD, Linux 2.6.18-22


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 07, 2008 10:21 pm 
Offline

Joined: Wed Feb 20, 2008 7:15 pm
Posts: 13
Location: Plano, TX
lightweight wrote:
I didn't know that about modprobe either, and was initially too lazy to go past a modprobe --help. I had to man it :)

Append /etc/modules (only writeable by root) with "tp_smapi". You can do this from a terminal with a
Code:
echo tp_smapi |sudo tee -a /etc/modules


Sweet thanks. I'm going to go get that battery now.

_________________
Gamera: Lenovo ThinkPad T61p 6459-CTO | Chipset: PM965 Crestline (South: ICH8-M) | CPU: Core 2 Duo T9300 2.50 GHz (Penryn) | HDD: Hitachi Travelstar 200GB 7200rpm SATA | GPU: NVIDIA Quadro FX 570M | RAM: 2x2GB G.SKILL DDR2-667 | Wi-Fi: Intel Wireless 4965AGN


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


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

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group