[SOLVED] can't connect to w-fi after resume from suspend, need to logout & login again

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.
Locked
hughparker1
Level 2
Level 2
Posts: 87
Joined: Wed Oct 01, 2014 4:18 pm

[SOLVED] can't connect to w-fi after resume from suspend, need to logout & login again

Post by hughparker1 »

Linux Mint 18 Mate 16.04
DELL Inspiron 5559
Processor Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz, 2592 Mhz, 1 Core(s), 2 Logical Processor(s)
Integrated Graphics Processor: Intel(R) HD Graphics 520
Discrete Graphics Processor: AMD Radeon R5 M335

I don't have any problem connecting to wi-fi on startup but can't connect to w-fi after resume from suspend, need to logout & login again.
EDIT: I have just noticed that although the wi-fi icon in the indicator panel does show the 'disconnect' symbol and when I left click, there are no wi-f networks listed. But the wi-fi is actually working. It just looks like it's disconnected which is a bit misleading.

here is details of my wireless card....

Code: Select all

hugh@DELL-INSP-MINT ~ $ lspci -nnk | grep -A2 0280
02:00.0 Network controller [0280]: Intel Corporation Wireless 3160 [8086:08b3] (rev 83)
	Subsystem: Intel Corporation Dual Band Wireless AC 3160 [8086:8470]
	Kernel driver in use: iwlwifi
hugh@DELL-INSP-MINT ~ $

I found this solution https://ubuntuforums.org/showthread.php?t=2004690

It suggests....

Code: Select all

$ sudo gedit /etc/pm/config.d/config
Add one line:

Code: Select all

SUSPEND_MODULES="iwlwifi"
....but it is from 2012 so not sure if it is appropriate for my situation, I am not an expert on linux, so would appreciate any advice and guidance.
EDIT 2: I tried this but didn't make any difference.

EDIT 3:

Found another hit which is quite recent.... https://bugs.launchpad.net/ubuntu/+sour ... ug/1590985

openfred (openfred) wrote on 2016-07-26:
Just add a file for iwlwifi options in /etc/modprobe.d (1 line) - filename can be anything:

Code: Select all

$ cat /etc/modprobe.d/fred.conf

options iwlwifi 11n_disable=1
Reboot after adding this file !

I prefer not to modify /etc/modprobe.d/iwlwifi.conf, as this file is owned by package kmod, and can be modified at anytime.

I tried many times, wifi connection is restored in a 1 second. wifi connection seems much stable.

Tried on Ubuntu Gnome 16.04 and Mint 18.

EDIT 4
I tried the above fix but it didn't make any difference, is the syntax correct? options iwlwifi 11n_disable=1

EDIT 5
I removed the .conf file and reverted to original state and tested resume from suspend again to check the problem still exists. But I have just noticed that although the wi-fi icon in the indicator panel does show the 'disconnect' symbol and when I left click, there are no wi-f networks listed. But the wi-fi is actually working. It just looks like it's disconnected which is a bit misleading. Is there anything I can do to fix this? It's not such a big issue now that the wi-fi is actually working even though it just looks disconnected with no available wireless networks listed.
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.
JeremyB
Level 21
Level 21
Posts: 13881
Joined: Fri Feb 21, 2014 8:17 am

Re: can't connect to w-fi after resume from suspend, need to logout & login again

Post by JeremyB »

This might be part of a network manager bug, please post the result of

Code: Select all

nmcli -f all device show | sed '/^GENERAL.DEVICE:[ ]\+lo$/,/^$/d; /^AP\[[0-9]\+\]\./d'
after a resume from suspend
hughparker1
Level 2
Level 2
Posts: 87
Joined: Wed Oct 01, 2014 4:18 pm

Re: can't connect to w-fi after resume from suspend, need to logout & login again

Post by hughparker1 »

JeremyB wrote:This might be part of a network manager bug, please post the result of

Code: Select all

nmcli -f all device show | sed '/^GENERAL.DEVICE:[ ]\+lo$/,/^$/d; /^AP\[[0-9]\+\]\./d'
after a resume from suspend
Thanks for your reply, here is the result after resume from suspend....

