← Back to context

Comment by Self-Perfection

4 months ago

It has really got unreliable in my experience.

Often desktop client just cannot connect to mobile. At first I noticed that this happens when desktop client starts to output in logs these (reported [1]):

  kdeconnect.core: Too many remembered identities, ignoring "<id of KDE Connect on my android device>" received via UDP

Restarting desktop client helped, so I wrote watcher that monitors logs for such lines and restarts kdeconnect. But it turned out to be insufficient. Now I have this script running in background to restart kdeconnectd whenever connection is missing, and finally can use KDE Connect reliably:

  #!/bin/dash -x
  
  
  while sleep 1m; do
      nmcli connection show --active | grep wifi || continue
  
      kdeconnect-cli -l | grep reachable && continue
  
  
  #   notify-send 'No reachable devices via kdeconnect. Restarting'
      systemctl --no-pager --user status app-org.kde.kdeconnect.daemon@autostart.service
      systemctl --no-pager --user stop app-org.kde.kdeconnect.daemon@autostart.service
      killall kdeconnectd
      systemctl --no-pager --user start app-org.kde.kdeconnect.daemon@autostart.service
  
  done

[1] https://bugs.kde.org/show_bug.cgi?id=506563