Reply to topic

Help me diagnose KDE Connect connection issues

equaeghe
Registered Member
Posts
50
Karma
0
OS
I have trouble getting my laptop and phone paired with KDE Connect. This used to work in the past, but it seems something changed and now I can't pair any devices anymore. I have a tablet and installed the KDE Connect also there, but also it won't pair. I have tried both with my laptop firewall on (with ports 1714-1764 open for tcp and udp) and off. I tried on my home and work network. I tried by adding the ip-address. It all doesn't work.

I would like to diagnose what the issue is. Given that I have tried with two different Android devices with two different versions of Android (5 and 8), my feeling is that the problem is at the laptop, but that is just a hunch.
j8a
Registered Member
Posts
156
Karma
0
OS
Hi,
Did you open KDE connect in your phone search for your laptop, send the signal connection and accept it on the laptop?
I also use KDE Connect and I installed KDE Connect app from google play on my phone but I could not did the same on my tablet although the google play download section said I could install the software in both devices.
By the way, did you try to remove KDE Connect from your laptop and the phone?. After reeboting both devices try to install the software again. It is not a high tech advice but seems the first to try.
Hope it helps,
tzell
Registered Member
Posts
22
Karma
0
OS
I have been in the same boat a while back. Couldn't connect and spend hours to look for troubleshooting help.
Here's what I came up with:

1. Obvious but important, both devices need to be on the same network

2. Is the kdeconnect process running:
ps -ef | grep kdeconnect

Example output:
user 3399 1 0 08:26 ? 00:00:02 /usr/lib/x86_64-linux-gnu/libexec/kdeconnectd

3. Is the process listening?
sudo netstat -tunelp | grep -i kdeconnect

Example output
tcp6 0 0 :::1716 :::* LISTEN 1000 36999 3399/kdeconnectd
udp6 39936 0 :::1716 :::* 1000 36998 3399/kdeconnectd

4. Maybe your firewall gets in the way?
Is the firewall running?
sudo ufw status
If yes, turn it off for the test
sudo ufw disable

5. Are the ports open/blocked?
netcat -z -v <your-phones-ip> 1714-1764 # Try phone and laptop, use port which netstat shows

