Linux, T61p, Ultrabay Battery Compatability

Solaris, RedHat, FreeBSD and the like
Post Reply
Message
Author
eateryofpiza
Posts: 13
Joined: Wed Feb 20, 2008 7:15 pm
Location: Plano, TX

Linux, T61p, Ultrabay Battery Compatability

#1 Post by eateryofpiza » Fri Sep 05, 2008 5:21 pm

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

lightweight
Sophomore Member
Posts: 234
Joined: Sat Jun 30, 2007 10:56 pm
Location: L. A.

#2 Post by lightweight » Fri Sep 05, 2008 7:20 pm

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: Select all

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: Select all

(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

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

#3 Post by eateryofpiza » Fri Sep 05, 2008 7:31 pm

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: Select all

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

Code: Select all

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

lightweight
Sophomore Member
Posts: 234
Joined: Sat Jun 30, 2007 10:56 pm
Location: L. A.

#4 Post by lightweight » Fri Sep 05, 2008 7:52 pm

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

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

#5 Post by eateryofpiza » Fri Sep 05, 2008 8:34 pm

lightweight wrote:What's in bay.0 and bay.1?

Code: Select all

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)?
Last edited by eateryofpiza on Sat Sep 06, 2008 12:09 am, edited 1 time in total.
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

aaa
ThinkPadder
ThinkPadder
Posts: 1062
Joined: Fri Jun 08, 2007 2:36 pm

#6 Post by aaa » Fri Sep 05, 2008 10:25 pm

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).

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

#7 Post by eateryofpiza » Fri Sep 05, 2008 10:49 pm

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

aaa
ThinkPadder
ThinkPadder
Posts: 1062
Joined: Fri Jun 08, 2007 2:36 pm

#8 Post by aaa » Fri Sep 05, 2008 11:13 pm

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.

lightweight
Sophomore Member
Posts: 234
Joined: Sat Jun 30, 2007 10:56 pm
Location: L. A.

#9 Post by lightweight » Sat Sep 06, 2008 12:01 am

Check this out:

Code: Select all

:~$ 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: Select all

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: Select all

:~$ 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

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

#10 Post by eateryofpiza » Sat Sep 06, 2008 2:23 pm

@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

lightweight
Sophomore Member
Posts: 234
Joined: Sat Jun 30, 2007 10:56 pm
Location: L. A.

#11 Post by lightweight » Sat Sep 06, 2008 2:40 pm

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: Select all

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

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

#12 Post by eateryofpiza » Sun Sep 07, 2008 10:21 pm

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: Select all

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

Post Reply
  • Similar Topics
    Replies
    Views
    Last post

Return to “Linux Questions”

Who is online

Users browsing this forum: axur-delmeria and 0 guests