Page 2 of 5 FirstFirst 1234 ... LastLast
Results 11 to 20 of 43

Thread: HOWTO: Extend the Life of Your Thinkpad's Battery (tp_smapi)

  1. #11
    Join Date
    Mar 2005
    Location
    Texas
    Beans
    1,675
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: HOWTO: Extend the Life of Your Thinkpad's Battery (tp_smapi)

    Yeah I intend to roll my own kernel here pretty soon, once I find the time. Pretty much everything works but its kind of a power hog ( around 17 watts). According to think wiki, someones gotten an 1871 T43 down to 10 watts. I think some kernel tweaking should bring that up, the standard feisty kernel doesn't seem to have any of the new power saving features. I still get ~2 hours of battery life out of it though, although I never drain it below 40% or so.

    Just did the sysfsutils thing, thanks!
    100 buckets of bits on the bus,
    100 buckets of bits,
    Take one down, short it to ground,
    FF buckets of bits on the bus.

  2. #12
    Join Date
    Oct 2007
    Location
    Germany
    Beans
    46

    Re: HOWTO: Extend the Life of Your Thinkpad's Battery (tp_smapi)

    Quote Originally Posted by mbsullivan View Post
    There are a number of ways to do it, such as the script that Whiffle created. As some of you are discovering, virtual file system devices don't tend to stay the way you set them, and scripts might not be the best way to keep them set (although making it an ACPI script will keep re-enabling it, so it's a start)!

    The way that I would recommend to do this is to use the sysfsutils, which are made for things handling sysfs devices, and thus will keep the battery set without any nastiness. To do so:

    (1) install sysfsutils, if they are not already installed
    Code:
    sudo aptitude install sysfsutils
    (2) add the appropriate lines to the end of /etc/sysfs.conf in the following format:

    Code:
    device=value
    For example, my sysfs.conf contains the following lines:

    Code:
    devices/platform/smapi/BAT0/start_charge_thresh=81
    devices/platform/smapi/BAT0/stop_charge_thresh=85
    Hope this helps!
    Mike
    Hi,
    i already did that. I was wondering more if i can address/program the BIOS/firmware directly, make the changes and the charge levels would still be remembered if the laptop is shut down and charging... but i guess that can't be done.
    Thanks,
    Alex

  3. #13
    Join Date
    Jul 2007
    Beans
    277

    Re: HOWTO: Extend the Life of Your Thinkpad's Battery (tp_smapi)

    I have lenovo 3000 n200 - which is nearly a thinkpad. Do you know if this will work for that?

  4. #14
    Join Date
    Jul 2007
    Location
    Austin, TX (formerly D.C)
    Beans
    359
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: Extend the Life of Your Thinkpad's Battery (tp_smapi)

    Hi,
    i already did that. I was wondering more if i can address/program the BIOS/firmware directly, make the changes and the charge levels would still be remembered if the laptop is shut down and charging... but i guess that can't be done.
    Thanks,
    Alex
    Yeah... it'll charge to 100% if you leave it plugged in whilst off. Nothing really can be done about that.

    I have lenovo 3000 n200 - which is nearly a thinkpad. Do you know if this will work for that?
    I'm honestly not sure... if you try it, keep us posted! Also, if you try it and get a "thinkpad_ec: no ThinkPad embedded controller!" error, try updating your BIOS.

    Mike

  5. #15
    Join Date
    Aug 2007
    Beans
    53
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HOWTO: Extend the Life of Your Thinkpad's Battery (tp_smapi)

    Hello all. I'm relatively new to Ubuntu, been using it on my desktop machine for the better part of a year, and am liking it. When the XP install on my T61 laptop went, I thought I'd tinker with Ubuntu on it. It's been good so far, except for being able to change my battery charging parameters. Anyway, I've been trying to install tp_smapi, but I've run into a bit of a stumbling block. I've followed the steps according to this thread, but when I try a make install for the tp_smapi code, it gives me a bunch of jibberish too long to post here.

    I think the problem may be that I don't have a proper symlink for build. For example, my output for symlinks for /lib/modules/2.6.22-14-generic is as follows:

    Code:
    dave@dave-laptop:~$ ls -l /lib/modules/2.6.22-14-generic
    total 1648
    lrwxrwxrwx  1 root root     28 2008-02-09 22:04 build -> /usr/src/linux-source-2.6.22
    drwxr-xr-x  2 root root   4096 2008-01-29 17:19 initrd
    drwxr-xr-x 10 root root   4096 2007-10-15 19:22 kernel
    drwxr-xr-x  2 root root   4096 2008-01-29 17:22 madwifi
    -rw-r--r--  1 root root 351274 2008-01-29 20:43 modules.alias
    -rw-r--r--  1 root root     69 2008-01-29 20:43 modules.ccwmap
    -rw-r--r--  1 root root 346289 2008-01-29 20:43 modules.dep
    -rw-r--r--  1 root root    813 2008-01-29 20:43 modules.ieee1394map
    -rw-r--r--  1 root root    527 2008-01-29 20:43 modules.inputmap
    -rw-r--r--  1 root root   2622 2008-01-29 20:43 modules.isapnpmap
    -rw-r--r--  1 root root     74 2008-01-29 20:43 modules.ofmap
    -rw-r--r--  1 root root 267548 2008-01-29 20:43 modules.pcimap
    -rw-r--r--  1 root root   1135 2008-01-29 20:43 modules.seriomap
    -rw-r--r--  1 root root 164049 2008-01-29 20:43 modules.symbols
    -rw-r--r--  1 root root 480020 2008-01-29 20:43 modules.usbmap
    drwxr-xr-x  2 root root   4096 2008-01-29 20:43 nvidia
    lrwxrwxrwx  1 root root     28 2008-02-09 22:04 source -> /usr/src/linux-source-2.6.22
    drwxr-xr-x 10 root root   4096 2007-10-15 19:22 ubuntu
    drwxr-xr-x  2 root root    220 2008-02-09 21:49 volatile
    I noticed that a symlink for source is there, but there isn't one for build. I then attempted to add one:

    Code:
    root@dave-laptop:~# uname -r
    2.6.22-14-generic
    root@dave-laptop:~# rm -i /lib/modules/2.6.22-14-generic/build
    rm: remove symbolic link `/lib/modules/2.6.22-14-generic/build'? y
    root@dave-laptop:~# ln -s /urs/src/linux-source-2.6.22 /lib/modules/2.6.22-14-generic/build
    root@dave-laptop:~#
    However, the symlinks for /lib/modules/2.6.22-14-generic still read as I posted above. So, my question ultimately is this: how do I add a symlink for build? I apologize if my post is a bit lengthy. Much of this is still a bit new to me, as this is about the deepest I've delved into the operating system, so to speak, so bear with me. Thank you in adavance.

    P.S. I'm using Gutsy
    Last edited by kernalsanders123; February 10th, 2008 at 04:37 AM.

  6. #16
    Join Date
    Aug 2007
    Beans
    53
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HOWTO: Extend the Life of Your Thinkpad's Battery (tp_smapi)

    Please disregard my previous post, updated my kernel, and it installed without a hitch!

  7. #17
    Join Date
    Mar 2008
    Location
    Germany
    Beans
    4
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: HOWTO: Extend the Life of Your Thinkpad's Battery (tp_smapi)

    I want to confirm that it works perfectly on my T60. If anyone, who comes later, has problem with install process can see my example below:

    1. Newest version of tp_smapi is 0.37:
    Code:
    wget http://easynews.dl.sourceforge.net/sourceforge/tpctl/tp_smapi-0.37.tgz ~/tp_smapi-0.37.tgz"]wget http://easynews.dl.sourceforge.net/sourceforge/tpctl/tp_smapi-0.37.tgz ~/tp_smapi-0.37.tgz
    Don't forget to extract this file
    2. Install build-essential
    Code:
    sudo aptitude install build-essential
    3. Check if you have linux-header on your computer
    Code:
    ls -lah /usr/src/linux-headers-2.6.22-14
    If you have something like this, OK, no need to install package linux-source-2.6.22 --> go to step 5
    Code:
    drwxr-xr-x 19 root root 4.0K 2008-03-02 13:46 .
    drwxrwsr-x  5 root src  4.0K 2008-04-10 12:50 ..
    drwxr-xr-x 28 root root 4.0K 2007-10-16 01:22 arch
    drwxr-xr-x  2 root root 4.0K 2008-03-02 13:46 block
    drwxr-xr-x  2 root root 4.0K 2008-03-02 13:46 crypto
    drwxr-xr-x  7 root root 4.0K 2007-10-16 01:22 Documentation
    drwxr-xr-x 66 root root 4.0K 2008-03-02 13:46 drivers
    drwxr-xr-x 62 root root 4.0K 2008-03-02 13:46 fs
    drwxr-xr-x 43 root root 4.0K 2008-03-02 13:46 include
    drwxr-xr-x  2 root root 4.0K 2008-03-02 13:46 init
    drwxr-xr-x  2 root root 4.0K 2008-03-02 13:46 ipc
    -rw-r--r--  1 root root 1.5K 2007-07-09 01:32 Kbuild
    drwxr-xr-x  5 root root 4.0K 2008-03-02 13:46 kernel
    drwxr-xr-x  5 root root 4.0K 2008-03-02 13:46 lib
    -rw-r--r--  1 root root  50K 2008-02-12 08:08 Makefile
    drwxr-xr-x  2 root root 4.0K 2008-03-02 13:46 mm
    drwxr-xr-x 41 root root 4.0K 2008-03-02 13:46 net
    drwxr-xr-x  9 root root 4.0K 2008-03-02 13:46 scripts
    drwxr-xr-x  4 root root 4.0K 2008-03-02 13:46 security
    drwxr-xr-x 18 root root 4.0K 2008-03-02 13:46 sound
    drwxr-xr-x  2 root root 4.0K 2008-03-02 13:46 usr
    4. Download & Extract linux-source-2.6.22
    Code:
    sudo aptitude install linux-source-2.6.22
    cd /usr/src
    sudo -s
    tar -xjf linux-source-2.6.22.tar.bz2
    You will have your linux-source at /usr/src/linux-source-2.6.22 --> go to step 6
    5. Install
    - Go to folder, where you extracted tp_smapi-0.37.tgz, for my example: ~/tp_smapi-0.37
    Code:
    sudo make install HDAPS=1 KSRC=/usr/src/linux-headers-2.6.22-14
    or without HDAPS:
    Code:
    sudo make install KSRC=/usr/src/linux-headers-2.6.22-14
    Install successfull --> go to step 7
    6. Install with downloaded /usr/src/linux-source-2.6.22
    - Go to folder, where you extracted tp_smapi-0.37.tgz, for my example: ~/tp_smapi-0.37
    Code:
    sudo make install HDAPS=1 KSRC=/usr/src/linux-source-2.6.22
    or without HDAPS:
    Code:
    sudo make install KSRC=/usr/src/linux-source-2.6.22
    Install successfull --> go to step 7
    7. Post-Configuration
    - tp_smapi auto loaded at startup
    Code:
    sudo -s
    echo "tp_smapi" >> /etc/modules
    - set start-, stopcharge value auto at startup
    Code:
    cd /etc/acpi
    gedit power.sh
    Here is my example for edited power.sh: add 2 new lines
    Code:
    #!/bin/bash
    
    . /etc/default/acpi-support
    . /usr/share/acpi-support/power-funcs
    
    echo 95 > /sys/devices/platform/smapi/BAT0/stop_charge_thresh
    echo 60 > /sys/devices/platform/smapi/BAT0/start_charge_thresh
    .....
    Save & Restart
    8. Check configuration
    After restart your computer, use this 2 commands to check if your configuration was executed correctly.
    Code:
    cat /sys/devices/platform/smapi/BAT0/start_charge_thresh
    cat /sys/devices/platform/smapi/BAT0/stop_charge_thresh
    Have fun !

    @tastatur
    -----------
    Reference: why do i use power.sh to set configuration at startup
    Check /etc/acpi/events/ac
    Code:
    # /etc/acpi/events/ac
    # Called when the user connects ac power to us
    # 
    
    event=ac_adapter
    action=/etc/acpi/power.sh
    You dont need to set start-, stopcharge when you use "only" battery right

  8. #18
    Join Date
    Aug 2005
    Beans
    7
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: HOWTO: Extend the Life of Your Thinkpad's Battery (tp_smapi)

    Quote Originally Posted by tastatur View Post

    Here is my example for edited power.sh: add 2 new lines
    Code:
    #!/bin/bash
    
    . /etc/default/acpi-support
    . /usr/share/acpi-support/power-funcs
    
    echo 95 > /sys/devices/platform/smapi/BAT0/stop_charge_thresh
    echo 60 > /sys/devices/platform/smapi/BAT0/start_charge_thresh
    .....
    Save & Restart
    8. Check configuration
    After restart your computer, use this 2 commands to check if your configuration was executed correctly.
    Code:
    cat /sys/devices/platform/smapi/BAT0/start_charge_thresh
    cat /sys/devices/platform/smapi/BAT0/stop_charge_thresh
    Hey, I'm using this at the moment.. but I get spammed with
    [17539.965688] smapi smapi: set_real_thresh: set stop to 95 for bat=0
    [17540.190538] smapi smapi: set_real_thresh: set start to 59 for bat=0
    in systemlog (dmesg entries)
    every 5 or so seconds..

    Is that a normal function? if not, how do I reduce the ammount of checks done.. oh, and the charging of my battery is superslow while powered up and being used, but I guess that's how it is (brand new laptop, never tested in windows, tp R61i) Recharging done when powered off is fast, however

    regards

  9. #19
    Join Date
    Jul 2007
    Location
    Austin, TX (formerly D.C)
    Beans
    359
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: Extend the Life of Your Thinkpad's Battery (tp_smapi)

    Hi Miga,

    Is that a normal function? if not, how do I reduce the ammount of checks done
    Instead of adjusting the power settings with power.sh as shown, try using the sysfsutils (mentioned in one of my entries before). I should add this to the original post... I apologize.

    The sysfsutils are made for things handling sysfs devices, and thus will keep the battery set without any nastiness (you'll see the message once in your log). To do so:

    (1) install sysfsutils, if they are not already installed

    Code:
    sudo aptitude install sysfsutils
    (2) add the appropriate lines to the end of /etc/sysfs.conf in the following format:

    Code:
    device=value
    For example, my sysfs.conf contains the following lines:

    Code:
    devices/platform/smapi/BAT0/start_charge_thresh=81
    devices/platform/smapi/BAT0/stop_charge_thresh=85
    Thus, you have no "echo" commands, and the spamming should stop.

    Let me know how it goes! Sorry for the slow response!
    Mike

  10. #20
    Join Date
    Sep 2007
    Beans
    75

    Re: HOWTO: Extend the Life of Your Thinkpad's Battery (tp_smapi)

    Thanks for the very useful post.

    I would just add that you might want to add

    echo 15 > /sys/devices/platform/smapi/BAT0/inhibit_charge_minutes

    in your power.sh file. This will prevent your laptop from charging if it's plugged in for just a few minutes.

Page 2 of 5 FirstFirst 1234 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •