[SOLVED] Losing internet connection after using 'SUSPEND'

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.
ES44AC8102
Level 4
Level 4
Posts: 255
Joined: Tue Oct 14, 2014 4:53 pm

[SOLVED] Losing internet connection after using 'SUSPEND'

Post by ES44AC8102 »

For some reason I lose my connection to the web when I wake the machine from SUSPEND. All I need do is invoke that mode for a few secs and my connection is gone when I wake it up.

I thought maybe it was a kernel issue so I chose 2 older ones and the result was the same, connection still lost. Of course a reboot resolves it and it would be fine if I wanted to shut down completely, but I prefer to use the 'suspend' when I can.

Currently using the latest kernel that was offered 4.15.0-33.

A few days ago there was an issue not being able to connect to the update site but that's OK now for whatever reason.

Thanks to all,

'ES'
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.
gm10

Re: Losing internet connection after using 'SUSPEND'

Post by gm10 »

No support request without the output of this terminal command please, we are not psychic:

Code: Select all

inxi -Fxz
User avatar
Joe2Shoe
Level 5
Level 5
Posts: 850
Joined: Wed Oct 18, 2017 8:12 pm
Location: Ozone

Re: Losing internet connection after using 'SUSPEND'

Post by Joe2Shoe »

You may want to turn OFF Power Management for your wifi adapter.

Open a Terminal and enter: "iwconfig" (without the quotes).
Look at the output. You should see the name of your chip-set as well as the whether power management is off or on. If it doesn't say, it is probably off.

1. To turn off power management, edit /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf:
sudo gedit /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf

[connection]
wifi.powersave = 3

2. Change the 3 to a 2.

3. Save.

4. Exit.

5. Reboot.

6. Then run:
iwconfig

and if it worked you should see Power Management:off.
"Tolerance is the refuge of men without conviction."
"Common sense is not so common" - Voltaire
ES44AC8102
Level 4
Level 4
Posts: 255
Joined: Tue Oct 14, 2014 4:53 pm

Re: Losing internet connection after using 'SUSPEND'

Post by ES44AC8102 »

gm10 wrote: Sun Sep 02, 2018 1:02 pm No support request without the output of this terminal command please, we are not psychic:

Code: Select all

inxi -Fxz
me@myhouse $ inxi -Fxz
System: Host: Area52 Kernel: 4.15.0-33-generic x86_64 (64 bit gcc: 5.4.0)
Desktop: Cinnamon 3.6.7 (Gtk 3.18.9-1ubuntu3.3)
Distro: Linux Mint 18.3 Sylvia
Machine: Mobo: ASUSTeK model: Rampage Extreme v: Rev 2.xx
Bios: American Megatrends v: 1301 date: 07/27/2009
CPU: Quad core Intel Core2 Quad Q6600 (-MCP-) cache: 4096 KB
flags: (lm nx sse sse2 sse3 ssse3 vmx) bmips: 19200
clock speeds: max: 2400 MHz 1: 2400 MHz 2: 2399 MHz 3: 2400 MHz
4: 2400 MHz
Graphics: Card: NVIDIA GM107 [GeForce GTX 750 Ti] bus-ID: 01:00.0
Display Server: X.Org 1.18.4 drivers: nvidia (unloaded: fbdev,vesa,nouveau)
Resolution: 1920x1080@60.00hz
GLX Renderer: GeForce GTX 750 Ti/PCIe/SSE2
GLX Version: 4.5.0 NVIDIA 384.130 Direct Rendering: Yes
Audio: Card-1 NVIDIA Device 0fbc driver: snd_hda_intel bus-ID: 01:00.1
Card-2 Intel 82801I (ICH9 Family) HD Audio Controller
driver: snd_hda_intel bus-ID: 00:1b.0
Sound: Advanced Linux Sound Architecture v: k4.15.0-33-generic
Network: Card-1: Marvell 88E8056 PCI-E Gigabit Ethernet Controller
driver: sky2 v: 1.30 port: c800 bus-ID: 03:00.0
IF: enp3s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
Card-2: Marvell 88E8056 PCI-E Gigabit Ethernet Controller
driver: sky2 v: 1.30 port: d800 bus-ID: 04:00.0
IF: enp4s0 state: down mac: <filter>
Drives: HDD Total Size: 740.2GB (3.4% used)
ID-1: /dev/sda model: INTEL_SSDSC2BW24 size: 240.1GB
ID-2: /dev/sdf model: WDC_WD5000AAKX size: 500.1GB
Partition: ID-1: / size: 59G used: 18G (32%) fs: ext4 dev: /dev/sda3
ID-2: swap-1 size: 6.15GB used: 0.00GB (0%) fs: swap dev: /dev/sda4
RAID: No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors: System Temperatures: cpu: 50.0C mobo: 32.0C psu: 35.0 gpu: 0.0:35C
Fan Speeds (in rpm): cpu: 2812
Info: Processes: 209 Uptime: 4 min Memory: 1154.4/7976.6MB
Init: systemd runlevel: 5 Gcc sys: 5.4.0
Client: Shell (bash 4.3.481) inxi: 2.2.35
me@myhouse ~ $
gm10

