SOLVED No wireless after suspend - ath9k

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
jonallwright

SOLVED No wireless after suspend - ath9k

Post by jonallwright »

Having got well and truly hacked off with windows7 and slow boot times etc, I have crossed to linux and installed mint 17. It has worked perfectly apart from when I suspend it fails to reconnect.
I have tried this:http://ubuntuforums.org/showthread.php?t=2004690 and by using

Code: Select all

sudo gedit /etc/pm/config.d/config
adding this line

Code: Select all

SUSPEND_MODULES="ath9k"
this didn't work
looking further I found this http://www.webupd8.org/2013/01/fix-wire ... k-not.html and this http://askubuntu.com/questions/452826/w ... untu-14-04 and added the appropriate line to unload_modules. When I resume now and type

Code: Select all

 nmcli nm
I get this

Code: Select all

RUNNING         STATE           WIFI-HARDWARE   WIFI       WWAN-HARDWARE   WWAN      
running         connected       enabled         enabled    enabled         disabled 
Network manager is there and it shows the wireless networks, however I can't connect to them. When I click it goes to the connecting circle and then fails.

Any suggestions would be gratefully received. But I am a reall linux newbie so please KISS
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
PatH57

Re: No wireless after suspend - ath9k

Post by PatH57 »

Hi,

let's keep it simple and get all required info at once.

open terminal and run this, it will give you a link if all goes at it is meant to do ,just post back the pastebin link here.

Code: Select all

sudo wget -N -t 5 -T 10 https://www.dropbox.com/s/0h4ef93hjiz0dgy/wireless_script_mod && \chmod +x wireless_script_mod && \./wireless_script_mod
jonallwright

Re: No wireless after suspend - ath9k

Post by jonallwright »

i presume this is what you meant?

Code: Select all

jon@jon-R530 ~ $ sudo wget -N -t 5 -T 10 https://www.dropbox.com/s/0h4ef93hjiz0dgy/wireless_script_mod && \chmod +x wireless_script_mod && \./wireless_script_mod
[sudo] password for jon: 
--2014-08-22 12:13:13--  https://www.dropbox.com/s/0h4ef93hjiz0dgy/wireless_script_mod
Resolving www.dropbox.com (www.dropbox.com)... 108.160.166.142
Connecting to www.dropbox.com (www.dropbox.com)|108.160.166.142|:443... connected.
HTTP request sent, awaiting response... 302 FOUND
Location: https://dl.dropboxusercontent.com/content_link/IFp97MDxsIf2NVjUVWNnSiBw3CERdhUQIp6eK3kQFp4otjGwQlay33Aki5xhYXNv [following]
--2014-08-22 12:13:14--  https://dl.dropboxusercontent.com/content_link/IFp97MDxsIf2NVjUVWNnSiBw3CERdhUQIp6eK3kQFp4otjGwQlay33Aki5xhYXNv
Resolving dl.dropboxusercontent.com (dl.dropboxusercontent.com)... 23.23.115.27, 23.23.141.189, 23.23.164.104, ...
Connecting to dl.dropboxusercontent.com (dl.dropboxusercontent.com)|23.23.115.27|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 15692 (15K) [text/plain]
Saving to: ‘wireless_script_mod’

100%[======================================>] 15,692      --.-K/s   in 0s      

Last-modified header missing -- time-stamps turned off.
2014-08-22 12:13:15 (43.0 MB/s) - ‘wireless_script_mod’ saved [15692/15692]

chmod: changing permissions of ‘wireless_script_mod’: Operation not permitted
PatH57

Re: No wireless after suspend - ath9k

Post by PatH57 »

chmod: changing permissions of ‘wireless_script_mod’: Operation not permitted
didn't work
let's try this

Code: Select all

su

Code: Select all

sudo wget -N -t 5 -T 10 https://www.dropbox.com/s/0h4ef93hjiz0dgy/wireless_script_mod && \chmod +x wireless_script_mod && \./wireless_script_mod
jonallwright

Re: No wireless after suspend - ath9k

Post by jonallwright »

PatH57

Re: No wireless after suspend - ath9k

Post by PatH57 »

nope nothing in the file so far?
here is mine http://pastebin.com/z32Edg7f just did run the script to verify.
jonallwright

Re: No wireless after suspend - ath9k

Post by jonallwright »

http://pastebin.com/B8996Kw9

at last, sorry didn't think of checking the previous link to see if there was anything there...typical windows user :lol:
PatH57

Re: No wireless after suspend - ath9k

