You are not logged in.

#1 2024-01-14 05:45:48

AlwaysFinking
Member
Registered: 2024-01-14
Posts: 19

Wifi keeps disconnecting on KDE

A few days after my installation, I ran into this problem of my wifi disconnecting and reconnecting frequently. Sometimes it wouldn't even connect and show the loading wifi icon on the task bar.

This was getting very annoying. So I looked up the Arch forum and found this solution https://wiki.archlinux.org/title/KDE_Wa … y_on_login which solved half the problem. Now in some boots, my wifi runs completely fine without any issues and in some boots, I have that disconnecting issue happening every 10 seconds and It won't go away until I reboot.

With all that said, Is there a permanent solution for this?

Here's a command output that you guys might find necessary

 $ sudo systemctl list-units --type service --no-pager

  UNIT                                     LOAD   ACTIVE SUB     DESCRIPTION
  bluetooth.service                        loaded active running Bluetooth service
  dbus-broker.service                      loaded active running D-Bus System Message Bus
  iwd.service                              loaded active running Wireless service
  kmod-static-nodes.service                loaded active exited  Create List of Static Device Nodes
  lvm2-monitor.service                     loaded active exited  Monitoring of LVM2 mirrors, snapshots etc. using dmeventd or progress polling
  NetworkManager-wait-online.service       loaded active exited  Network Manager Wait Online
  NetworkManager.service                   loaded active running Network Manager
  polkit.service                           loaded active running Authorization Manager
  rtkit-daemon.service                     loaded active running RealtimeKit Scheduling Policy Service
  sddm.service                             loaded active running Simple Desktop Display Manager
  systemd-journal-flush.service            loaded active exited  Flush Journal to Persistent Storage
  systemd-journald.service                 loaded active running Journal Service
  systemd-logind.service                   loaded active running User Login Management
  systemd-modules-load.service             loaded active exited  Load Kernel Modules
  systemd-network-generator.service        loaded active exited  Generate network units from Kernel command line
  systemd-networkd.service                 loaded active running Network Configuration
  systemd-random-seed.service              loaded active exited  Load/Save OS Random Seed
  systemd-remount-fs.service               loaded active exited  Remount Root and Kernel File Systems
  systemd-resolved.service                 loaded active running Network Name Resolution
  systemd-sysctl.service                   loaded active exited  Apply Kernel Variables
  systemd-timesyncd.service                loaded active running Network Time Synchronization
  systemd-tmpfiles-setup-dev-early.service loaded active exited  Create Static Device Nodes in /dev gracefully
  systemd-tmpfiles-setup-dev.service       loaded active exited  Create Static Device Nodes in /dev
  systemd-tmpfiles-setup.service           loaded active exited  Create Volatile Files and Directories
  systemd-udev-trigger.service             loaded active exited  Coldplug All udev Devices
  systemd-udevd.service                    loaded active running Rule-based Manager for Device Events and Files
  systemd-update-utmp.service              loaded active exited  Record System Boot/Shutdown in UTMP
  systemd-user-sessions.service            loaded active exited  Permit User Sessions
  systemd-vconsole-setup.service           loaded active exited  Virtual Console Setup
  udisks2.service                          loaded active running Disk Manager
  upower.service                           loaded active running Daemon for power management
  user-runtime-dir@1000.service            loaded active exited  User Runtime Directory /run/user/1000
  user@1000.service                        loaded active running User Manager for UID 1000
  wpa_supplicant.service                   loaded active running WPA supplicant

Legend: LOAD   → Reflects whether the unit definition was properly loaded.
        ACTIVE → The high-level unit activation state, i.e. generalization of SUB.
        SUB    → The low-level unit activation state, values depend on unit type.

34 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.

There's are a few more service generally there like,

NetworkMangaer-dispatcher.service
systemd-network-wait-online.service        

which I don't see here rn

Last edited by AlwaysFinking (2024-01-14 05:52:49)

Offline

#2 2024-01-14 09:18:09

seth
Member
Registered: 2012-09-03
Posts: 59,073

Re: Wifi keeps disconnecting on KDE

Yeah… iwd, NM and systemd-networkd (and maybe an extra wpa_supplicant) are runing and will play
1i9LnI.gif
At least.

Please post the output of

find /etc/systemd -type l -exec test -f {} \; -print | awk -F'/' '{ printf ("%-40s | %s\n", $(NF-0), $(NF-1)) }' | sort -f

Last edited by seth (2024-01-14 09:18:26)

Offline

#3 2024-01-14 10:29:19

AlwaysFinking
Member
Registered: 2024-01-14
Posts: 19

