Hibernation and Standby problems

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
AK Dave

Re: Hibernation and Standby problems

Post by AK Dave »

Wired or Wireless?

Show me the output of the following:

Code: Select all

lspci -vvnn && lsmod && lsusb
I predict that you're using ndiswrapper for a Windows wifi driver on your hardware. Or you have rtl8187 hardware. This is classic ndiswrapper wifi behavior for which there is no fix, but only a workaround, at this time. The workaround will be for you to go to Windows Wireless, unload your wifi driver, and then reload it. Like magic, wifi will return within seconds. Or modprobe -r && modprobe your rtl8187 module.

There are a couple of wifi kernel modules that are similarly problematic. Note that it is technically not the driver or kernel module that has the problem, but the wifi chipset or firmware itself. Specifically at fault: usb powered wifi. Wifi on the pci bus doesn't seem to do this nearly as often in my experience, but on the usb bus (example: rtl8187 hardware) likes to do this a lot.

I use the following "fixwifi.sh" script, set executable and linked to a launcher icon:

Code: Select all

#! /bin/bash
  sudo modprobe -r rtl8187 && sudo modprobe 8187
  exit
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
AK Dave

Re: Hibernation and Standby problems

Post by AK Dave »

Here we find everything we need to know: wrote:04:01.0 Ethernet controller [0200]: Atheros Communications Inc. Atheros AR5001X+ Wireless Network Adapter [168c:0013] (rev 01)
Subsystem: Atheros Communications Inc. Device [168c:2051]
[...]
Kernel driver in use: ath_pci
Kernel modules: ath_pci
Is this computer an Acer Aspire One? This is a common problem with this Atheros chipset, and the best how-to walkthrough to fix it relates to this card in an Acer Aspire One. Basic problem: the installer uses the ath_pci kernel module instead of the ath5k kernel module. Read on for the fix:

Wireless module (https://help.ubuntu.com/community/Aspir ... pire%20One)

There has been some confusion as to which wireless driver provides the best performance and reliability. I have found the following:
o madwifi from kernel (ath_pci) - does not attach to hardware.
o ath5k from intrepid backports (ath5k) - connects to hardware, but experiences disconnects on medium to heavy wireless activity, and can not communicate with some AP's using WPA2 PSK.
o madwifi-hal from http://snapshots.madwifi-project.org/ (ath_pci) - Everything works.

I recommend using the most recent snapshot of madwifi-hal from http://snapshots.madwifi-project.org/

Code: Select all

wget http://snapshots.madwifi-project.org/madwifi-hal-0.10.5.6-current.tar.gz
sudo apt-get install build-essential linux-headers-$(uname -r)
tar -xzf madwifi-hal-0.10.5.6-current.tar.gz
cd madwifi-hal-0.10.5.6*/
make
sudo make install
sudo modprobe ath_pci
You may have to append ath_pci to /etc/modules:

Code: Select all

# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.

fuse
lp
ath_pci
This driver should work under all conditions. I have tested the driver under heavy load (3MB/s sustained for 2 hours, no hangup), tested for correct suspend/resume functionality, and verified it communicates correctly with WEP, WPA, WPA2, against recent Linksys, Dlink, and Cisco hardware.

Now you should create a script to restart the interface on awake from suspend mode, as it will otherwise hang. As root, create /etc/pm/sleep.d/00wireless:

Code: Select all

#
# Restart WiFi interface after suspension
#

case "$1" in
        resume|thaw)
                /sbin/ifconfig wifi0 down
                /sbin/ifconfig wifi0 up
        ;;
        *)
        ;;
esac

exit $?
Don't forget to make it executable:

Code: Select all

sudo chmod u+x /etc/pm/sleep.d/00wireless
Wireless LEDs

* the wireless leds need an entry in /proc
* with wireless on/off works, but there is no notification in Gui

"To get your wireless led to blink for you based on traffic, put these lines at the end of /etc/sysctl.conf."

Code: Select all

dev.wifi0.ledpin=3
dev.wifi0.softled=1
Then either reboot or do sysctl -p

The led on the front will now do the association blink, as well as blink based on wireless traffic.

All thanks to here: https://help.ubuntu.com/community/AspireOne
AK Dave

Re: Hibernation and Standby problems

Post by AK Dave »

The heart of the fix, the most relevant part, is this chunk of code:

Code: Select all

wget http://snapshots.madwifi-project.org/madwifi-hal-0.10.5.6-current.tar.gz
sudo apt-get install build-essential linux-headers-$(uname -r)
tar -xzf madwifi-hal-0.10.5.6-current.tar.gz
cd madwifi-hal-0.10.5.6*/
make
sudo make install
sudo modprobe ath_pci
However, don't forget to do this first!

Code: Select all

sudo apt-get install build-essentials
If you read above, the heart of the fix is to 1) download and untar the source code for a kernel module from the madwifi project, b) compile said source to create an actual binary kernel module, and c) modprobe it into place (may also need to edit /etc/modules). Well, step (b) is guaran-freakin-teed to FAIL FAIL FAIL if you don't have build-essentials on your system. So lets make sure you have it.

kthxbai
AK Dave

Re: Hibernation and Standby problems

Post by AK Dave »

drop the 's' and try again:

Code: Select all

sudo apt-get install build-essential
nobitacu

Re: Hibernation and Standby problems

Post by nobitacu »

youdkelon wrote:Hey all, whenever I return from hibernation or standby, I can't seem to connect to the internet.

Anyone know how to fix it?

Thanks
Not sure if you've fixed this problem or not. However, I had the same problem on my laptop, only difference is, it's from coming out of Suspend, unless that's what you meant. Do make a backup copy of the file first before making changes, so in case it doesn't work, you can always replace the file again with the original backup, and it'll be as if nothing changed. Just save the file after you make the changes, then try it out. Let me know if this works for you or not.

Making Wireless work from Suspend.

In Root: Added the following to /usr/lib/pm-utils/sleep.d/10NetworkManager

case "$1" in
 hibernate|suspend)
  suspend_nm
  ;;
 thaw|resume)
  rmmod ath_pci
  modprobe ath_pci
  resume_nm
  ;;
 *) exit $NA
  ;;
esac
Locked

Return to “Beginner Questions”