←back to thread

475 points snthd | 1 comments | | HN request time: 0.201s | source
Show context
roshin ◴[] No.45567872[source]
when it works it's amazing. but very often both my phone and laptop are connected to the same WiFi, yet kde connect can't see them. I can't figure out how to diagnose and solve that when it happens
replies(14): >>45568298 #>>45568302 #>>45574832 #>>45654362 #>>45654425 #>>45654451 #>>45654843 #>>45655274 #>>45655852 #>>45655866 #>>45655896 #>>45657950 #>>45661121 #>>45661674 #
1. Self-Perfection ◴[] No.45657950[source]
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