Example output:
Connection to <your -phones-ip> 1716 port [tcp/*] succeeded!
+ lots of Connection refused, but you need 1 "succeeded"

6. Check the kdeconnect home dir
ls -al /home/<user>/.config/kdeconnect/

7. Check CLI interface
kdeconnect-cli
j8a
Registered Member
Posts
156
Karma
0
OS
Hi, tzell
I read your post and the command output you proposed gave the following results:
1. Devices are connected to the same network
2.
[email protected]:~$ ps -ef | grep kdeconect
jochoa 3404 1737 0 10:26 pts/1 00:00:00 grep --color=auto kdeconect

3.
sudo netstat -tunelp | grep -i kdeconnect
tcp6 0 0 :::1716 :::* LISTEN 1000 27012 1758/kdeconnectd
udp6 9600 0 :::1716 :::* 1000 27011 1758/kdeconnectd

4. I have no firewall installed
systemctl status ufw.service
● ufw.service - Uncomplicated firewall
Loaded: loaded (/lib/systemd/system/ufw.service; enabled; vendor preset: enabled)
Active: active (exited) since Tue 2018-10-02 09:38:17 -03; 52min ago
Docs: man:ufw(8)
Process: 307 ExecStart=/lib/ufw/ufw-init start quiet (code=exited, status=0/SUCCESS)
Main PID: 307 (code=exited, status=0/SUCCESS)
oct 02 09:38:17 jochoapc systemd[1]: Started Uncomplicated firewall.
Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.

5. Are ports blocked?
netcat -z -v 192.168.2.54 1716
netcat: connect to 192.168.2.54 port 1716 (tcp) failed: Connection refused

6. Checking connection
ls -la /home/jochoa/.config/kdeconnect/
total 24
drwxrwxr-x 3 jochoa jochoa 4096 sep 6 14:32 .
drwx------ 21 jochoa jochoa 4096 oct 2 09:56 ..
drwxrwxr-x 5 jochoa jochoa 4096 sep 12 18:18 2ee950fb4f088b38
-rw------- 1 jochoa jochoa 1220 may 31 13:48 certificate.pem
-rw------- 1 jochoa jochoa 1704 may 31 13:48 privateKey.pem
-rw-rw-r-- 1 jochoa jochoa 1169 sep 6 14:32 trusted_devices

kdeconnect-cli -l
- nubia: 2ee950fb4f088b38 (vinculado) (binded)
1 dispositivo encontrado (device found)

Could you explain me why the 1716 port is blocked and refusing connection, although the device is found and binded to Kdeconnect?
Regards
tzell
Registered Member
Posts
22
Karma
0
OS
I am not an expert myself but what I noticed is that under #4 you mentioned that you have no firewall installed, but yet when you run
Code: Select all
systemctl status ufw.service
it says it's loaded and active?
You may want to try to stop the firewall for your testing.
Code: Select all
sudo systemctl stop ufw.service

A running firewall would be a good reason why your port 1716 is blocked.

I wrote down the below commands to enable the port, but I noticed you were using "systemctl status ufw.service" and not ufw status like I mentioned in my initial post. And it looks like your's is the more current approach to ufw as on my machines ufw status gives me inactive, whereas systemctl status ufw.service shows active.
So I guess you need to adapt the comands above to systemctl, something similar to "systemctl allow 1716/tcp ufw.service" to enable the port.
Code: Select all
sudo ufw allow 1716:1764/udp
sudo ufw allow 1716:1764/tcp
sudo ufw reload


By the way, you got a typo in #2, you missed the second "n" in kdeconnect which is why grep didn't find your running process. But we now know the process is running from the netstat output.
j8a
Registered Member
Posts
156
Karma
0
OS
Hi, tzell
You are right at the missprint
ps -ef | grep kdeconnect
jochoa 1758 923 0 09:39 ? 00:00:03 /usr/lib/x86_64-linux-gnu/libexec/kdeconnectd
jochoa 3066 1236 0 09:54 ? 00:00:10 /usr/bin/dolphin kdeconnect://2ee950fb4f088b38
jochoa 19753 1737 0 13:38 pts/1 00:00:00 grep --color=auto kdeconnect

sudo netstat -tunelp | grep kdeconnect
tcp6 0 0 :::1716 :::* LISTEN 1000 27012 1758/kdeconnectd
udp6 12928 0 :::1716 :::* 1000 27011 1758/kdeconnectd

My ufw is not enable but I run
sudo systemctl stop ufw.service

Now, I think I may be missprint the ip number the first time.
netcat -z -v 192.168.2.94 1716
Connection to 192.168.2.94 1716 port [tcp/*] succeeded!

The device was found without any problem. Thanks in advance.
kdeconnect-cli -l
- nubia: 2ee950fb4f088b38 (vinculado y accesible)
1 dispositivo encontrado
j8a
Registered Member
Posts
156
Karma
0
OS
For now what I am doing is kill -9 kdeconnectd. Once I open KDE connect (not the widget) it restarts and it works fine.
emper
Registered Member
Posts
2
Karma
0
I also had trouble making a connection between my computer and phone. I have 2 computers running kubuntu 18.04. One worked fine (#1), The other computer (#2) didn't show up on the phone "available devices" and the phone didn't show up on the computer device list.
It was not a problem with firewalls.
By going through the settings and comparing the settings of #1 and #2 I saw that a difference was in the ~/config/kdeconnect/config.
I deleted ~/config/kdeconnect
Restarted kdeconnectd
And it worked,

Try deleting ~/config/kdeconnect.
alex_091
Registered Member
Posts
9
Karma
0
It may help you too: I had kdeconnect crashing randomly. I disabled the "receive notification" plugin from the desktop and it works perfectly and continuously. Even after suspend/resume.
Funny thing: I still receive mobile notification on my desktop
j8a
Registered Member
Posts
156
Karma
0
OS
Hi alex_091,
This is not a perfect world although it is approaching slowly.
Since I have Plasma 5.14.1 I have no issues related with KDE Connect.
Regards,
equaeghe
Registered Member
Posts
50
Karma
0
OS
Hmm, I have the needed ports open, but still it doesn't work unless I deactivate my firewall temporarily. Are there any other ports than 1714-1764 needed?
j8a
Registered Member
Posts
156
Karma
0
OS
Hi equaeghe,
I run de command
ps -ef | grep kdeconnect

jochoa 1758 923 0 09:39 ? 00:00:03 /usr/lib/x86_64-linux-gnu/libexec/kdeconnectd
and from this line the port is 1758, I do not know what ports are showing in your machine.

Hope it helps,
equaeghe
Registered Member
Posts
50
Karma
0
OS
j8a wrote:I run de command
Code: Select all
ps -ef | grep kdeconnect

jochoa 1758 923 0 09:39 ? 00:00:03 /usr/lib/x86_64-linux-gnu/libexec/kdeconnectd
and from this line the port is 1758, I do not know what ports are showing in your machine.

Isn't that just the PID? That's totally unrelated, no?
In any case, I get
Code: Select all
equaeghe 19434 18632  0 12:10 pts/0    00:00:04 /usr/lib64/libexec/kdeconnectd
j8a
Registered Member
Posts
156
Karma
0
OS
I apologize for the misunderstanding. I am very sorry. xD

 
Reply to topic

Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], boudewijn, cylverbak, eaglefeather, Google [Bot], JesusM, lesturner, Majestic-12 [Bot], P3lor, Stephen Leibowitz, Willov, Yahoo [Bot], zachalexy