Showing posts with label ACPI. Show all posts
Showing posts with label ACPI. Show all posts

10.3.09

Debian Lenny: new configuration of WLAN and ACPI

Hello everyone,

recently I have discovered two unpleasant issues:

1) my WLAN radio is always on (even if the interface it not up) - which is
bad for my battery;
2) my laptop started to do "double resume" - when waking up from sleep
mode, it starts very shortly, and then goes to sleep again. So, I have to
press FN+F4 or close and open the lid again in order to wake th laptop up.

So, I decided to resolve those two issues:

(1) WLAN
In order to switch the radio off, one should issue a command

echo 1 > /sys/bus/pci/drivers/ipw2200/*/rf_kill

This command must be issued after the ipw2200 module is loaded. In order to
avoid manual execution everytime I boot my laptop, I decided to create a
kind of "autostart" for this command. Following a hint of good people in
one forum, I did the following:
(1) created in /etc/init.d/ file named myAutostart_AG.sh
(2) put there command
#!/bin/sh

echo 1 > /sys/bus/pci/drivers/ipw2200/0000\:0b\:02.0/rf_kill

Please, notice the PCI address of the WLAN card in the command (instead of
"*" - somehow I couldn't use "*" in a script).
(3) created a link from /etc/init.d/myAutostart_AG.sh into
/etc/rcS.d/99myAutostart_AG.sh
(4) made all scripts executable

That's all. Now this command is executed everytime when my laptop boots.
More details for the procedure can be found in this post:

http://forums.debian.net/viewtopic.php?p=212925#212925

Additionally I created a file called ipw2200_options in the folder
/etc/modprobe.d. This file contains following options of the driver
options ipw2200 hwcrypto=0
options ipw2200 associate=0

hwcrypto helps to avoid problems with encryption of the channel (WPA/WEP)
and associate disables autoconnect to the first available network. When you
are on a battery, it saves you a lot of power.


(2) "Double resume"
The issue is described in this post very well:
http://forum.thinkpads.com/viewtopic.php?f=9&t=64884&start=0&hilit=X21%2C+resume

So, I tried the solution proposed by GomJabbbar. It didn't work - Debian
has no "suspend-s2ram" package. But short analysis of the /etc/acpi/events
folder delivered following results: I have (had) two events - "lid" and
"sleep", - which were processed by one single script sleep.sh AND several
events stating with "lm_" - like "lm_lid", "lm_ac_adapter" and others. Many
of those scripts where calling - via their corresponding event scripts -
the same programm /usr/sbin/laptop-mode with a parameter "auto". I asked
Google about those files. It looks like they were installed by
"laptop-mode" package. The first two events - "lid" and "sleep"- I created
manually in July 2007 (see my posts in this blog from that time). For me
the issue is caused by these custom scripts. I think, the following
happens: when I generate either "sleep" or "lid" event, first "sleep.sh"
event is fired. It puts my laptop to sleep - on old-fashioned manner. When
it wakes up, the event is processed second time by "lm_lid", which brings
the laptop into second sleep state.

The resolution for me is to rename my custom events "sleep" and "lid". In
this way I pass the precssing to the "laptop-mode" utility. I tested the
result briefly - it looks good, the laptop wakes up properly.

Cheers,
Andrey.

30.11.07

Bluetooth on T43p under Linux

Hello everybody.

As you could find out from my previous posts, I set up ACPI on my
Thinkpad T43p. Now I can suspend and hibernate my laptop. But
when the things were ready, I discovered that my Bluetooth didn't
work anymore (initially, I could enable it by clicking Fn+F5).
So, I added new item in my ToDo-list - "Configure BT..."


Finally, today I found some time to configure my Bluetooth. It
was easy! Really easy. I had to create two extremely small
scripts - one must process an event of pressing Fn+F5, another one
- called by the first one - must enable/disable the Bluetooth. I
took me approximately 10 minutes to set everything up. In my work
I used these resources:

http://www.jkraemer.net/2005/10/10/t42-ubuntu
http://foosel.org/linux/t43#acpi_scripts
http://www.thinkwiki.org/wiki/Installing_Ubuntu/Breezy_on_a_ThinkPad_T42#Using_Fn-F5_to_enable.2Fdisable_Bluetooth

The next thing I want to do is to create a script, which allows
to switch on/off both WLAN and BT using Fn+F5 (like it does on
Windows). WinXP uses rather ugly utility for it - user should
click in a small window, which of 2 devices must be
enabled/disabled. At the present I start my WLAN by calling my
own scripts from command line. And BT is now enabled by Fn+F5. I
want to combine them together..


Another hot topic for me is the usage of my Bluetooth cell phones
(S55 and - hopefully soon - arriving CX75) under Linux. Somehow
laptop and S55 see each other, but I cannot address the file
system of the cell phone, and I cannot send files from cell phone
to laptop...Does anyone have any ideas? I know it must be a kind
of OBEX-capable file browser. But which one?

Talk to you later,
Andrey

22.7.07

Debian Etch on T43p: setting up ACPI

Finally, today I had some time to set up the ACPI on my T43p. I used this page as main resource. All the hints and scripts listed there worked for me.

Next I want to try to write a script, which will process the Fn+F5 combination. At the present it switches Bluetooth only. I want to have it working like in WinXP - switch both WLAN and Bluetooth. I have to think, how I could implement it...