RTL8822CE WiFi problems (Asus TUF Gaming A15)

Generally if your WiFi isn't working after suspension then you can correct this by writing a service. The service unloads your network components prior to suspension, and then reloads them after resuming.

Create the service file:

/etc/systemd/system/network-restart.service

With the following contents:

# cat /etc/systemd/system/network-restart.service
# systemctl enable --now network-restart.service
# systemctl start network-restart.service
# systemctl stop network-restart.service
# systemctl disable --now network-restart.service
# systemctl status network-restart.service
# systemctl daemon-reload

[Unit]
Description=Network Suspend/Resume Service 
Before=sleep.target
StopWhenUnneeded=yes

[Service]
User=root
Type=oneshot
RemainAfterExit=yes
ExecStartPre=-/usr/bin/sudo -u $USER /bin/bash -lc 'nmcli networking off'
ExecStart=/usr/bin/sleep 1
ExecStart=-/usr/bin/systemctl stop NetworkManager
ExecStart=/usr/bin/sleep 1
ExecStart=-/usr/bin/ip link set wlp3s0 down
ExecStart=/usr/bin/sleep 1
ExecStart=-/usr/bin/modprobe -r rtw88_8822ce
ExecStop=/usr/bin/sleep 5
ExecStop=-/usr/bin/modprobe rtw88_8822ce
ExecStop=/usr/bin/sleep 2
ExecStop=-/usr/bin/ip link set wlp3s0 up
ExecStop=/usr/bin/sleep 2
ExecStop=-/usr/bin/systemctl start NetworkManager
ExecStop=/usr/bin/sleep 2
ExecStop=-/usr/bin/sudo -u $USER /bin/bash -lc 'nmcli networking on'
ExecStop=/usr/bin/sleep 1
ExecStop=-/usr/bin/sudo -u $USER /bin/bash -lc 'nmcli r wifi off'
ExecStop=/usr/bin/sleep 1
ExecStop=-/usr/bin/sudo -u $USER /bin/bash -lc 'nmcli r wifi on'

[Install]
WantedBy=sleep.target

Save the service file, then enable the service.

If you have any further questions, see:

5 Likes