Code: Select all

hugh@DELL-INSP-MINT ~ $ nmcli -f all device show | sed '/^GENERAL.DEVICE:[ ]\+lo$/,/^$/d; /^AP\[[0-9]\+\]\./d'
GENERAL.DEVICE:                         wlp2s0
GENERAL.TYPE:                           wifi
GENERAL.NM-TYPE:                        NMDeviceWifi
GENERAL.VENDOR:                         Intel Corporation
GENERAL.PRODUCT:                        Wireless 3160 (Dual Band Wireless AC 3160)
GENERAL.DRIVER:                         iwlwifi
GENERAL.DRIVER-VERSION:                 4.4.0-31-generic
GENERAL.FIRMWARE-VERSION:               16.242414.0
GENERAL.HWADDR:                         2C:6E:85:27:E0:F7
GENERAL.MTU:                            0
GENERAL.STATE:                          100 (connected)
GENERAL.REASON:                         0 (No reason given)
GENERAL.UDI:                            /sys/devices/pci0000:00/0000:00:1c.4/0000:02:00.0/net/wlp2s0
GENERAL.IP-IFACE:                       wlp2s0
GENERAL.IS-SOFTWARE:                    no
GENERAL.NM-MANAGED:                     yes
GENERAL.AUTOCONNECT:                    yes
GENERAL.FIRMWARE-MISSING:               no
GENERAL.NM-PLUGIN-MISSING:              no
GENERAL.PHYS-PORT-ID:                   --
GENERAL.CONNECTION:                     TALKTALKA661B5 1
GENERAL.CON-UUID:                       fd751767-57b1-4e2b-aa0a-4e5df0c93a0e
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveConnection/1
GENERAL.METERED:                        no (guessed)
CAPABILITIES.CARRIER-DETECT:            no
CAPABILITIES.SPEED:                     117 Mb/s
CAPABILITIES.IS-SOFTWARE:               no
WIFI-PROPERTIES.WEP:                    yes
WIFI-PROPERTIES.WPA:                    yes
WIFI-PROPERTIES.WPA2:                   yes
WIFI-PROPERTIES.TKIP:                   yes
WIFI-PROPERTIES.CCMP:                   yes
WIFI-PROPERTIES.AP:                     yes
WIFI-PROPERTIES.ADHOC:                  yes
WIFI-PROPERTIES.2GHZ:                   yes
WIFI-PROPERTIES.5GHZ:                   yes
CONNECTIONS.AVAILABLE-CONNECTION-PATHS: /org/freedesktop/NetworkManager/Settings/{1}
CONNECTIONS.AVAILABLE-CONNECTIONS[1]:   fd751767-57b1-4e2b-aa0a-4e5df0c93a0e | TALKTALKA661B5 1
IP4.ADDRESS[1]:                         192.168.1.37/24
IP4.GATEWAY:                            192.168.1.1
IP4.ROUTE[1]:                           dst = 169.254.0.0/16, nh = 0.0.0.0, mt = 1000
IP4.DNS[1]:                             192.168.1.1
IP4.DOMAIN[1]:                          lan
DHCP4.OPTION[1]:                        requested_ms_classless_static_routes = 1
DHCP4.OPTION[2]:                        requested_domain_search = 1
DHCP4.OPTION[3]:                        requested_host_name = 1
DHCP4.OPTION[4]:                        requested_time_offset = 1
DHCP4.OPTION[5]:                        requested_domain_name = 1
DHCP4.OPTION[6]:                        requested_rfc3442_classless_static_routes = 1
DHCP4.OPTION[7]:                        requested_broadcast_address = 1
DHCP4.OPTION[8]:                        requested_wpad = 1
DHCP4.OPTION[9]:                        requested_netbios_scope = 1
DHCP4.OPTION[10]:                       next_server = 0.0.0.0
DHCP4.OPTION[11]:                       expiry = 1470429868
DHCP4.OPTION[12]:                       requested_interface_mtu = 1
DHCP4.OPTION[13]:                       requested_subnet_mask = 1
DHCP4.OPTION[14]:                       routers = 192.168.1.1
DHCP4.OPTION[15]:                       dhcp_message_type = 5
DHCP4.OPTION[16]:                       ip_address = 192.168.1.37
DHCP4.OPTION[17]:                       requested_static_routes = 1
DHCP4.OPTION[18]:                       domain_name = lan
DHCP4.OPTION[19]:                       dhcp_renewal_time = 43200
DHCP4.OPTION[20]:                       requested_domain_name_servers = 1
DHCP4.OPTION[21]:                       broadcast_address = 192.168.1.255
DHCP4.OPTION[22]:                       domain_name_servers = 192.168.1.1 192.168.1.1
DHCP4.OPTION[23]:                       requested_ntp_servers = 1
DHCP4.OPTION[24]:                       dhcp_lease_time = 86400
DHCP4.OPTION[25]:                       dhcp_rebinding_time = 75600
DHCP4.OPTION[26]:                       requested_netbios_name_servers = 1
DHCP4.OPTION[27]:                       subnet_mask = 255.255.255.0
DHCP4.OPTION[28]:                       network_number = 192.168.1.0
DHCP4.OPTION[29]:                       requested_routers = 1
DHCP4.OPTION[30]:                       dhcp_server_identifier = 192.168.1.1
IP6.ADDRESS[1]:                         fd58:1f28:a661:b500:8345:d822:39b0:91ce/64
IP6.ADDRESS[2]:                         fe80::b060:b51d:e842:7fd0/64
IP6.GATEWAY:                            
IP6.ROUTE[1]:                           dst = fd58:1f28:a661:b500::/64, nh = ::, mt = 600