Re: Losing internet connection after using 'SUSPEND'

Post by gm10 »

Thanks. After you resume from suspend, run this in a terminal and see if your Internet connections starts working again:

Code: Select all

sudo modprobe -r sky2;sudo modprobe sky2
Let me know.
ES44AC8102
Level 4
Level 4
Posts: 255
Joined: Tue Oct 14, 2014 4:53 pm

Re: Losing internet connection after using 'SUSPEND'

Post by ES44AC8102 »

Joe2Shoe wrote: Sun Sep 02, 2018 2:58 pm You may want to turn OFF Power Management for your wifi adapter.
No mention of any adapter maybe as you expected? I didn't know there was a wi-fi adapter!

fred@Area52 ~ $ iwconfig
enp3s0 no wireless extensions.

enp4s0 no wireless extensions.

lo no wireless extensions.

fred@Area52 ~ $

Thanks,

"ES"
ES44AC8102
Level 4
Level 4
Posts: 255
Joined: Tue Oct 14, 2014 4:53 pm

Re: Losing internet connection after using 'SUSPEND'

Post by ES44AC8102 »

gm10 wrote: Mon Sep 03, 2018 8:29 am Thanks. After you resume from suspend, run this in a terminal and see if your Internet connections starts working again:

Code: Select all

sudo modprobe -r sky2;sudo modprobe sky2
Let me know.

Yes! Remarkably that gives me the connection again! What's going on?

"ES"
gm10

Re: Losing internet connection after using 'SUSPEND'

Post by gm10 »

ES44AC8102 wrote: Mon Sep 03, 2018 8:43 am Yes! Remarkably that gives me the connection again! What's going on?
Well, once we know your system configuration we can give proper advice, that's why it's important to always provide it. ;)

Next run this (copy & paste it as a whole please):

Code: Select all

sudo tee /lib/systemd/system-sleep/reset_network_driver <<'EOB'
#!/bin/sh
case "$1" in
    pre)
        modprobe -r sky2
        ;;
    post)
        modprobe sky2
        ;;
esac
EOB
followed by this:

Code: Select all

sudo chmod +x /lib/systemd/system-sleep/reset_network_driver
That should fix your situation permanently
Last edited by gm10 on Mon Sep 03, 2018 2:09 pm, edited 2 times in total.
ES44AC8102
Level 4
Level 4
Posts: 255
Joined: Tue Oct 14, 2014 4:53 pm

Re: Losing internet connection after using 'SUSPEND'

Post by ES44AC8102 »

gm10 wrote: Mon Sep 03, 2018 8:49 am
ES44AC8102 wrote: Mon Sep 03, 2018 8:43 am Yes! Remarkably that gives me the connection again! What's going on?
Well, once we know your system configuration we can give proper advice, that's why it's important to always provide it. ;)

Next run this (copy & paste it as a whole please), that should fix your situation permanently:

Code: Select all

sudo tee /lib/systemd/system-sleep/reset_network_driver <<'EOB'
case "$1" in
    pre)
        modprobe -r sky2
        ;;
    post)
        modprobe sky2
        ;;
esac
EOB
sudo chmod +x /lib/systemd/system-sleep/reset_network_driver
gm10,

Using that string I get the following from the terminal:

fred@Area52 ~ $ sudo tee /lib/systemd/system-sleep/reset_network_driver <<'EOB'
> case "$1" in
> pre)
> modprobe -r sky2
> ;;
> post)
> modprobe sky2
> ;;
> esac
> EOB
[sudo] password for fred:
Sorry, try again.
[sudo] password for fred:

This doesn't restore the connection, permanently.

