Bug 461083 - KDE Connect doesn't reconnect to device after powering the PC on
Summary: KDE Connect doesn't reconnect to device after powering the PC on
Status: REPORTED
Alias: None
Product: kdeconnect
Classification: Applications
Component: common (other bugs)
Version First Reported In: 22.08.2
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Albert Vaca Cintora
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-27 19:24 UTC by qsabipb02
Modified: 2023-05-30 09:58 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description qsabipb02 2022-10-27 19:24:55 UTC
### SUMMARY
***
My Android phone gets disconnected (or actually becomes unavailable) from KDE Connect after my desktop loses some power to sleep, reboot or shutdown. It has been happening for so long! The mobile app has battery optimization turned off, even so it keeps disconnecting from the PC app. It doesn't unpair, thankfully, unlike in another bug case, but I have to turn
the phone screen on and unlock it to get availability back, and this is inconvenient and forgettable!

I read somewhere that this is a problem with Android 11, but if that were the case, the Micro$oft app Phone Link I used
back on Windows would disconnect too upon every sleep or reboot, and it didn't! Therefore it's a kdeconnect bug that
needs to be fixed.

I love KDE Connect! It's way better than Phone Link, plus it's free software that doesn't spy on you. This is the one
and only major problem I found on it, for sure, and I hope it gets fixed soon.
***


STEPS TO REPRODUCE
1. Open KDE Connect plasmoid (or application) on PC
2. Shutdown, reboot or sleep the PC.
3. Turn it back on and look at the system tray.

OBSERVED RESULT
KDE Connect doesn't automatically reconnect, saying "paired device is unavailable" instead. I have to turn the phone
screen on and even unlock it to make it available again.

EXPECTED RESULT
Said app would reconnect automatically, not requiring manual intervention from the user.

SOFTWARE/OS VERSIONS
Linux: 6.0.2-arch1-1 (64-bit)
KDE Plasma Version:  5.26.2
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.6
KDE Connect: 22.08.2 (PC); 1.19.1 (phone)

ADDITIONAL INFORMATION
It has happened on Kubuntu and Arch Linux, and it even happened on XFCE with KDE Connect installed. I don't recall
correctly if it happened with GSConnect on Ubuntu, but maybe it did, because of the shared codebase, or maybe not
because Gnome developers may've fixed this already, but not upstream.
Comment 1 Michael 2023-02-11 12:20:29 UTC
have you tried, on your phone, setting the screen not to sleep when USB connection is active? 
or any other phone configuration which might shutting down the usb port for any reason

when the phone is not set to stay active or just dimmed happens what you apparently are saying, there is eventually a charging battery setting for holding the screen dimmed while charging, that can also help

if there's is no setting, activate developer mode where you can find then more usb related settings
Comment 2 qsabipb02 2023-02-12 17:24:07 UTC
(In reply to Michael from comment #1)
> have you tried, on your phone, setting the screen not to sleep when USB
> connection is active? 
> or any other phone configuration which might shutting down the usb port for
> any reason
> 
> when the phone is not set to stay active or just dimmed happens what you
> apparently are saying, there is eventually a charging battery setting for
> holding the screen dimmed while charging, that can also help
> 
> if there's is no setting, activate developer mode where you can find then
> more usb related settings

I've found some configurations there, but I don't think they'll help much, because KDE Connect uses LAN, rather than USB, to connect to PCs. Maybe it's a problem in some network scan module? like, the app can't find the phone straight away because it doesn't rescan the LAN or something.

If it were a problem with the phone config, it would keep getting disconnected every time the phone screen sleeps or dims, but it only happens after my PC wakes up or powers on. It has never happened back on Gnome when I used GSConnect, so I am pretty sure it's a problem somewhere in KDE Connect, don't you agree?
Comment 3 Michael 2023-02-12 21:20:12 UTC
(In reply to qsabipb02 from comment #2)
> (In reply to Michael from comment #1)
> > have you tried, on your phone, setting the screen not to sleep when USB
> > connection is active? 
> > or any other phone configuration which might shutting down the usb port for
> > any reason
> > 
> > when the phone is not set to stay active or just dimmed happens what you
> > apparently are saying, there is eventually a charging battery setting for
> > holding the screen dimmed while charging, that can also help
> > 
> > if there's is no setting, activate developer mode where you can find then
> > more usb related settings
> 
> I've found some configurations there, but I don't think they'll help much,
> because KDE Connect uses LAN, rather than USB, to connect to PCs. Maybe it's
> a problem in some network scan module? like, the app can't find the phone
> straight away because it doesn't rescan the LAN or something.
> 
> If it were a problem with the phone config, it would keep getting
> disconnected every time the phone screen sleeps or dims, but it only happens
> after my PC wakes up or powers on. It has never happened back on Gnome when
> I used GSConnect, so I am pretty sure it's a problem somewhere in KDE
> Connect, don't you agree?

so your phone is connected via LAN (Eth)?
read again what you wrote: " I have to turn the phone screen on and unlock it to get availability back"
I also think that Kde Connect is to connect a phone to the computer, not for PC-PC
Comment 4 qsabipb02 2023-03-11 17:36:53 UTC
(In reply to Michael from comment #3)
> (In reply to qsabipb02 from comment #2)
> > (In reply to Michael from comment #1)
> > > have you tried, on your phone, setting the screen not to sleep when USB
> > > connection is active? 
> > > or any other phone configuration which might shutting down the usb port for
> > > any reason
> > > 
> > > when the phone is not set to stay active or just dimmed happens what you
> > > apparently are saying, there is eventually a charging battery setting for
> > > holding the screen dimmed while charging, that can also help
> > > 
> > > if there's is no setting, activate developer mode where you can find then
> > > more usb related settings
> > 
> > I've found some configurations there, but I don't think they'll help much,
> > because KDE Connect uses LAN, rather than USB, to connect to PCs. Maybe it's
> > a problem in some network scan module? like, the app can't find the phone
> > straight away because it doesn't rescan the LAN or something.
> > 
> > If it were a problem with the phone config, it would keep getting
> > disconnected every time the phone screen sleeps or dims, but it only happens
> > after my PC wakes up or powers on. It has never happened back on Gnome when
> > I used GSConnect, so I am pretty sure it's a problem somewhere in KDE
> > Connect, don't you agree?
> 
> so your phone is connected via LAN (Eth)?
> read again what you wrote: " I have to turn the phone screen on and unlock
> it to get availability back"
> I also think that Kde Connect is to connect a phone to the computer, not for
> PC-PC

No, it is connected via Wi-Fi as usual. By LAN I meant my home's network.

I would like to update that issue by saying that unlocking the phone is not necessary, as only turning the screen on is enough for KDE Connect on my PC to connect to its app on my phone. I read it and I know it, but it's still inconvenient, considering that the connection to the phone should be easily restored after the PC wakes up or powers on.

Yes, that's its purpose, it doesn't support PC to PC connection. But that doesn't matter, because I have only one PC at home, which is the desktop I am using now to write this. I think you got confused with the "LAN" (or "eth") part; no, I'm not using it on a laptop. It's on my Android.

Is there any fix or plan to fix that connection issue?
Comment 5 Albert Vaca Cintora 2023-03-23 17:51:51 UTC
Reconnection on Android 9+ should be much better since https://invent.kde.org/network/kdeconnect-android/-/commit/fd34e56675dd7e982e22abb051400804ab5ede67 

Please reopen if it isn't.
Comment 6 zyf0330 2023-05-30 09:58:14 UTC
I never meet this problem on the Linux platform. But I always meet this problem on Windows platform, it have been several years, from daily-built exe to Windows Store App.