GENERAL.DEVICE:                         enp3s0
GENERAL.TYPE:                           ethernet
GENERAL.NM-TYPE:                        NMDeviceEthernet
GENERAL.VENDOR:                         Realtek Semiconductor Co., Ltd.
GENERAL.PRODUCT:                        RTL8101/2/6E PCI Express Fast/Gigabit Ethernet controller
GENERAL.DRIVER:                         r8169
GENERAL.DRIVER-VERSION:                 2.3LK-NAPI
GENERAL.FIRMWARE-VERSION:               
GENERAL.HWADDR:                         84:7B:EB:13:91:2F
GENERAL.MTU:                            1500
GENERAL.STATE:                          20 (unavailable)
GENERAL.REASON:                         2 (Device is now managed)
GENERAL.UDI:                            /sys/devices/pci0000:00/0000:00:1c.5/0000:03:00.0/net/enp3s0
GENERAL.IP-IFACE:                       
GENERAL.IS-SOFTWARE:                    no
GENERAL.NM-MANAGED:                     yes
GENERAL.AUTOCONNECT:                    yes
GENERAL.FIRMWARE-MISSING:               no
GENERAL.NM-PLUGIN-MISSING:              no
GENERAL.PHYS-PORT-ID:                   --
GENERAL.CONNECTION:                     --
GENERAL.CON-UUID:                       --
GENERAL.CON-PATH:                       --
GENERAL.METERED:                        unknown
CAPABILITIES.CARRIER-DETECT:            yes
CAPABILITIES.SPEED:                     unknown
CAPABILITIES.IS-SOFTWARE:               no
WIRED-PROPERTIES.CARRIER:               off
CONNECTIONS.AVAILABLE-CONNECTION-PATHS: 

hugh@DELL-INSP-MINT ~ $ 
JeremyB
Level 21
Level 21
Posts: 13881
Joined: Fri Feb 21, 2014 8:17 am

Re: can't connect to w-fi after resume from suspend, need to logout & login again

Post by JeremyB »

What is the name your wifi is using? If it is as it appears in those results, remove the space using the router configuration page then reboot the router and set up a new connection in Linux MInt
hughparker1
Level 2
Level 2
Posts: 87
Joined: Wed Oct 01, 2014 4:18 pm

Re: can't connect to w-fi after resume from suspend, need to logout & login again

