You are not logged in.

#1 2014-02-26 08:01:43

zRJ
Member
From: Lithuania, Utena
Registered: 2014-02-25
Posts: 3

Lenovo ThinkPad Edge 11 battery and wifi problems

Lenovo ThinkPad Edge 11, core i3 380UM, Intel HD Graphics, x86_64, i3wm

I was having problems with low battery after move to i3wm.
Udev rules to suspend at certain capacity levels almost never works for some reason.

acpi_listen gives these events for AC plug/unplug and battery events:

ac_adapter ACPI0003:00 00000080 00000000
battery PNP0C0A:00 00000080 00000001
ac_adapter ACPI0003:00 00000080 00000001
battery PNP0C0A:00 00000080 00000001

Yet in journalctl no logger messages for AC unplugged.
I very dislike running daemonized scripts event with big sleep values.
So only one solution I found to forcefully suspend was to edit /etc/acpi/handler.sh:
(added extra class for ac_adaptor (mine case ACPI*)) and parsing of battery events(mine PNP0C0A)

    ac_adapter)
        case "$2" in
            AC|ACAD|ADP0|ACPI*)
                case "$4" in
                    00000000)
                        logger 'AC unpluged'
                        ;;
                    00000001)
                        logger 'AC pluged'
                        ;;
                esac
                ;;
            *)
                logger "ACPI action undefined: $2"
                ;;
        esac
        ;;
    battery)
        case "$2" in
            BAT0)
                case "$4" in
                    00000000)
                        logger 'Battery online'
                        ;;
                    00000001)
                        logger 'Battery offline'
                        ;;
                esac
                ;;
            CPU0)
                ;;
#stuff on battery event, only if capacity bellow 5
            PNP*)
                 tttt=$(cat /sys/class/power_supply/BAT1/capacity)
                 if grep "1" /sys/class/power_supply/*/online
                 then
                    logger "debug: charging at $tttt"
                 else
                    if [[ $tttt -gt 4 ]]
                    then
                       logger "debug: suspend not needed at $tttt"
                    else
                       logger "debug: forcing suspend at $tttt"
                       sync
                       systemctl suspend
                    fi
                ;;
            *)  logger "ACPI action undefined: $2" ;;
        esac
        ;;

Is this correct and more generic way?

Also RTL8188CE 802.11b/g/n WiFi Adapter (rev 01).... sad
I am by that much | | from taking screwdriver and removing that card from netbook (mainly because of power hogging)
Can anyone recommend good arch compatible usb wireless adapter?
Great range, wicd compatible, plug and not pray preferably wink

Offline

#2 2014-02-27 10:18:32

zRJ
Member
From: Lithuania, Utena
Registered: 2014-02-25
Posts: 3

Re: Lenovo ThinkPad Edge 11 battery and wifi problems

Just minor fix for suspend on low battery script:
if [[ $tttt -gt 6 ]]
now much safer, since capacity level attribute might be updated with delay.
My battery gives acpi events at FULL, 80%, 20%, 5% and 0% capacities.

As wireless problem I think I found workaround:
simply override mtu value for wlan0 interface with wicd preconnect scripts for specific ESSIDs
To found maximal MTU I used this one:

ping -i0.5  -M do -s 1372 -f www.google.com

That value+28 and I have stable wireless connection finally, yay big_smile
Problem was with wimax based AP(that small pocket size)
It  uses 1500 MTU for lan, then 1472 for first hop and 1400 MTU for second one (it looks there is a hidden hop, ISP does something fishy wink).
Triple fragmentation was the cause for forced dissociation.

However I ran into problem when enabling pci power_save mode with this udev rule.

ACTION=="add", SUBSYSTEM=="pci", ATTR{power/control}="auto"

Even my internal LAN card ignores interrupts from programs... and stays in sleep mode....

This works perfectly well on my other Toshiba laptop, so I think there is a bug in udev or kernel itself for lenovo...

Offline

Board footer

Powered by FluxBB