Thank you,

"ES"
gm10

Re: Losing internet connection after using 'SUSPEND'

Post by gm10 »

The part you quoted is missing the last line from what I gave you. Did you run that, too? I probably should have given you that as a separate command, I think it got lost when you entered your password:

Code: Select all

sudo chmod +x /lib/systemd/system-sleep/reset_network_driver
ES44AC8102
Level 4
Level 4
Posts: 255
Joined: Tue Oct 14, 2014 4:53 pm

Re: Losing internet connection after using 'SUSPEND'

Post by ES44AC8102 »

gm10 wrote: Mon Sep 03, 2018 11:09 am The part you quoted is missing the last line from what I gave you. Did you run that, too? I probably should have given you that as a separate command, I think it got lost when you entered your password:

Code: Select all

sudo chmod +x /lib/systemd/system-sleep/reset_network_driver

gm10,
Oddly enough although I am using the 'select all' to copy your lines, it refuses allow me to copy the last line in question. Yet when I try and paste the commands into a text file, ALL the lines are there including the last one!

If I paste it in separately, after the fact, the terminal doesn't ask me for my p/w! Fwiw I am not making a mistake when typing my p/w after the commands you sent, yet it asks me again for the p/w then accepts it.

Makes no sense to me. :(

Thanks again,

"ES"
gm10

Re: Losing internet connection after using 'SUSPEND'

Post by gm10 »

ES44AC8102 wrote: Mon Sep 03, 2018 11:55 amIf I paste it in separately, after the fact, the terminal doesn't ask me for my p/w! Fwiw I am not making a mistake when typing my p/w after the commands you sent, yet it asks me again for the p/w then accepts it.
No, the mistake was entirely mine. The last line basically was redirected into the password entry, that's why this went wrong and why I should not have given you both commands in a single code block. Sorry about that. And you won't get asked the password the second time because the password remains cached for a few minutes.

Hope it's working correctly now though.
ES44AC8102
Level 4
Level 4
Posts: 255
Joined: Tue Oct 14, 2014 4:53 pm

Re: Losing internet connection after using 'SUSPEND'

Post by ES44AC8102 »

gm10 wrote: Mon Sep 03, 2018 12:13 pm
ES44AC8102 wrote: Mon Sep 03, 2018 11:55 amIf I paste it in separately, after the fact, the terminal doesn't ask me for my p/w! Fwiw I am not making a mistake when typing my p/w after the commands you sent, yet it asks me again for the p/w then accepts it.
No, the mistake was entirely mine. The last line basically was redirected into the password entry, that's why this went wrong and why I should not have given you both commands in a single code block. Sorry about that. And you won't get asked the password the second time because the password remains cached for a few minutes.

Hope it's working correctly now though.
Sorry to report that it is not working. The only thing that seems to work is the line

Code: Select all

sudo modprobe -r sky2;sudo modprobe sky2
Entering the first commands gives the result I have already posted, then adding the last line does nothing. Never asks me for the pw in spite of it being cached.

End result is that the string above is all that seems to work. I'm sure your commands will work at some point but I don't have the knowledge to make it so!
Plus somehow I got into a guest log on and couldn't figure out how to get back to my usual pw and user name. So I had to restore the system from an Acronis backup! LOL all I needed today. Really only took about 10 minutes to do the restore, how I ever got logged in as a guest I haven't a clue <sigh>

"ES"
gm10

Re: Losing internet connection after using 'SUSPEND'

Post by gm10 »

Sorry to hear that, I don't know what happened with your account there. It wasn't related to what we were doing here. The good news is, I figured out why my permanent solution wasn't working. On LM18 (unlike on LM19) the shebang is required for it to run, so we have to add that to my script. Please run this:

Code: Select all

sudo tee /lib/systemd/system-sleep/reset_network_driver <<'EOB'
#!/bin/sh
case "$1" in
    pre)
        modprobe -r sky2
        ;;
    post)
        modprobe sky2
        ;;
esac
EOB
Followed by

Code: Select all

sudo chmod +x /lib/systemd/system-sleep/reset_network_driver
This will work now, I'm sure. :)
ES44AC8102
Level 4
Level 4
Posts: 255
Joined: Tue Oct 14, 2014 4:53 pm

Re: Losing internet connection after using 'SUSPEND'

Post by ES44AC8102 »