Post by hughparker1 »

JeremyB wrote:What is the name your wifi is using? If it is as it appears in those results, remove the space using the router configuration page then reboot the router and set up a new connection in Linux MInt
Thanks for reply, when you say "remove the space", do you mean the space as shown...

Code: Select all

GENERAL.CONNECTION:                     TALKTALKA661B5 1
I checked the name of my SSID and it is shown as only TALKTALKA661B5 with no 1 added.

When I click on network icon in the app indicator panel, and chose "Edit connections..." The "Network Connections" window is displayed where I can see following names....
  • Ethernet
    Wired connection 1

    Wi-Fi
    TALKTALKA661B5 1
when I select "TALKTALKA661B5 1" and press "Edit" button, I can see the SSID: TALKTALKA661B5

so the added "1" is only in the name that is displayed and not in the actual SSID itself.
JeremyB
Level 21
Level 21
Posts: 13881
Joined: Fri Feb 21, 2014 8:17 am

Re: can't connect to w-fi after resume from suspend, need to logout & login again

Post by JeremyB »

Check results for

Code: Select all

iwconfig
before and after suspend and see if Power Managment is on
hughparker1
Level 2
Level 2
Posts: 87
Joined: Wed Oct 01, 2014 4:18 pm

Re: can't connect to w-fi after resume from suspend, need to logout & login again

Post by hughparker1 »

JeremyB wrote:Check results for

Code: Select all

iwconfig
before and after suspend and see if Power Managment is on
here is the results of "iwconfig"

Code: Select all

hugh@DELL-INSP-MINT ~ $ iwconfig
lo        no wireless extensions.

enp3s0    no wireless extensions.

wlp2s0    IEEE 802.11abgn  ESSID:"TALKTALKA661B5"  
          Mode:Managed  Frequency:5.18 GHz  Access Point: 58:1F:28:A6:61:C0   
          Bit Rate=351 Mb/s   Tx-Power=22 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:on
          Link Quality=47/70  Signal level=-63 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:50   Missed beacon:0

hugh@DELL-INSP-MINT ~ $ 
suspend and resume, then run "iwconfig" again....

Code: Select all

hugh@DELL-INSP-MINT ~ $ iwconfig
lo        no wireless extensions.

enp3s0    no wireless extensions.

wlp2s0    IEEE 802.11abgn  ESSID:"TALKTALKA661B5"  
          Mode:Managed  Frequency:5.18 GHz  Access Point: 58:1F:28:A6:61:C0   
          Bit Rate=351 Mb/s   Tx-Power=22 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:on
          Link Quality=46/70  Signal level=-64 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:29   Missed beacon:0

hugh@DELL-INSP-MINT ~ $ 
I notice it shows "Power Management:on" is this normal ?
JeremyB
Level 21
Level 21
Posts: 13881
Joined: Fri Feb 21, 2014 8:17 am

Re: can't connect to w-fi after resume from suspend, need to logout & login again

Post by JeremyB »

Wireless power management being on usually causes issues.

See viewtopic.php?f=53&t=226214#p1194731 but use wlp2s0 instead of wlp1s6 in the /etc/systemd/system/root-resume.service file

You will have to create the file using root permissions with whatever text editor you have. My LM18 Cinnamon install still has gedit so I use it but I think xed is default for Cinnamon now, so to create the file in Cinnamon

Code: Select all

sudo -H xed /etc/systemd/system/root-resume.service
Then you would paste the info from the other post replacing the wireless interface there with yours

Code: Select all

[Unit]
Description=Turn off wlan power management
After=suspend.target

[Service]
Type=simple
ExecStartPre= /bin/sleep 10
ExecStart= /sbin/iwconfig wlp2s0 power off

[Install]
WantedBy=suspend.target
Save file, exit editor, and reboot
hughparker1
Level 2
Level 2
Posts: 87
Joined: Wed Oct 01, 2014 4:18 pm

Re: can't connect to w-fi after resume from suspend, need to logout & login again

Post by hughparker1 »

JeremyB wrote:Wireless power management being on usually causes issues.

