KDE connect never stays connected to android phone for very long

Hi, Well i would have put money on it being the androids power management, but that wouldn’t answer how logging out and back in on my desktop will then connect to the phone fine without me needing to touch the phone.

Nop

Does the same on both my current Samsung a34 & my Huawei P30. I will have a look at the power management again though.

Its been acting really odd tonight, its still connected and iv been waiting for it to disconnect again since this afternoon so i can run some requested tests. Iv never seen it last this long without disconnecting before. O well, a watched pot never boils.

I’m curious whether you actually tried this longshot, and after a reboot or two, if it might be responsible for the surprising connection longevity.

Since you refuse to give the information that is requested to help you solve this, I suggest you close the thread.

I think you confused this with the other thread currently in limbo. :wink:

? I do have to sleep on occasion, you chatize me for not posting at 02:00 in the morning?. I didnt realize i was on a clock. Its now 07:34 in the morning. Iv just got up if that’s ok with you? It’s just disconnected again, which was what i was waiting for anyhow. But god how rude.

Anyhow, Morning all (others).

As i say iv just pulled it out of suspend and its not connected again. I have the data requested by @Pippin

This is when it was working fine last night :-

❱ip neigh show
192.168.1.104 dev wlp2s0 lladdr c6:34:6b:5c:68:45 STALE 
192.168.1.3 dev wlp2s0 lladdr 24:11:53:77:97:27 REACHABLE 
192.168.1.100 dev wlp2s0 lladdr c4:34:6b:65:b3:32 STALE 
192.168.1.1 dev wlp2s0 lladdr 9c:53:22:17:e0:13 REACHABLE 
fe80::9e53:22ff:fe17:e013 dev wlp2s0 lladdr 9c:53:22:17:e0:13 router DELAY

❱ss -atunp | grep -i connect
udp   UNCONN    0      0                                       *:1716                       *:*     users:(("kdeconnectd",pid=281773,fd=16)) 
tcp   LISTEN    0      50                                      *:1716                       *:*     users:(("kdeconnectd",pid=281773,fd=17)) 
tcp   ESTAB     0      0                  [::ffff:192.168.1.110]:38976   [::ffff:192.168.1.3]:1716  users:(("kdeconnectd",pid=281773,fd=29)) 


After resume from sleep this mornning it is disconnected.


❱ip neigh show
192.168.1.104 dev wlp2s0 lladdr c6:34:6b:5c:68:45 REACHABLE
192.168.1.3 dev wlp2s0 lladdr 24:11:53:77:97:27 STALE
192.168.1.100 dev wlp2s0 lladdr c4:34:6b:65:b3:32 REACHABLE
192.168.1.1 dev wlp2s0 lladdr 9c:53:22:17:e0:13 REACHABLE
fe80::9e53:22ff:fe17:e013 dev wlp2s0 lladdr 9c:53:22:17:e0:13 router STALE

❱ss -atunp | grep -i connect
udp   UNCONN    0      0                                       *:1716                       *:*     users:(("kdeconnectd",pid=281773,fd=16))
tcp   LISTEN    0      50                                      *:1716                       *:*     users:(("kdeconnectd",pid=281773,fd=17))

Someone asked if i can ping the phone when it is disconnected. yep i can.

❱ping 192.168.1.3
PING 192.168.1.3 (192.168.1.3) 56(84) bytes of data.
64 bytes from 192.168.1.3: icmp_seq=1 ttl=64 time=28.7 ms
64 bytes from 192.168.1.3: icmp_seq=2 ttl=64 time=57.3 ms

I did delete the configs last night and recreate the pairing but since it remained connected up until now i couldn’t really say if it worked or not but as you say it was a long shot but was worth a try.

I’ll chime in again if I think of anything else. Good luck.

1 Like

So i tried kdeconnect-cli --refresh and also refreshing the app on the phone but alas, it didn’t work :cry:

However, when i log out and back in on the desktop, it connects again. I don’t have to touch the phone, which is why I can’t really see it being the phone’s power management. I shall take a harder look at the phone though, maybe try these apps suggested.

It does seem to me to be more about the desktop going into suspend than the phone, but i don’t know.

I don’t know what else to try.

As far as I know android-udev is needed for android phones to connect to manjaro

I shall install it, but it connects without it, it connected right now. But, I shall try everything. Thx.

I don’t think this is related, unless android-udev-rules is needed for Android Studio development.

Ofc not.
You posted 2 replies after our request for info.

Stale…

Not here to argue, I wanted to help you but that will is gone now.

Good luck!

O so it was directed at me ^^, I had thought it was most likely a mistake and then when @soundofthunder posted at the same time as my post & confirmed that he/she also thought it must be by mistake, i was sure it was just that, a mistake. If i had been you i would have said ahh yea i did post in the wrong thread, sorry even if i had not because it does not look good.