gm10 wrote: Mon Sep 03, 2018 2:08 pm Sorry to hear that, I don't know what happened with your account there. It wasn't related to what we were doing here.
This will work now, I'm sure. :)

gm10,

You are correct sir it works fine! 8) Needless to say it makes me wonder why I need this script now and not before, or what is causing the trouble?

In any event I've put the computer on standby and let it sit 30 secs or so and come back to a restart and find I have a connection! Yippee!

I appreciate the help and you taking the time to sort it out for me, great stuff that!


Best regards and many thanks,

"ES"
gm10

Re: Losing internet connection after using 'SUSPEND'

Post by gm10 »

You are quite welcome, sorry for my slight sloppiness in providing the solution. ;) Please take a moment to edit the first post's subject line to add that the topic is SOLVED.

The reason you're seeing this now is because it's an issue only with recent versions of the 4.15 kernel series. I know it didn't happen with the original 4.15 release, nor does it happen with the latest 4.18.
ES44AC8102
Level 4
Level 4
Posts: 255
Joined: Tue Oct 14, 2014 4:53 pm

Re: Losing internet connection after using 'SUSPEND'

Post by ES44AC8102 »

gm10 wrote: Mon Sep 03, 2018 7:14 pm You are quite welcome, sorry for my slight sloppiness in providing the solution. ;) Please take a moment to edit the first post's subject line to add that the topic is SOLVED.

The reason you're seeing this now is because it's an issue only with recent versions of the 4.15 kernel series. I know it didn't happen with the original 4.15 release, nor does it happen with the latest 4.18.
gm10,

Well that makes me feel good, in that I was correct it was a kernel issue, I guess I didn't go back far enough in the listed versions I tried. :roll:

There are 14 of them in there.... a bit excessive wouldn't you say? I intend to get rid of most of them and keep only 3, maybe that's too many? I don't know how large they are but any disc space saving is good. I plan to remove them using Synaptic, but I have to ask, on boot up if I look at the 'advanced features' I can see all the kernels to choose from. at the right side of the screen it says 'generic' and 'upstart' and 'recovery'. What do those last two mean?

Regards and thanks again!

"ES" :)
Last edited by ES44AC8102 on Tue Sep 04, 2018 12:53 pm, edited 1 time in total.
gm10

Re: [SOLVED] Losing internet connection after using 'SUSPEND'

Post by gm10 »

Yep, some house-keeping with the kernels may be in order there, those take up a lot of disk space. Personally I usually keep only 1 or 2 kernels around, more only while I'm testing out a new kernel.

If you want some help with the housekeeping, if you run this it will remove all but your current kernel in one go:

Code: Select all

dpkg-query -W -f '${Version}\n' linux-image-[^g]*|uniq -u|sed -e 's/\~[^~]*$//' -e 's/\.[^.]*$//' -e /$(uname -r|sed s/-generic//)/Q -e 's/.*/linux-*-&*/'|tr '\n' ' '|xargs -r sudo apt-get remove --purge -y
You can also do it manually one by one via Update Manager, of course.
ES44AC8102
Level 4
Level 4
Posts: 255
Joined: Tue Oct 14, 2014 4:53 pm

Re: [SOLVED] Losing internet connection after using 'SUSPEND'

Post by ES44AC8102 »

gm10 wrote: Tue Sep 04, 2018 12:51 pm Yep, some house-keeping with the kernels may be in order there, those take up a lot of disk space. Personally I usually keep only 1 or 2 kernels around, more only while I'm testing out a new kernel.

If you want some help with the housekeeping, if you run this it will remove all but your current kernel in one go:

Code: Select all

dpkg-query -W -f '${Version}\n' linux-image-[^g]*|uniq -u|sed -e 's/\~[^~]*$//' -e 's/\.[^.]*$//' -e /$(uname -r|sed s/-generic//)/Q -e 's/.*/linux-*-&*/'|tr '\n' ' '|xargs -r sudo apt-get remove --purge -y
You can also do it manually one by one via Update Manager, of course.
gm10,

That line really did the job and saved me some time and wasted space on the drive, very cool! Thanks again,

"ES"
gm10

Re: [SOLVED] Losing internet connection after using 'SUSPEND'

Post by gm10 »

ES44AC8102 wrote: Wed Sep 05, 2018 1:23 pm That line really did the job
I only make one mistake per thread. :lol:

Happy to help. :wink:
Locked

Return to “Networking”