See viewtopic.php?f=53&t=226214#p1194731 but use wlp2s0 instead of wlp1s6 in the /etc/systemd/system/root-resume.service file

You will have to create the file using root permissions with whatever text editor you have. My LM18 Cinnamon install still has gedit so I use it but I think xed is default for Cinnamon now, so to create the file in Cinnamon

Code: Select all

sudo -H xed /etc/systemd/system/root-resume.service
Then you would paste the info from the other post replacing the wireless interface there with yours

Code: Select all

[Unit]
Description=Turn off wlan power management
After=suspend.target

[Service]
Type=simple
ExecStartPre= /bin/sleep 10
ExecStart= /sbin/iwconfig wlp2s0 power off
[Install]
WantedBy=suspend.target
Save file, exit editor, and reboot
I tried above as you suggested but the behavior hasn't changed.

After resume from suspend, the network icon in the indicator panel still changes from the normal graduated graph (Wi-Fi Network) to what looks like two cables in diagonal configuration (this looks like the Ethernet Network symbol and not the disconnect symbol as I originally thought), and when I left click, there are no Wi-Fi networks listed. But the Wi-Fi is actually working. It just looks like it's connected via LAN which is a bit misleading.

This is not a big issue, I originally thought I was disconnected after resume from suspend, but the Wi-Fi is actually working so functionality is ok.

Thanks for your help on this it is appreciated.
JeremyB
Level 21
Level 21
Posts: 13881
Joined: Fri Feb 21, 2014 8:17 am

Re: can't connect to w-fi after resume from suspend, need to logout & login again

Post by JeremyB »

Edit the file

Code: Select all

sudo -H xed /etc/systemd/system/root-resume.service
and change the line

Code: Select all

ExecStart= /sbin/iwconfig wlp2s0 power off
to

Code: Select all

ExecStart= /sbin/systemctl restart NetworkManager.service
Save and exit, then

Code: Select all

sudo systemctl enable root-resume
Reboot
hughparker1
Level 2
Level 2
Posts: 87
Joined: Wed Oct 01, 2014 4:18 pm

Re: can't connect to w-fi after resume from suspend, need to logout & login again

Post by hughparker1 »

JeremyB wrote:Edit the file

Code: Select all

sudo -H xed /etc/systemd/system/root-resume.service
and change the line

Code: Select all

ExecStart= /sbin/iwconfig wlp2s0 power off
to

Code: Select all

ExecStart= /sbin/systemctl restart NetworkManager.service
Save and exit, then

Code: Select all

sudo systemctl enable root-resume
Reboot
Thanks again JeremyB, I tried the above but the behavior is the same as before, no change.
JeremyB
Level 21
Level 21
Posts: 13881
Joined: Fri Feb 21, 2014 8:17 am

Re: can't connect to w-fi after resume from suspend, need to logout & login again

Post by JeremyB »

I am not sure what is going on but there was a bug in gnome-network-manager that would cause a wireless connection to be seen as ethernet and the fix was

Code: Select all

systemctl restart NetworkManager.service
or possibly

Code: Select all

sudo systemctl restart NetworkManager.service
It was reported to be caused by the new predictable naming scheme for network devices and a timing issue with network manager

Found something that should work http://askubuntu.com/a/615384/300665
hughparker1
Level 2
Level 2
Posts: 87
Joined: Wed Oct 01, 2014 4:18 pm

Re: can't connect to w-fi after resume from suspend, need to logout & login again

Post by hughparker1 »

JeremyB wrote:I am not sure what is going on but there was a bug in gnome-network-manager that would cause a wireless connection to be seen as ethernet and the fix was

Code: Select all

systemctl restart NetworkManager.service
or possibly

Code: Select all

sudo systemctl restart NetworkManager.service
It was reported to be caused by the new predictable naming scheme for network devices and a timing issue with network manager

Found something that should work http://askubuntu.com/a/615384/300665
Thanks again for link, I will have a look and give it a try.