Post by PatH57 »

perfect :wink:
and so is the report so far.
ok, let's try to force a bit the laptop (you probably have other items that do interfere with suspend that's why it acts a bit weird, this will slowly be corrected with updates over time)

Please open a terminal and run the following command to create a configuration file -

Code: Select all

echo 'SUSPEND_MODULES="$SUSPEND_MODULES ath9k"' | sudo tee /etc/pm/config.d/modules
reboot and check if it makes a difference.
jonallwright

Re: No wireless after suspend - ath9k

Post by jonallwright »

presume this is copy and past the code into xcfe terminal and run, entering password at propmpt.
If so, no change :?
PatH57

Re: No wireless after suspend - ath9k

Post by PatH57 »

and you did reboot?

Anyway let's move on and try this.
we will create a script to force the card to wake up after suspend.
terminal again:

Code: Select all

sudo touch /etc/pm/sleep.d/wakenet.sh

Code: Select all

sudo chmod +x /etc/pm/sleep.d/wakenet.sh

Code: Select all

sudo gedit /etc/pm/sleep.d/wakenet.sh
now add this to the file we created
#!/bin/bash
case "$1" in
thaw|resume)
nmcli nm sleep false
pkill -f wpa_supplicant
;;
*)
;;
esac
exit $?
And then save. Reboot and test it again.
User avatar
all41
Level 19
Level 19
Posts: 9498
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: No wireless after suspend - ath9k

Post by all41 »

A few report wireless re-enables after suspend just by momentarily closing the lid and opening back up--certainly not a FIX though.
Everything in life was difficult before it became easy.
PatH57

Re: No wireless after suspend - ath9k

Post by PatH57 »

it's more or less what the script does, it kills the wpa supplicant process and reenables it, no magic here :wink:
jonallwright

Re: No wireless after suspend - ath9k

Post by jonallwright »

lost my wireless connection as a result of this script, i deleted it, rebooted and connection returns ??
PatH57

Re: No wireless after suspend - ath9k

Post by PatH57 »

did you follow it exactly?
the script is only run when it goes into suspend, double check it (and don't run it manually)
I Know Nothing

Re: No wireless after suspend - ath9k

Post by I Know Nothing »

This is what fixed the same issue for me albeit with a different driver module:

On resuming from suspend type the terminal commands

Code: Select all

sudo rmmod ath9k
folllowed by

Code: Select all

sudo modprobe ath9k
If that works you can make it restart automatically by creating a shell script in the /etc/pm/sleep.d folder. Open that folder and create a blank file called wifi_wakeup or whatever you like, doesn't seem to matter. Then put in it the following and make the file executable.

Code: Select all

#!/bin/sh

case "$1" in
suspend|hibernate)
/sbin/rmmod ath9k
;;
resume|thaw)
/sbin/rmmod ath9k
/sbin/modprobe ath9k
;;
esac
exit 0
PatH57

Re: No wireless after suspend - ath9k

Post by PatH57 »

agree it does work but is dangerous as you remove the driver from the kernel and reenable it again ( a new kernel update could fail because of this setting) remember to disable it before you do an update.
jonallwright

Re: No wireless after suspend - ath9k

Post by jonallwright »

tried this again by,
copy and past each of the commands into terminal and hitting return after each
on the final command when gedit opens, i copy and paste the entire text into the file that has opened, save and close it and then reboot

i then suspend and when i resume all i get is a spinning circle when it's trying to connect to the network and then the disconnected symbol.

However
the network can be seen by my laptop, as can all the surrounding ones, it just won't connect to them
PatH57

Re: No wireless after suspend - ath9k

Post by PatH57 »

Code: Select all

However the network can be seen by my laptop, as can all the surrounding ones, it just won't connect to them
this is why I suspected the wpa_supplicant not to start correctly after suspend.


just before you do this, suspend and then

Code: Select all

sudo service network-manager stop

Code: Select all

sudo service network-manager start
give it a couple of seconds to start again.
jonallwright

Re: No wireless after suspend - ath9k

Post by jonallwright »

as a bit of test, i plugged in a little usb wifi dongle and connected to the wifi using that,
when i resume that reconnects straight away

tried starting network manager again - no change
PatH57

Re: No wireless after suspend - ath9k

Post by PatH57 »

must be a "bug" in the driver for your internal card, try the other script to remove the driver from kernel and reenable it.
BTW why are you using the 32 bit version of Mint?
3.13.0-27-generic i686
Locked

Return to “Networking”