Page 2 of 3

Re: After suspend mode wired connecttion does not work

Posted: Sun Jul 08, 2018 7:19 am
by Sir Charles
I am sorry that wasn't the appropriate command. I guess I am getting out of my depth here :wink:

Re: After suspend mode wired connecttion does not work

Posted: Sun Jul 08, 2018 7:24 am
by djnesic
Thanks anyway, Marziano.

Re: After suspend mode wired connecttion does not work

Posted: Sun Jul 08, 2018 7:29 am
by Sir Charles
You are welcome! I am sure you will get assistance from the experts on this forum to get your wired connection going.

Cheers

Re: After suspend mode wired connecttion does not work

Posted: Sun Jul 08, 2018 7:31 am
by djnesic
I am sure too. Cheers!

Re: After suspend mode wired connecttion does not work

Posted: Sun Jul 08, 2018 7:42 am
by thx-1138
...i can only further offer the following idea right out of my mind: lspci -k | grep Ethernet -A2
This will return you something like:
01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)
Subsystem: Lenovo RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
Kernel driver in use: r8169
Kernel modules: r8169
In my case, the driver in use is r8169, in your system it might differ. So, after resuming from suspend: sudo rmmod r8169 && sudo modprobe r8169 && sudo systemctl restart network-manager.service
Replace r8169 with the name of your driver of course (this will remove the driver, re-insert it & further restart the service as well...)

Re: After suspend mode wired connecttion does not work

Posted: Sun Jul 08, 2018 7:45 am
by djnesic
thx-1138 wrote:
Sun Jul 08, 2018 7:42 am
...i can only further offer the following idea right out of my mind: lspci -k | grep Ethernet -A2
This will return you something like:
01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)
Subsystem: Lenovo RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
Kernel driver in use: r8169
Kernel modules: r8169
In my case, the driver in use is r8169, in your system it might differ. So, after resuming from suspend: sudo rmmod r8169 && sudo modprobe r8169 && sudo systemctl restart network-manager.service
Replace r8169 with the name of your driver of course (this will remove the driver, re-insert it & further restart the service as well...)
Let`s try

Code: Select all

djnesic@djnesic-P31-DS3L:~$ lspci -k | grep Ethernet -A2
03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 01)
	Subsystem: Gigabyte Technology Co., Ltd Onboard Ethernet
	Kernel driver in use: r8169
	Kernel modules: r8169

Re: After suspend mode wired connecttion does not work

Posted: Sun Jul 08, 2018 8:09 am
by djnesic
That`s it. It works. Thank you thx-1138.
Just one more question. Can it be automated or I have to apply every time after back from suspend?

Re: After suspend mode wired connecttion does not work

Posted: Sun Jul 08, 2018 8:37 am
by thx-1138
...absolutely great. I'm not really familiar with systemd's internals (read: barely understand it's basics), but i'd try:
make a simple text file, let's call it ethernet-reenable.sh (or whatever you wish).
Put the following contents there, and save it afterwards.
#!/bin/sh
sudo rmmod r8169 && sudo modprobe r8169 && sudo systemctl restart network-manager.service

Right-click on it, Properties, Permissions, "Allow Executing File As Program".

Then tweak Marziano's service, so that it points to that script:
xed admin:///etc/systemd/system/network-resume.service
[Unit]
Description=Local system network resume actions
After=suspend.target

[Service]
Type=oneshot
ExecStart=/home/djnesic/ethernet-reenable.sh

[Install]
WantedBy=suspend.target
That is, assuming you saved the ethernet-reenable.sh under /home/djnesic/
Finally, sudo systemctl deamon-reload for the changes to take effect (or reboot)...

I think this should be it more or less...(i repeat, my knowledge of systemd is rather elementary...
so if i've missed a step, hopefully someone else can chime in)...

Re: After suspend mode wired connecttion does not work

Posted: Sun Jul 08, 2018 9:15 am
by djnesic
Everything works just right. Thanks both of you, Marziano and thx-1138. You have blown away this. Best wishes.

Re: After suspend mode wired connecttion does not work

Posted: Sun Jul 08, 2018 9:18 am
by Sir Charles
That's great!
Thank you and thx-1138!
Learning is one of the biggest joys in my life. This was a joyous day!

Cheers
:D

Re: After suspend mode wired connecttion does not work

Posted: Sun Jul 08, 2018 10:09 am
by thx-1138
Marziano wrote:
Sun Jul 08, 2018 9:18 am
That's great!
Thank you and thx-1138!
Learning is one of the biggest joys in my life. This was a joyous day!

Cheers
:D
...to be honest, it's exactly the fact that you proposed a systemd service in the first place what attracted my attention in the thread
(ie. you obviously have my thanks as well): really glad we managed to provide a workaround :)
I keep saying to myself that i should study properly how systemd does this or that, but keep postponing it for later...and later...and... :roll: :mrgreen:

Re: After suspend mode wired connecttion does not work

Posted: Sun Jul 08, 2018 2:45 pm
by Sir Charles
thx-1138 wrote:
Sun Jul 08, 2018 10:09 am
really glad we managed to provide a workaround :)
Same here, great sense of satisfaction !
Cheers
:D