Q. I guess I should remove the file '/etc/systemd/system/root-resume.service' that I created earlier before following the instructions in the link?
JeremyB
Level 21
Level 21
Posts: 13881
Joined: Fri Feb 21, 2014 8:17 am

Re: can't connect to w-fi after resume from suspend, need to logout & login again

Post by JeremyB »

That other file should be removed
hughparker1
Level 2
Level 2
Posts: 87
Joined: Wed Oct 01, 2014 4:18 pm

Re: can't connect to w-fi after resume from suspend, need to logout & login again

Post by hughparker1 »

JeremyB wrote:That other file should be removed
I created the file as suggested in the link you provided, and it worked perfectly! Thanks for your persistence, it definitely paid off.

Only one thing to note is when I ran the last command to activate the service with 'sudo systemctl enable root-resume.service' I got message 'file already exists'. see below for details....

Code: Select all

hugh@DELL-INSP-MINT ~ $ sudo systemctl enable root-resume.service
Failed to execute operation: File exists
hugh@DELL-INSP-MINT ~ $ 
So I checked and file was already there...

Code: Select all

hugh@DELL-INSP-MINT ~ $ cd /etc/systemd/system/suspend.target.wants/
hugh@DELL-INSP-MINT /etc/systemd/system/suspend.target.wants $ ls
anacron-resume.service  root-resume.service
hugh@DELL-INSP-MINT /etc/systemd/system/suspend.target.wants $
So everything is working as expected thanks to your help, it is much appreciated.
hughparker1
Level 2
Level 2
Posts: 87
Joined: Wed Oct 01, 2014 4:18 pm

Re: can't connect to w-fi after resume from suspend, need to logout & login again

Post by hughparker1 »

hughparker1 wrote:
JeremyB wrote:That other file should be removed
I created the file as suggested in the link you provided, and it worked perfectly! Thanks for your persistence, it definitely paid off.

Only one thing to note is when I ran the last command to activate the service with 'sudo systemctl enable root-resume.service' I got message 'file already exists'. see below for details....

Code: Select all

hugh@DELL-INSP-MINT ~ $ sudo systemctl enable root-resume.service
Failed to execute operation: File exists
hugh@DELL-INSP-MINT ~ $ 
I checked and file was already there, so looks like activation is not necessary...

Code: Select all

hugh@DELL-INSP-MINT ~ $ cd /etc/systemd/system/suspend.target.wants/
hugh@DELL-INSP-MINT /etc/systemd/system/suspend.target.wants $ ls
anacron-resume.service  root-resume.service
hugh@DELL-INSP-MINT /etc/systemd/system/suspend.target.wants $
Everything is working as expected thanks to your help, it is much appreciated.
hpmital
Level 1
Level 1
Posts: 29
Joined: Fri Oct 25, 2013 3:00 am
Location: Sydney or New Delhi

Re: [SOLVED] can't connect to w-fi after resume from suspend, need to logout & login again

Post by hpmital »

I am having a similar problem while using Mint Cinnamon Sarah - wifi connection is not only lost when resuming from suspend, but my wifi network also does not show up in the list. I have to restart the system to get back wifi again.
From the above it looks that the cause has been found and a modification to the system fixes the problem. My request is that the necessary changes to the system may be made by the Mint team and put on the system update. I would not like to disturb the system files by making any changes myself, lest I break the system. A search for solution on the forum and otherwise on googling shows a large number of users are experiencing this difficulty.
mitchellk

Re: [SOLVED] can't connect to w-fi after resume from suspend, need to logout & login again

Post by mitchellk »

I've hardcoded my wifi settings in /etc/network/interfaces and it works flawlessly.

sudo nano /etc/network/interfaces

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
# manually hard code our wireless adapter and settings
auto wlp2s0
iface wlp2s0 inet static
address 10.0.0.45
netmask 255.255.255.0
network 10.0.0.0
broadcast 10.255.255.255
gateway 10.0.0.2
dns-nameservers 8.8.8.8 8.8.4.4
wpa-ssid wifiSSID
wpa-psk wifipassword


then

sudo /etc/init.d/networking restart
Locked

Return to “Networking”