Bug 512315

Summary: Neither side of KDE Connect can find (discover) the other
Product: [Applications] kdeconnect Reporter: John <ilikefoss>
Component: commonAssignee: Albert Vaca Cintora <albertvaka>
Status: REPORTED ---    
Severity: normal CC: andrew.g.r.holmes, aristsakas, kdedev
Priority: NOR    
Version First Reported In: 25.08.1   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description John 2025-11-18 22:30:29 UTC
SUMMARY
Neither side (the Android one or the Linux / Plasma one) of KDE Connect can find (discover) the other.

STEPS TO REPRODUCE
1. Use  a mobile phone with Lineage OS 23.0 (Android 16).
2. Install F-droid.
3. From F-droid, install KDE Connect app.
4. Open Plasma's KDE Connect program.
5. Open Android's KDE Conect app.
6. Try on both of them to see if they see each other.

OBSERVED RESULT
Even though both devices are connected to the same Wi-Fi network, they could not see each other, from either side.

EXPECTED RESULT
They see each other, at least from one side, so I can send a pairing request to the other side.


SOFTWARE/OS VERSIONS
Linux
KDE Plasma Version: 6.5.2 
KDE Frameworks Version: 6.18.0
Qt Version: 6.9.2
KDE Connect (on the laptop): 25.08.1
KDE Connect (on the phone): 1.34.3

HARDWARE VERSIONS
ISP provided router: TP-Link EX220 v1.0 (AP Isolation: Not enabled)

ADDITIONAL INFORMATION
On the laptop no firewall is installed. I checked with Nala (Apt front-end) if firewalld, ufw, opensnitch are installed and I got confirmation that neither of the 3 was installed.

On the phone, a firewall is installed and running and that's AFWall+ (from F-droid too):
https://f-droid.org/en/packages/dev.ukanth.ufirewall/
I have been using it for 10-15 years, until about 2 years ago, when I switched to NetGuard (from F-droid too), that doesn't require superuser (root) permission because it just uses a VPN to work, so it works on all phones.

But I have reverted back to AFWall+ because of NetGuard requiring a VPN, I cannot set up a WireGuard tunnel home or to some other place, as that requires a VPN too and it's impossible to have 2 on Android.
AFWall+ requires superuser (root) permission, which LineageOS has as I have installed at the end of the flashing process also the Magisk add-on, which gives this superuser (root) management for apps that request it and I allow it, which I did for AFWall+.
So AFWall+ has everything it needs and works correctly!
I have created a rule in AFWall+ for KDE Connect app to have the permission to talk on the local network (LAN permission only).
Like I have given it in the past and like I give to Kore too (Kodi's remote) because both KDE Connect and Kore apps should work only in the LAN and this permission in AFWall+ was enough in the past.

After a few minutes of trying and waiting, I have managed to make the connection work by entering the IP address of the laptop in the KDE Connect app for Android, so the rule in the firewall works and it lets KDE Connect on Android talk with the computer just fine.

The only problem is the discovery that remains and for which I opened this bug report!
As I think that should be solved too, even when the user is a power user on Android too and has installed some firewalls, like I did.
And if the firewalls on either side are the problem, then a few informative messages should be added to either or both the KDE connect sides to inform the user what should be allowed through firewall besides the obvious KDE Connect.
AFWall+ allows you to also set the rules for system apps / tools, if you  go to:
Hamburger (3 vertical dots) menu -> Preferences -> UI Preferences -> Tick (check the "Show filters" checkbox.
So I can let other core / system things to go through firewall that KDE Connect needs calls from the system, but I don't know what as there is not info anywhere about that.
Can you please tell me what KDE Connect for Android (in this case the version from F-droid) calls for discovering the computers running Plasma?
As the app is not saying when it's search for devices and I've seen no hints appearing saying it either.
I would like to enable that too in the AFWall+ application firewall, to see if that's the dependency that needs to be allowed in firewall too, so that it fixes this discovery problem.
Comment 1 aristsakas 2026-01-06 10:31:13 UTC

*** This bug has been marked as a duplicate of bug 439228 ***
Comment 2 TraceyC 2026-01-06 18:04:20 UTC
There isn't enough information to say this is the same bug as 439228, removing as a duplicate.
Comment 3 John 2026-01-12 13:03:37 UTC
(In reply to TraceyC from comment #2)
> There isn't enough information to say this is the same bug as 439228,
> removing as a duplicate.

Thank you very much TraceyC!
In the meantime I did a full / clean re-install of LineageOS 23 (Android 16) on my phone and started the pairing again.

I noticed a few things about KDE Connect app on the phone:
It doesn't detect the Wi-Fi being turned OFF!
It doesn't detect the Wi-fi being turned ON, but not connected to any network!
It doesn't detect the AFWall+ firewall being installed and turned on!
It doesn't detect the LAN access rule being OFF (not ticked / checked) in AFWall+ firewall!

Other things that I noticed is that the default device name that KDE Connect uses is the Phone model, like SM-*** instead of using the one that I specified in the Android settings  control panel!
The notification also shows "Request pairing from SM-*** instead of using at least the name that I have manually changed / set in KDE Connect app!

I disabled both AFWall+ (which has been recently been updated to version 4.0.1 after 2 years without updates) on the phone and OpenSnitch (recently updated to version 1.8.0) and even like that, with both disabled, KDE Connect app from the phone cannot find anything initially.

After a while the computer appeared in in the app on the phone and I could send a pairing request.
It's either the temporary enabling of the MDNS services that fixed it or the disabling of both firewalls or all toghether.
I tried to pinpoint it more exactly by  cleaning the app cache + store / uninstall it and then installing it again from F-droid with firewalls being turned on and MDNS not being turned on and it can still find the computer.
I think something remained cached from the first time.
I would still like to have for the app on the phone the Wi-Fi adapter status, the Wi-Fi network connection status, AFWall+ installation status and AFWall+ rule for KDE Connect status detected by the app for the next time this happens.
We cannot figure out which one is blocking this process, especially when there are multiple ones, like in my case:
1. Wi-Fi not being ON.
2. Wi-Fi network not being connected.
3. AFWall+ being installed and KDE Connect not having LAN access.
4. OpenSnitch being installed on the computer and KDE Connect not being allowed.

Without more granular detections and error message is very hard to figure out which is the one or ones that is the culprit.
Comment 4 John 2026-01-12 13:35:30 UTC
To detect the Wi-Fi being OFF, this command can be used:
adb shell dumpsys wifi | grep "Wi-Fi is"
Which will output, when WI-FI is turned ON this:
Wi-Fi is enabled
And will output, when WI-FI is turned OFF this:
Wi-Fi is disabled
Taken from here:
https://stackoverflow.com/a/65118548
The recommended command there:
adb shell dumpsys wifi | sed -n '1p'
Doesn't work for me as it just gives this output:
Verbose logging is on

Or easier, this command:
adb shell settings get global wifi_on
Which gives for Wi-Fi being ON this output:
1
And for Wi-Fi being OFF this output:
0
Taken from this answer on the same page:
https://stackoverflow.com/a/57382829

I'm yet to figure out how to check if the phone is connected to any network.
As in my case, even though the Auto-reconnect option is enabled, it refuses to connect to the home network automatically after enabling the Wi-Fi.