Re: [SOLVED]After suspend mode wired connecttion does not work

Posted: Thu Jul 12, 2018 3:57 pm
by laszlopalya
The following is not a solution but a work around.
I had the same problem and tried all the solutions found on the web.
Finally I reinstalled LM 19 without network connection. After that I deselected the following packages fro updates:
kernel 4.15.0.23.25
netplan.io
networkd-dispatcher.
On of these caused it...

Now everything works fine.

Regards

Re: [SOLVED]After suspend mode wired connecttion does not work

Posted: Thu Jul 12, 2018 4:50 pm
by djnesic
As a newbie I follow the rule "do not fix it if it's not broken" . I am grateful to Marziano and thx-1138 because they have solved my problem. Thank you laszlopalya for more ideas. I do not ask for help immediately, I search forum and if I can not find solution then I ask for help. For example, today I found solution for my problem (some things about update and python3...I do not know), and I do not know is it the best solution, but it is work for me. Although I'm not online I follow this forum every day. The point is... it works, does it the best solution...it is not important :) . Please, forgive me on my english.

Re: After suspend mode wired connecttion does not work

Posted: Wed Aug 29, 2018 11:23 am
by kylerickards
thx-1138 wrote:
Sun Jul 08, 2018 8:37 am
...absolutely great. I'm not really familiar with systemd's internals (read: barely understand it's basics), but i'd try:
make a simple text file, let's call it ethernet-reenable.sh (or whatever you wish).
Put the following contents there, and save it afterwards.
#!/bin/sh
sudo rmmod r8169 && sudo modprobe r8169 && sudo systemctl restart network-manager.service

Right-click on it, Properties, Permissions, "Allow Executing File As Program".

Then tweak Marziano's service, so that it points to that script:
xed admin:///etc/systemd/system/network-resume.service
[Unit]
Description=Local system network resume actions
After=suspend.target

[Service]
Type=oneshot
ExecStart=/home/djnesic/ethernet-reenable.sh

[Install]
WantedBy=suspend.target
That is, assuming you saved the ethernet-reenable.sh under /home/djnesic/
Finally, sudo systemctl deamon-reload for the changes to take effect (or reboot)...

I think this should be it more or less...(i repeat, my knowledge of systemd is rather elementary...
so if i've missed a step, hopefully someone else can chime in)...
Hi all

I have had the same problem and the command works on restarting the service. But I am having trouble understanding how to create and run that script? Could anyone help please?

Kyle

Re: After suspend mode wired connecttion does not work

Posted: Wed Aug 29, 2018 11:33 am
by gm10
kylerickards wrote:
Wed Aug 29, 2018 11:23 am
I have had the same problem and the command works on restarting the service. But I am having trouble understanding how to create and run that script? Could anyone help please?
Copy & paste the following into a terminal window (paste it as a whole):

Code: Select all

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

Code: Select all

sudo chmod +x /lib/systemd/system-sleep/reset_network_driver
This sets up everything for you. It's not exactly the same thing that they proposed, but it's the better way of doing it.

It's only a problem with the 4.15 kernels by the way, you won't need this with more recent kernels.

Re: [SOLVED]After suspend mode wired connecttion does not work

Posted: Sat Sep 01, 2018 5:25 am
by kylerickards
Thank you!

Re: After suspend mode wired connecttion does not work

Posted: Wed Sep 05, 2018 4:20 am
by kylerickards
gm10 wrote:
Wed Aug 29, 2018 11:33 am
kylerickards wrote:
Wed Aug 29, 2018 11:23 am
I have had the same problem and the command works on restarting the service. But I am having trouble understanding how to create and run that script? Could anyone help please?
Copy & paste the following into a terminal window (paste it as a whole):

Code: Select all

sudo tee /lib/systemd/system-sleep/reset_network_driver <<'EOB'
case "$1" in
    pre)
        modprobe -r r8169
        ;;
    post)
        modprobe r8169
        ;;
esac
EOB
sudo chmod +x /lib/systemd/system-sleep/reset_network_driver
This sets up everything for you. It's not exactly the same thing that they proposed, but it's the better way of doing it.

It's only a problem with the 4.15 kernels by the way, you won't need this with more recent kernels.
Hi

I tried that and it didn't work for me? :(

Re: After suspend mode wired connecttion does not work

Posted: Wed Sep 05, 2018 4:29 am
by gm10
kylerickards wrote:
Wed Sep 05, 2018 4:20 am
I tried that and it didn't work for me? :(
Run the last line again, I should have put that separately:

Code: Select all

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

Re: [SOLVED]After suspend mode wired connecttion does not work

Posted: Sat Sep 08, 2018 7:42 am
by kylerickards
Hi

I tried again and I have the same problem still so I don't know what's causing it :(