Re: Wifi keeps disconnecting on KDE

LMAO XD
Here's the output of the command

$ find /etc/systemd -type l -exec test -f {} \; -print | awk -F'/' '{ printf ("%-40s | %s\n", $(NF-0), $(NF-1)) }' | sort -f

bluetooth.service                        | bluetooth.target.wants
dbus-org.bluez.service                   | system
dbus-org.freedesktop.network1.service    | system
dbus-org.freedesktop.nm-dispatcher.service | system
dbus-org.freedesktop.resolve1.service    | system
dbus-org.freedesktop.timesync1.service   | system
display-manager.service                  | system
fstrim.timer                             | timers.target.wants
getty@tty1.service                       | getty.target.wants
iwd.service                              | multi-user.target.wants
NetworkManager.service                   | multi-user.target.wants
NetworkManager-wait-online.service       | network-online.target.wants
p11-kit-server.socket                    | sockets.target.wants
pipewire-pulse.socket                    | sockets.target.wants
pipewire-session-manager.service         | user
pipewire.socket                          | sockets.target.wants
remote-fs.target                         | multi-user.target.wants
systemd-networkd.service                 | multi-user.target.wants
systemd-networkd.socket                  | sockets.target.wants
systemd-network-generator.service        | sysinit.target.wants
systemd-resolved.service                 | sysinit.target.wants
systemd-timesyncd.service                | sysinit.target.wants
wireplumber.service                      | pipewire.service.wants
xdg-user-dirs-update.service             | default.target.wants

Offline

#4 2024-01-14 10:59:14

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,343
Website

Re: Wifi keeps disconnecting on KDE

If you want to use NetworkManager then disable iwd.service and follow https://wiki.archlinux.org/title/Networ … Fi_backend instead. Or disable NM and just use IWD by itself: https://wiki.archlinux.org/title/Iwd#En … figuration

You should probably also disable systemd-networkd, although that won't do anything unless configured and it can't authenticate wireless connections by itself anyway.


Para todos todo, para nosotros nada

Offline

#5 2024-01-14 11:11:34

AlwaysFinking
Member
Registered: 2024-01-14
Posts: 19

Re: Wifi keeps disconnecting on KDE

So if I use NetworkManager, I have to disable iwd.service and also setup iwd(that's where the first link goes) as the backend?
The wiki also says iwd backend is experimental.

I'm not sure which one to keep. Is there any benefit of choosing one over the other?

Offline

#6 2024-01-14 12:28:23

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,343
Website

Re: Wifi keeps disconnecting on KDE

You can stick with wpa_supplicant if you want but IWD is more secure because it uses the kernel's cryptographic functions instead of a userspace solution such as openssl (which is used by wpa_supplicant); it also has fewer dependencies.

The Gentoo wiki lists some other benefits of IWD: https://wiki.gentoo.org/wiki/Iwd

I would recommend using iwd by itself. More software == more bugs.


Para todos todo, para nosotros nada

Offline

#7 2024-01-14 12:41:06

AlwaysFinking
Member
Registered: 2024-01-14
Posts: 19

Re: Wifi keeps disconnecting on KDE

Alright. I'mma use iwd.
Do I also have to disable this?

NetworkManager-wait-online.service

Offline

#8 2024-01-14 12:46:47

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,343
Website

Re: Wifi keeps disconnecting on KDE

Not specifically:

NetworkManager.service wrote:
[Install]
WantedBy=multi-user.target
Also=NetworkManager-dispatcher.service

# We want to enable NetworkManager-wait-online.service whenever this service
# is enabled. NetworkManager-wait-online.service has
# WantedBy=network-online.target, so enabling it only has an effect if
# network-online.target itself is enabled or pulled in by some other unit.
Also=NetworkManager-wait-online.service

^ The Also= lines mean that those services will be enabled & disabled in concert with the main service.


Para todos todo, para nosotros nada

Offline

#9 2024-01-14 12:54:49

AlwaysFinking
Member
Registered: 2024-01-14
Posts: 19

Re: Wifi keeps disconnecting on KDE

I followed till 4.3.2 and avoided 4.3.3 as per the wiki Note. These are the new files

~ ❯ sudo cat /var/lib/iwd/spaceship.psk
[IPv4]
Address=192.168.1.10
Netmask=255.255.255.0
Gateway=192.168.1.1
Broadcast=192.168.1.255
DNS=192.168.1.1

~ ❯ cat /etc/iwd/main.conf
[General]
EnableNetworkConfiguration=true

[Network]
RoutePriorityOffset=300

[Network]
EnableIPv6=true

4.3.2 didn't make much sense. What is spaceship.psk and do I need this file?
Another question, what is `RoutePriorityOffset` and do I need to set this?

EDIT: After making these changes I did a reboot. Now the wifi is working but the wifi manager icon is gone from KDE task bar

Last edited by AlwaysFinking (2024-01-14 13:09:18)

Offline

#10 2024-01-14 13:09:54

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,300

Re: Wifi keeps disconnecting on KDE

For the wifi icon in KDE you need to be using NetworkManager.

Online

#11 2024-01-14 13:10:41

seth
Member
Registered: 2012-09-03
Posts: 59,073

Re: Wifi keeps disconnecting on KDE

but the wifi icon is gone from KDE task bar

Because that's networkmanager.

This is a very subjective topic, can choose whatever network daemon suits you best, with the caveat that it has to be *one* (at least per NIC) - that btw. includes systemd-networkd because while it won't manage the carrier, it'll absolutely manage the lease when it gets a carrier (at least it has done son in every related journal I've seen)

Edit: Oh, c'mon.

Last edited by seth (2024-01-14 13:11:04)

Offline

#12 2024-01-14 13:21:21

AlwaysFinking
Member
Registered: 2024-01-14
Posts: 19

Re: Wifi keeps disconnecting on KDE

Okay guys. I switched to NetworkManager and it seems to be working fine along with the wifi manager icon.

Do I disable the `systemd-networkd*` services here?

bluetooth.service                        | bluetooth.target.wants
dbus-org.bluez.service                   | system
dbus-org.freedesktop.network1.service    | system
dbus-org.freedesktop.nm-dispatcher.service | system
dbus-org.freedesktop.resolve1.service    | system
dbus-org.freedesktop.timesync1.service   | system
display-manager.service                  | system
fstrim.timer                             | timers.target.wants
getty@tty1.service                       | getty.target.wants
NetworkManager.service                   | multi-user.target.wants
NetworkManager-wait-online.service       | network-online.target.wants
p11-kit-server.socket                    | sockets.target.wants
pipewire-pulse.socket                    | sockets.target.wants
pipewire-session-manager.service         | user
pipewire.socket                          | sockets.target.wants
remote-fs.target                         | multi-user.target.wants

# disable these?
systemd-networkd.service                 | multi-user.target.wants
systemd-networkd.socket                  | sockets.target.wants
systemd-network-generator.service        | sysinit.target.wants

systemd-resolved.service                 | sysinit.target.wants
systemd-timesyncd.service                | sysinit.target.wants
wireplumber.service                      | pipewire.service.wants
xdg-user-dirs-update.service             | default.target.wants

Offline

#13 2024-01-14 13:25:41

seth
Member
Registered: 2012-09-03
Posts: 59,073

Re: Wifi keeps disconnecting on KDE

Yes. Even if they should not try to configure the NIC, they're just wasting resources at this point.
If you still want to use iwd, https://wiki.archlinux.org/title/Networ … Fi_backend

Offline

#14 2024-01-14 13:26:35

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,343
Website

Re: Wifi keeps disconnecting on KDE

seth wrote:

that btw. includes systemd-networkd because while it won't manage the carrier, it'll absolutely manage the lease when it gets a carrier

Only if the OP has configured it to do so by adding some .network files to /etc/systemd/network/:

systemd-networkd.service(8) wrote:

Any links not matched by one of the .network files will be ignored

But it's pointless having the service enabled if it's not doing anything.


Para todos todo, para nosotros nada

Offline

#15 2024-01-14 13:36:04

AlwaysFinking
Member
Registered: 2024-01-14
Posts: 19

Re: Wifi keeps disconnecting on KDE

seth wrote:

If you still want to use iwd, https://wiki.archlinux.org/title/Networ ...

Wait a minute, I am already using this with Network manager. You're telling me network manager can work without this? Cause I was told above

Head_on_a_Stick wrote:

If you want to use NetworkManager then disable iwd.service and follow https://wiki.archlinux.org/title/Networ

Offline

#16 2024-01-14 13:46:01

AlwaysFinking
Member
Registered: 2024-01-14
Posts: 19

Re: Wifi keeps disconnecting on KDE

Btw thank you Seth, Head_on_a_Stick, V1del for helping me out with this.
You guys are awesome

Offline

#17 2024-01-14 13:52:41

seth
Member
Registered: 2012-09-03
Posts: 59,073

Re: Wifi keeps disconnecting on KDE

NM doesn't provide a wifi carrier, it uses wpa_supplicant (by default) or iwd (optional) for this.
You can choose among them, but have to use them as NM backend. NOT enable their individual services.

Offline

Board footer

Powered by FluxBB