And? I was still waiting for it to disconnect again, how could i comment without anything to comment on? Jesus.

Some people :crazy_face:

Well on cinnamon my android phone will not connect without it and no I do not have toi configure any udev rules.

Perhaps it’s needed for some. I understand it’s needed for Android development, as mentioned, but apart from that I haven’t seen much reference to it. If the OP finds anything definitive on the topic that actually helps the situation, I’ll gladly retract my observation. :slight_smile:

Regarding the associated android-udev-rules package, that was in relation to Android Studio development, as mentioned, and would likely not be related to any possible use as you describe. Cheers.

Well there is certainly no harm in installing it regardless, so i have. If there is any change i shall ofc let you know, it’s still connected since this morning’s “wakeup”, i bet the next time i loose it will be after the desktop has been asleep next, its looking that way.

Although, i have tried suspending & waking it manually several times, but it remains connected when i do that. Is very odd.

1 Like

both samsung and huawei are notorious for booting out apps for no reason other than saving battery juice while letting their bloatware roam free.

i wouldn’t necessary say kdeconnect should work hiccup-less everytime, but certain measures might drastically improve you success rates

  • set battery restrictions on kde-connect app to unrestricted
  • also set it to “auto-start” whenever android kernel kills it
  • KDE Connect uses dynamic ports in the range 1714-1764 for UDP and TCP so make sure it is available if you are using a firewall

whenever it disconnects, if it connects as soon as you relaunch the kde-connect app, then that is your devices handiwork. however if it stays elusive even after launching the app, then instead of “refresh” try just clicking on “pair new” that solves it for me most of the time. from the linux desktops end, i use commands;

kdeconnect-cli --refresh && kdeconnect-cli -l

yep, already done.

Not sure i have that option on Samsung a34 android 13?

All clear, in fact i dont use a firewall.

I have tried force closing the android app and then opening it, didnt help.
I tried the pull-down on the android app screen “refresh” many many times it just will not reconnect.
I have been using killall kdeconnectd && kdeconnect-cli --refresh to try to restart the desktop app.

I can “force” it by unpairing on either the phone or the desktop and then recreating the pair.
Plus if i logout and back in the user on the desktop it also usually reconnects.

I have been through all these below, on the phone

Android 13 (Samsung)

The settings are mostly the same as Android 11 below, with a few changes:

The “Optimize battery usage” option doesn’t exist anymore under “Special Access”.
Under “Device Care” there is no “Automation” or “Advanced” option anymore.

So the existing options to change would be:

The per-app setting.
Adaptive battery.
Put unused apps to sleep.

I shall keep tinkering and searching but its been like this for as long as i can remember. It was the same on my Inspiron laptop and on my Hauwawi p30. It was just one of them things that would have been really nice to work but i never got around to asking about. I was kinda hoping that people might just say “ahh yes, we know of this problem and there’s a well known fix or it’s just the way it is”.

I appreciate all the suggestions of roads for me to take a look down. Cheers all.

Exactly, look in a mirror.

But THIS person (me), is one last time going to point you towards your problem. I’m a little surprised nobody else spotted it even though I pointed it out.

3 REACHABLE and 1 STALE. I WONDER what device 192.168.1.3 is… :thinking: :vibration_mode: :phone: :+1:
Even though your attitude is :crazy_face: I will hand you this one.
After all, it’s christmas. :christmas_tree:

As for a solution, probably look at your router or phone.

Yes we did all see it, we all know that 192.168.1.3 is the phone, we all know the connection is no longer active or has become inactive and possibly has not been properly closed or terminated. So nobody missed it.

ok, I’m listening, although why i would since you just came back to insult me again and double down on how I’m wrong, and how you didn’t start this by blatantly insulting me for no good reason.

Because i haven’t been doing that all day. /sarc

Seriously though, please have a great Christmas and a productive new year. I wouldn’t hold a grudge to even my worst enemy over xmas :christmas_tree: :santa: :gift:

So again this morning the desktop wakes from sleep and its not connected. (and refuses to connect)

Heres an odd thing though

❱kdeconnect-cli --refresh

⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼ /home/greg ⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼
❱kdeconnect-cli -l
- Galaxy A34 5G: 8f58ee84_a01f_4300_9af4_596aefa37e1b (paired)
1 device found

but :-
Screenshot_20231222_100151

But it is reachable.

❱ping 192.168.1.3
PING 192.168.1.3 (192.168.1.3) 56(84) bytes of data.
64 bytes from 192.168.1.3: icmp_seq=1 ttl=64 time=46.1 ms
64 bytes from 192.168.1.3: icmp_seq=2 ttl=64 time=7.76 ms
64 bytes from 192.168.1.3: icmp_seq=3 ttl=64 time=6.85 ms

So it’s definitely when the desktop goes to sleep for a length of time. Although it could still be the phone’s power management as well, it could be both, who can say :frowning_face: