GSConnect / gnome-shell-extension-gsconnect

KDE Connect implementation for GNOME
GNU General Public License v2.0
3.23k stars 259 forks source link

Unable to connect to multiple instances of gsconnect #26

Closed ghost closed 6 years ago

ghost commented 6 years ago

gsconnect won't allow me to connect to a device already paired with gsconnect on a different computer. Trying to pair my phone with both a laptop and a desktop on the same network.

JS LOG: Error connecting: Gio.TlsError: Peer sent fatal TLS alert: Unknown certificate
JS LOG: Disconnected from 'Nexus 5x'
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._removeDevice(/org/gnome/Shell/Extensions/GSConnect/Device/c450b34d86d9965a)
JS LOG: Daemon: Removing device
JS LOG: [gsconnect@andyholmes.github.io]: Daemon: Notify()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon: Notify()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon: Notify()
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.send()
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(lafiel)
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.send()
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(lafiel)
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(Nexus 5x)
JS LOG: Daemon: Adding device
JS LOG: [gsconnect@andyholmes.github.io]: Device.activate(c450b34d86d9965a)
JS LOG: Connecting to 'c450b34d86d9965a'
JS LOG: [gsconnect@andyholmes.github.io]: Device.activate(c450b34d86d9965a)
JS LOG: [gsconnect@andyholmes.github.io]: device already active
JS LOG: Error connecting: Gio.TlsError: Peer sent fatal TLS alert: Unknown certificate
JS LOG: Disconnected from 'Nexus 5x'
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._removeDevice(/org/gnome/Shell/Extensions/GSConnect/Device/c450b34d86d9965a)
JS LOG: Daemon: Removing device
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(Nexus 5x)
JS LOG: Daemon: Adding device
JS LOG: [gsconnect@andyholmes.github.io]: Device.activate(c450b34d86d9965a)
JS LOG: Connecting to 'c450b34d86d9965a'
JS LOG: [gsconnect@andyholmes.github.io]: Device.activate(c450b34d86d9965a)
JS LOG: [gsconnect@andyholmes.github.io]: device already active
JS LOG: Error connecting: Gio.TlsError: Peer sent fatal TLS alert: Unknown certificate
JS LOG: Disconnected from 'Nexus 5x'
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._removeDevice(/org/gnome/Shell/Extensions/GSConnect/Device/c450b34d86d9965a)
JS LOG: Daemon: Removing device
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(Nexus 5x)
JS LOG: Daemon: Adding device
JS LOG: [gsconnect@andyholmes.github.io]: Device.activate(c450b34d86d9965a)
JS LOG: Connecting to 'c450b34d86d9965a'
JS LOG: [gsconnect@andyholmes.github.io]: Device.activate(c450b34d86d9965a)
JS LOG: [gsconnect@andyholmes.github.io]: device already active
JS LOG: Error connecting: Gio.TlsError: Peer sent fatal TLS alert: Unknown certificate
JS LOG: Disconnected from 'Nexus 5x'
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._removeDevice(/org/gnome/Shell/Extensions/GSConnect/Device/c450b34d86d9965a)
JS LOG: Daemon: Removing device
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(Nexus 5x)
JS LOG: Daemon: Adding device
JS LOG: [gsconnect@andyholmes.github.io]: Device.activate(c450b34d86d9965a)
JS LOG: Connecting to 'c450b34d86d9965a'
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(Nexus 5x)
JS LOG: Daemon: Updating device
JS LOG: Received from 'Nexus 5x'
JS LOG: [gsconnect@andyholmes.github.io]: Device.activate(c450b34d86d9965a)
JS LOG: [gsconnect@andyholmes.github.io]: device already active
JS LOG: [gsconnect@andyholmes.github.io]: Device.activate(c450b34d86d9965a)
JS LOG: [gsconnect@andyholmes.github.io]: device already active
JS LOG: Error connecting: Gio.TlsError: Peer sent fatal TLS alert: Unknown certificate
JS LOG: Disconnected from 'Nexus 5x'
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._removeDevice(/org/gnome/Shell/Extensions/GSConnect/Device/c450b34d86d9965a)
JS LOG: Daemon: Removing device
JS LOG: [gsconnect@andyholmes.github.io]: Daemon: Notify()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon: Notify()
andyholmes commented 6 years ago

This seems to be an error on the Android app side, although I've never tested this before.

I'll try and find a second computer later today to see if I can confirm this.

ghost commented 6 years ago

The certs are there, and aren't copied from anywhere else

12-29 16:33:35.944 I/KDE/LanLinkProvider( 5483): Identity package received from a TCP connection from lafiel
12-29 16:33:35.945 I/KDE/LanLinkProvider( 5483): Starting SSL handshake with lafiel trusted:true
12-29 16:33:36.024 E/KDE/LanLinkProvider( 5483): Handshake failed with lafiel
12-29 16:34:40.255 I/KDE/LanLinkProvider( 5483): Identity package received from a TCP connection from lafiel
12-29 16:34:40.255 I/KDE/LanLinkProvider( 5483): Starting SSL handshake with lafiel trusted:true
12-29 16:34:40.342 E/KDE/LanLinkProvider( 5483): Handshake failed with lafiel
12-29 16:34:47.543 I/KDE/LanLinkProvider( 5483): Broadcast identity package received from lafiel
12-29 16:34:47.556 I/KDE/LanLinkProvider( 5483): Starting SSL handshake with lafiel trusted:true
12-29 16:34:47.643 E/KDE/LanLinkProvider( 5483): Handshake failed with lafiel
12-29 16:34:55.510 I/KDE/LanLinkProvider( 5483): Identity package received from a TCP connection from lafiel
12-29 16:34:55.510 I/KDE/LanLinkProvider( 5483): Starting SSL handshake with lafiel trusted:true
12-29 16:34:55.587 E/KDE/LanLinkProvider( 5483): Handshake failed with lafiel
12-29 16:36:42.218 I/KDE/LanLinkProvider( 5483): Identity package received from a TCP connection from lafiel
12-29 16:36:42.219 I/KDE/LanLinkProvider( 5483): Starting SSL handshake with lafiel trusted:true
12-29 16:36:42.325 E/KDE/LanLinkProvider( 5483): Handshake failed with lafiel
12-29 15:08:07.835 W/System.err( 5483):     at org.kde.kdeconnect.Backends.LanBackend.LanLinkProvider$4.run(LanLinkProvider.java:247)
12-29 15:08:09.751 W/System.err( 5483):     at org.kde.kdeconnect.Backends.LanBackend.LanLinkProvider$4.run(LanLinkProvider.java:247)
12-29 16:20:34.826 W/System.err( 5483):     at org.kde.kdeconnect.Backends.LanBackend.LanLinkProvider$4.run(LanLinkProvider.java:247)
12-29 16:20:41.987 W/System.err( 5483):     at org.kde.kdeconnect.Backends.LanBackend.LanLinkProvider$4.run(LanLinkProvider.java:247)
12-29 16:31:33.816 W/System.err( 5483):     at org.kde.kdeconnect.Backends.LanBackend.LanLinkProvider$4.run(LanLinkProvider.java:247)
12-29 16:33:04.515 I/ActivityManager( 2795): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 pkg=org.kde.kdeconnect_tp cmp=org.kde.kdeconnect_tp/org.kde.kdeconnect.UserInterface.MaterialActivity} from uid 1000 on display 0
12-29 16:33:04.939 I/ActivityManager( 2795): Displayed org.kde.kdeconnect_tp/org.kde.kdeconnect.UserInterface.MaterialActivity: +397ms
12-29 16:33:05.083 W/System.err( 5483):     at org.kde.kdeconnect.Backends.LanBackend.LanLinkProvider$4.run(LanLinkProvider.java:247)
12-29 16:33:36.024 W/System.err( 5483):     at org.kde.kdeconnect.Backends.LanBackend.LanLinkProvider$4.run(LanLinkProvider.java:247)
12-29 16:34:40.343 W/System.err( 5483):     at org.kde.kdeconnect.Backends.LanBackend.LanLinkProvider$4.run(LanLinkProvider.java:247)
12-29 16:34:47.643 W/System.err( 5483):     at org.kde.kdeconnect.Backends.LanBackend.LanLinkProvider$4.run(LanLinkProvider.java:247)
12-29 16:34:55.588 W/System.err( 5483):     at org.kde.kdeconnect.Backends.LanBackend.LanLinkProvider$4.run(LanLinkProvider.java:247)
12-29 16:36:42.325 W/System.err( 5483):     at org.kde.kdeconnect.Backends.LanBackend.LanLinkProvider$4.run(LanLinkProvider.java:247)
andyholmes commented 6 years ago

Starting SSL handshake with lafiel trusted:true

The Android app seems to think that it's paired with GSConnect on this device, did you manage to pair it before encountering problems? If so have you tried unpairing and repairing?

ghost commented 6 years ago

It's never been paired with that computer, it's actually a brand new phone. That said, on my previous phone and my tablet, if I unpair and then shutdown the computer I don't want to connect to, I can switch between instances. It tends to use the wrong hostname, though. Sorry if I've reported this to the wrong place.

andyholmes commented 6 years ago

Hmm, I've just tested this with another computer on my desktop and it works for me. The KDE Connect protocol uses two different names:

I'm not sure quite what the problem is, since it works for me connecting to both at the same time. Two things you could try are unpairing then force stopping the Android app then running:

rm -f ~/.config/gsconnect/*.pem
kill $(ps aux | grep '[s]ervice/daemon.js' | awk '{print $2}')

Which will force GSConnect to generate a new certificate. It is possible, although astronomically unlikely, that the randomly generated common name is the same on your desktop and laptop.

ghost commented 6 years ago

Huh I regenerated the certificates on both computers, but nothing changed there (as expected I guess). After that, it took me quite a while to get my tablet repaired with my desktop. Pairing requests to my desktop would end up going to my laptop at random, as if the app really can't differentiate between them. I'll mess with it more later.

andyholmes commented 6 years ago

I'm really not sure what could be causing this since I can't reproduce it. It does sound like the problem is with the app, not GSConnect, but I should still be able to reproduce it so that makes me think it could be a problem with your local network.

One thing you could try is to pair the laptop to the desktop (GSConnect->GSConnect), which would be another indication it's a problem with the Android app. You could try filing a bug against the Android app but the KDE Connect developers might want you to reproduce it with the KDE Connect server before they accept it.

I'll leave the bug open in case any one else can reproduce it and offer some more possible causes.

ghost commented 6 years ago

I didn't even realize GSConnect->GSConnect was an option. Laptop/Desktop have never appeared in each other's device lists. Is there a way to connect via ip?

andyholmes commented 6 years ago

No, but if neither desktop/computer are visible to each other that's a sign there's something amiss with your local network. GSConnect should definitely be able to see itself, I'm sure of that.

andyholmes commented 6 years ago

Actually, don't try this yet. There's a bug thank results in an infinite loop locking up both machines. I'll fix this and release v9 today.

andyholmes commented 6 years ago

Just released v9, much better handling of pairing. Not sure if it helps with your problem, but worth a shot.

ghost commented 6 years ago

No luck. When I have some time, I'll see if a different router helps.

andyholmes commented 6 years ago

You might just recheck your settings. If you desktop is wired but your laptop is not, it might be that WiFi is isolated from the wired network, or 2.4GHz isolated from 5GHz.

ghost commented 6 years ago

Nothing appears isolated. wifi -> wired works in the case of gsconnect between my phone and desktop, as well as ssh from laptop to desktop. Granted, I'm not all that good with networking. Anyway, since this isn't reproducible (and I seem to have other mystery problems), should I just close the issue?

andyholmes commented 6 years ago

If you're convinced it's specific to you or your network, you're welcome to close it. But do let me know if you end up sorting it out so I can help other people who might encounter the same problem.

pschichtel commented 6 years ago

I can confirm this behavior. Definitely no isolation on the Wifi.

I tried the steps mentioned earler (deleting the certificats on the laptop), but no success. I'm on latest gsconnect master both on my Desktop and Laptop.

andyholmes commented 6 years ago

I think this might be related to the way GSConnect implements discovery. I still can't reproduce it myself, but I may have fixed it already in my local copy.

stark-dev commented 6 years ago

Hi! First of all thanks for your work! =)

I can confirm the same behaviour. I have a laptop and a desktop (Arch Linux with Gnome and all dependencies installed), both running GSConnect extension. They can't see each other and if the phone is paired to one instance, the other doesn't see the phone.

Log is the same as @nononomen (Peer sent fatal TLS alert: Unknown certificate). I can add that trying to remove the pairing on one side does not change the situation. I had to clear the cache and data on the application and pair again with the other device. I also tried with GSConnect v8, nothing changes.

The weird thing is that if the phone is not paired to any of the GSconnect devices, it sees only one of them from the application (in the device view). I tried to update the view a few times, and it ended up in pairing with the wrong device. It showed "Pairing with A", but the request notification appeared on B. Unfortunately I didn't have log enabled and I was not able to reproduce it again.

I do remember connecting to multiple instances at the same time some time ago. Could it be related to the application? Or is that two GSConnect devices must see each other in any case?

Thanks again, if you need more precise info and logs I'll try to provide them asap.

Mauro

andyholmes commented 6 years ago

HI, thanks for adding to the bug, sorry I've been a bit preoccupied to get to everything here.

I'll have to come back to this after I release v10 (hopefully a week-ish from now) to see if it's fixed for you folks. I have some suspicions about what might be happening (you might check debug logs to see that the two versions of GSConnect are reporting different IPs), but I still can't reproduce it myself so I may need some folks to test a series of builds along with me.

I'll ping back on this thread when I'm ready to take a good crack at this.

andyholmes commented 6 years ago

I still can't reproduce this myself, could anyone confirm that this is working for them like it is for me?

stark-dev commented 6 years ago

Hi, sorry for disappearing, I subscribed to this thread, but I received no notifications from github :/ I will check manually then. Anyway, just downloaded v10 on both laptop and desktop, seems it's still not working. I will check the IPs in debug mode and attach a log, if you have different builds to test, I'm available ;)

Thanks a lot for all your effort!

Mauro

andyholmes commented 6 years ago

No problem, I had kind of set this issue aside since the primary use for most people is likely Android->GSConnect.

Any logs you can provide would be very helpful though, since this is a really puzzling issue for me. You might also check logcat on the Android device to see if there's anything that stands out related to this.

stark-dev commented 6 years ago

Here we go, now I have some log ;) First of all, I removed the extension on both desktop and laptop, cleaned cache and config folders and uninstalled kdeconnect on my phone.

Then I performed a clean install of the extension on the dekstop (first strange thing, there was already an entry to my phone, should I delete something else?)

I reinstalled kdeconnect on my phone and requested pairing. Here's the log from desktop:

JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(DESKTOP)
JS LOG: [gsconnect@andyholmes.github.io]: PHONE (1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.send()
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(DESKTOP)
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._removeDevice(/org/gnome/Shell/Extensions/GSConnect/Device/1a209975927f6c1c)
JS LOG: Daemon: Removing device
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.send()
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(DESKTOP)
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(PHONE)
JS LOG: Daemon: Adding device
JS ERROR: TypeError: outgoing is undefined
Device<._handleIdentity/<@/home/stark/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/device.js:183:52
Device<._handleIdentity@/home/stark/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/device.js:183:17
wrapper@resource:///org/gnome/gjs/modules/_legacy.js:82:22
Device<._init@/home/stark/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/device.js:111:13
wrapper@resource:///org/gnome/gjs/modules/_legacy.js:82:22
Daemon<._addDevice@/home/stark/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:435:26
wrapper@resource:///org/gnome/gjs/modules/_legacy.js:82:22
Daemon<.vfunc_startup/<@/home/stark/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:776:17
UdpListener<.receive@/home/stark/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/protocol.js:241:9
wrapper@resource:///org/gnome/gjs/modules/_legacy.js:82:22
@/home/stark/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:889:2

JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(PHONE)
JS LOG: Daemon: Adding device
JS LOG: [gsconnect@andyholmes.github.io]: PHONE (1a209975927f6c1c)
JS LOG: Connecting to '1a209975927f6c1c'
JS LOG: [gsconnect@andyholmes.github.io]: PHONE (1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: PHONE (1a209975927f6c1c) already active
JS LOG: Authenticating '1a209975927f6c1c'
JS LOG: Connected to 'PHONE'

Then I installed the extension on the laptop, neither phone nor desktop appeared in the list. I tried to click on refresh button on both desktop and laptop, both receive the request but do not show the other client in the list:

DESKTOP LOG

#refresh on DESKTOP
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.send()
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(DESKTOP)
#refresh on LAPTOP
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(LAPTOP)

LAPTOP LOG

JS LOG: 0 devices loaded from cache
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.send()
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(LAPTOP)
JS WARNING: [/home/stark/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js 423]: reference to undefined property "deviceId"

#refresh on DESKTOP
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(DESKTOP)

#refresh on LAPTOP
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.send()
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(LAPTOP)

I then tried to shutdown the desktop, kdeconnect still shows the device as connected (probably it messed something up with laptop).

LAPTOP LOG

JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(PHONE)
JS LOG: Daemon: Adding device
JS LOG: [gsconnect@andyholmes.github.io]: PHONE (1a209975927f6c1c)
JS LOG: Connecting to '1a209975927f6c1c'
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.send()
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(LAPTOP)
JS LOG: [gsconnect@andyholmes.github.io]: PHONE (1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: PHONE (1a209975927f6c1c) already active
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(PHONE)
JS LOG: Daemon: Updating device
JS LOG: [gsconnect@andyholmes.github.io]: PHONE (1a209975927f6c1c)
JS LOG: Received from 'PHONE'
JS LOG: [gsconnect@andyholmes.github.io]: PHONE (1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: PHONE (1a209975927f6c1c) already active
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(PHONE)
JS LOG: Daemon: Updating device
JS LOG: [gsconnect@andyholmes.github.io]: PHONE (1a209975927f6c1c)
JS LOG: Received from 'PHONE'
JS LOG: [gsconnect@andyholmes.github.io]: PHONE (1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: PHONE (1a209975927f6c1c) already active
JS LOG: Error connecting: Gio.TlsError: Peer sent fatal TLS alert: Unknown certificate
JS LOG: Disconnected from 'PHONE'
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._removeDevice(/org/gnome/Shell/Extensions/GSConnect/Device/1a209975927f6c1c)
JS LOG: Daemon: Removing device
JS LOG: Error connecting: Gio.TlsError: Peer sent fatal TLS alert: Unknown certificate

Again cleaned kdeconnect on phone and tried to pair with laptop. This time it worked

JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(PHONE)
JS LOG: Daemon: Adding device
JS LOG: [gsconnect@andyholmes.github.io]: PHONE (1a209975927f6c1c)
JS LOG: Connecting to '1a209975927f6c1c'
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(PHONE)
JS LOG: Daemon: Updating device
JS LOG: [gsconnect@andyholmes.github.io]: PHONE (1a209975927f6c1c)
JS LOG: Received from 'PHONE'
JS LOG: [gsconnect@andyholmes.github.io]: PHONE (1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: PHONE (1a209975927f6c1c) already active
JS LOG: [gsconnect@andyholmes.github.io]: PHONE (1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: PHONE (1a209975927f6c1c) already active
JS LOG: Authenticating '1a209975927f6c1c'
JS LOG: Connected to 'PHONE'
JS LOG: [gsconnect@andyholmes.github.io]: Device.enablePlugin(battery, false)
JS LOG: [gsconnect@andyholmes.github.io]: Device.enablePlugin(clipboard, false)
JS LOG: [gsconnect@andyholmes.github.io]: Device.enablePlugin(mpris, false)
JS LOG: [gsconnect@andyholmes.github.io]: Device.enablePlugin(ping, false)
JS LOG: [gsconnect@andyholmes.github.io]: Device.enablePlugin(telephony, false)
JS LOG: [gsconnect@andyholmes.github.io]: Device.enablePlugin(findmyphone, false)

JS LOG: [gsconnect@andyholmes.github.io]: PHONE (1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: LanChannel.send(1a209975927f6c1c, {"id":0,"type":"kdeconnect.pair","body":{"pair":true}})
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(PHONE)
JS LOG: Daemon: Updating device
JS LOG: [gsconnect@andyholmes.github.io]: PHONE (1a209975927f6c1c)
JS LOG: Received from 'PHONE'
JS LOG: [gsconnect@andyholmes.github.io]: PHONE (1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: PHONE (1a209975927f6c1c) already active
JS LOG: [gsconnect@andyholmes.github.io]: LanChannel.receive(1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: Device received: {"id":1520940638411,"type":"kdeconnect.pair","body":{"pair":true,"publicKey":"-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuotshs+eOmbahkoE95WacfMJg2FhgwBH\npY1B98J0hySGzoTFeBltj4VR+VBbCgdLcctqHVjZZMzi6nxnZBqOu2/+pPUUOMLY6e20HhdRkKi5\nJBArsTIOtMK/oNpeRDUL94h08IkUYKhLRsTOrxL8EhNg96NQAnyQ8Or3TqCArliU8WBjIxXH+6lp\ncHOBzIwDDCIwmonn8VGrIpkzi+bU7nd2Bgy0K2B59KVMmij8V64Q8bZMpTTKPf0TFZZXPUVvsChl\nelRM8PMdZyUeIgJToA7KrPhtSo73MGBfHZI1Tbf6xGqQ6c4U9xkaWUtAa74eMQD2iPITGMy+Yj4H\nBjiP8QIDAQAB\n-----END PUBLIC KEY-----\n"}}
JS LOG: Received from 'PHONE'
JS LOG: Pair accepted by PHONE

I powered up the desktop, and this time it shows the phone (I didn't unpaired before shutting down) but no laptop. I tried to click on reconnect button and it failed (fine because I cleaned the app on phone). As before, desktop receives and sends the refresh notification, but laptop device does not appear in device list

DESKTOP LOG

#reconnect phone (without pairing)
JS LOG: Connecting to '1a209975927f6c1c'
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(PHONE)
JS LOG: Daemon: Updating device
JS LOG: [gsconnect@andyholmes.github.io]: PHONE (1a209975927f6c1c)
JS LOG: Received from 'PHONE'
JS LOG: [gsconnect@andyholmes.github.io]: PHONE (1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: PHONE (1a209975927f6c1c) already active
JS LOG: Error connecting: Gio.TlsError: Peer sent fatal TLS alert: Unknown certificate
JS LOG: Disconnected from 'PHONE'
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(PHONE)
JS LOG: Daemon: Updating device
JS LOG: [gsconnect@andyholmes.github.io]: PHONE (1a209975927f6c1c)
JS LOG: Received from 'PHONE'
JS LOG: [gsconnect@andyholmes.github.io]: PHONE (1a209975927f6c1c)
JS LOG: Connecting to '1a209975927f6c1c'
JS LOG: Error connecting: Gio.TlsError: Peer sent fatal TLS alert: Unknown certificate
JS LOG: Disconnected from 'PHONE

#refresh from phone
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(PHONE)
JS LOG: Daemon: Updating device
JS LOG: [gsconnect@andyholmes.github.io]: PHONE (1a209975927f6c1c)
JS LOG: Received from 'PHONE'
JS LOG: [gsconnect@andyholmes.github.io]: PHONE (1a209975927f6c1c)
JS LOG: Connecting to '1a209975927f6c1c'
JS LOG: Error connecting: Gio.TlsError: Peer sent fatal TLS alert: Unknown certificate
JS LOG: Disconnected from 'PHONE'

LAPTOP LOG

JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(DESKTOP)
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(DESKTOP)
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(DESKTOP)

#refresh from phone
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(PHONE)
JS LOG: Daemon: Updating device
JS LOG: [gsconnect@andyholmes.github.io]: PHONE (1a209975927f6c1c)
JS LOG: Received from 'PHONE'
JS LOG: [gsconnect@andyholmes.github.io]: PHONE (1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: PHONE (1a209975927f6c1c) already active

Hope it's useful, I'll try to install catlog or something similar, but I have to root my phone first :laughing:

If you need more precise logs or if you want me to try something else tell me ;)

Thanks!

Mauro

andyholmes commented 6 years ago

From the first log for DESKTOP:

JS ERROR: TypeError: outgoing is undefined

This is strange because it means that a JSON parseable packet of the type kdeconnect.identity was received, but is missing the outgoingCapabilities field (and possibly others) which lists the packet types the device could send. Later PHONE seems to send a complete identity packet, so I don't think the root of the problem is here, but that's still strange behaviour.

From the first log for LAPTOP:

JS LOG: 0 devices loaded from cache
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.send()
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(LAPTOP)
JS WARNING: [/home/stark/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js 423]: reference to undefined property "deviceId"

This is an irritating warning since there are references on a single line to two instances of the variable deviceId (local and remote), so I'll have to amend the debugging messages at that point to make it clear which is which. If it's the remote packet missing that field, then this would be another instance of an incomplete kdeconnect.identity packet. If it's local, then that would mean something went wrong when the local identity packet was generated.

From the logs with TLS errors:

JS LOG: Error connecting: Gio.TlsError: Peer sent fatal TLS alert: Unknown certificate
JS LOG: Disconnected from 'PHONE'
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._removeDevice(/org/gnome/Shell/Extensions/GSConnect/Device/1a209975927f6c1c)
JS LOG: Daemon: Removing device

This is easier to explain. Unpairing disconnected devices, or devices left paired on only "one side", is an awkward situation to deal with and there's not really a good way to handle it automatically. What's happened is GSConnect has an old certificate from previous pairing that it's using to validate the connection, and since it's the wrong certificate it's rejecting the connection, which is good :) If the cached certificate were automatically erased in this case, it would be pretty easy to spoof a device just by sending a bad certificate. Probably I should add a notification or UI element to deal with this situation, though.

As you noted the device settings, including TLS certificate, are not stored in the same place as the service settings, but in GSettings. It won't be necessary to clear any files (eg. ~/.config/gsconnect or ~/.cache/gsconnect), but you'll have to disable the extension (including the browser extension if you have it), stop the service and wipe the settings in dconf.

# Once you've disabled the extension (including browser) this will kill the GSConnect service
$ kill $(ps aux | grep '[d]aemon.js' | awk '{print $2}')
# This will wipe all GSettings for GSConnect
$ dconf reset -f /org/gnome/shell/extensions/gsconnect

Then you can just re-enable the extension and the service should start up again, but if you don't mind I'll get you install this build which has a few extra debug messages for the above identity packet weirdness (otherwise it's identical):

gsconnect@andyholmes.github.io.zip

Thanks a lot for helping out with this, I know it takes time but it would impossible to fix these problems without these logs :)

stark-dev commented 6 years ago

Ok, maybe I got something interesting. First of all, I managed to reset dconf folder and to install your zip version. Now GSConnect forgets everything, as expected.

I started desktop and laptop client (still they can't see each other). There should be again an entry for JS ERROR: TypeError: outgoing is undefined, hope it's useful.

I pressed refresh button on phone, desktop and laptop. This time, Xiaomi entry appeared only on laptop, no phone entry on desktop (actually it disappears after a while and it is back on desktop). Now the interesting part: I clicked on Xiaomi entry on laptop and requested pairing. The pairing request showed up on phone and as soon as I clicked on 'Yes', it paired with DESKTOP. Actually a pairing message appeared also on desktop, as if both phone and desktop were seen as the same device from laptop.

Here's the full log both for desktop and laptop:

DESKTOP

#start DESKTOP and change name

JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(GSConnect)
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.send()
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(DESKTOP)
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(LAPTOP)
JS LOG: UdpListener: using port 1716
JS LOG: TcpListener: using port 1716
JS LOG: 0 devices loaded from cache
JS WARNING: [/home/stark/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js 423]: reference to undefined property "deviceId"
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.send()
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(DESKTOP)

# start laptop

JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(DESKTOP)
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(GSConnect)
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(GSConnect)
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(GSConnect)

# change name to laptop

JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(LAPTOP)

# start phone

JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(Xiaomi)
JS LOG: [gsconnect@andyholmes.github.io]: Local identity: {"deviceName":"DESKTOP","deviceType":"desktop","tcpPort":1716,"protocolVersion":7,"incomingCapabilities":["kdeconnect.clipboard","kdeconnect.sftp","kdeconnect.findmyphone.request","kdeconnect.telephony","kdeconnect.battery","kdeconnect.battery.request","kdeconnect.lock","kdeconnect.lock.request","kdeconnect.share.request","kdeconnect.runcommand","kdeconnect.runcommand.request","kdeconnect.ping","kdeconnect.mpris.request","kdeconnect.mousepad.request","kdeconnect.notification","kdeconnect.notification.request"],"outgoingCapabilities":["kdeconnect.clipboard","kdeconnect.sftp.request","kdeconnect.findmyphone.request","kdeconnect.telephony.request","kdeconnect.sms.request","kdeconnect.battery","kdeconnect.battery.request","kdeconnect.lock","kdeconnect.lock.request","kdeconnect.share.request","kdeconnect.runcommand","kdeconnect.runcommand.request","kdeconnect.ping","kdeconnect.mpris","kdeconnect.notification","kdeconnect.notification.reply","kdeconnect.notification.request"]}
JS LOG: [gsconnect@andyholmes.github.io]: Remote identity: {"deviceId":"1a209975927f6c1c","deviceName":"Xiaomi","protocolVersion":7,"deviceType":"phone","incomingCapabilities":["kdeconnect.notification.request","kdeconnect.clipboard","kdeconnect.telephony.request","kdeconnect.sftp.request","kdeconnect.notification.reply","kdeconnect.notification","kdeconnect.battery.request","kdeconnect.ping","kdeconnect.share.request","kdeconnect.mpris","kdeconnect.sms.request","kdeconnect.mousepad.request","kdeconnect.runcommand","kdeconnect.findmyphone.request"],"outgoingCapabilities":["kdeconnect.mousepad.echo","kdeconnect.ping","kdeconnect.sftp","kdeconnect.runcommand.request","kdeconnect.share.request","kdeconnect.mpris.request","kdeconnect.notification.request","kdeconnect.clipboard","kdeconnect.telephony","kdeconnect.mousepad.request","kdeconnect.mousepad.keyboardstate","kdeconnect.notification","kdeconnect.battery"],"tcpPort":1716,"tcpHost":"192.168.1.193"}
JS LOG: Daemon: Adding device
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c)
JS LOG: Connecting to '1a209975927f6c1c'
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(Xiaomi)
JS LOG: [gsconnect@andyholmes.github.io]: Local identity: {"deviceName":"DESKTOP","deviceType":"desktop","tcpPort":1716,"protocolVersion":7,"incomingCapabilities":["kdeconnect.clipboard","kdeconnect.sftp","kdeconnect.findmyphone.request","kdeconnect.telephony","kdeconnect.battery","kdeconnect.battery.request","kdeconnect.lock","kdeconnect.lock.request","kdeconnect.share.request","kdeconnect.runcommand","kdeconnect.runcommand.request","kdeconnect.ping","kdeconnect.mpris.request","kdeconnect.mousepad.request","kdeconnect.notification","kdeconnect.notification.request"],"outgoingCapabilities":["kdeconnect.clipboard","kdeconnect.sftp.request","kdeconnect.findmyphone.request","kdeconnect.telephony.request","kdeconnect.sms.request","kdeconnect.battery","kdeconnect.battery.request","kdeconnect.lock","kdeconnect.lock.request","kdeconnect.share.request","kdeconnect.runcommand","kdeconnect.runcommand.request","kdeconnect.ping","kdeconnect.mpris","kdeconnect.notification","kdeconnect.notification.reply","kdeconnect.notification.request"]}
JS LOG: [gsconnect@andyholmes.github.io]: Remote identity: {"deviceId":"1a209975927f6c1c","deviceName":"Xiaomi","protocolVersion":7,"deviceType":"phone","incomingCapabilities":["kdeconnect.notification.request","kdeconnect.clipboard","kdeconnect.telephony.request","kdeconnect.sftp.request","kdeconnect.notification.reply","kdeconnect.notification","kdeconnect.battery.request","kdeconnect.ping","kdeconnect.share.request","kdeconnect.mpris","kdeconnect.sms.request","kdeconnect.mousepad.request","kdeconnect.runcommand","kdeconnect.findmyphone.request"],"outgoingCapabilities":["kdeconnect.mousepad.echo","kdeconnect.ping","kdeconnect.sftp","kdeconnect.runcommand.request","kdeconnect.share.request","kdeconnect.mpris.request","kdeconnect.notification.request","kdeconnect.clipboard","kdeconnect.telephony","kdeconnect.mousepad.request","kdeconnect.mousepad.keyboardstate","kdeconnect.notification","kdeconnect.battery"],"tcpPort":1716,"tcpHost":"192.168.1.193"}
JS LOG: Daemon: Updating device
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c)
JS LOG: Received from 'Xiaomi'
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c) already active
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(Xiaomi)
JS LOG: [gsconnect@andyholmes.github.io]: Local identity: {"deviceName":"DESKTOP","deviceType":"desktop","tcpPort":1716,"protocolVersion":7,"incomingCapabilities":["kdeconnect.clipboard","kdeconnect.sftp","kdeconnect.findmyphone.request","kdeconnect.telephony","kdeconnect.battery","kdeconnect.battery.request","kdeconnect.lock","kdeconnect.lock.request","kdeconnect.share.request","kdeconnect.runcommand","kdeconnect.runcommand.request","kdeconnect.ping","kdeconnect.mpris.request","kdeconnect.mousepad.request","kdeconnect.notification","kdeconnect.notification.request"],"outgoingCapabilities":["kdeconnect.clipboard","kdeconnect.sftp.request","kdeconnect.findmyphone.request","kdeconnect.telephony.request","kdeconnect.sms.request","kdeconnect.battery","kdeconnect.battery.request","kdeconnect.lock","kdeconnect.lock.request","kdeconnect.share.request","kdeconnect.runcommand","kdeconnect.runcommand.request","kdeconnect.ping","kdeconnect.mpris","kdeconnect.notification","kdeconnect.notification.reply","kdeconnect.notification.request"]}
JS LOG: [gsconnect@andyholmes.github.io]: Remote identity: {"deviceId":"1a209975927f6c1c","deviceName":"Xiaomi","protocolVersion":7,"deviceType":"phone","incomingCapabilities":["kdeconnect.notification.request","kdeconnect.clipboard","kdeconnect.telephony.request","kdeconnect.sftp.request","kdeconnect.notification.reply","kdeconnect.notification","kdeconnect.battery.request","kdeconnect.ping","kdeconnect.share.request","kdeconnect.mpris","kdeconnect.sms.request","kdeconnect.mousepad.request","kdeconnect.runcommand","kdeconnect.findmyphone.request"],"outgoingCapabilities":["kdeconnect.mousepad.echo","kdeconnect.ping","kdeconnect.sftp","kdeconnect.runcommand.request","kdeconnect.share.request","kdeconnect.mpris.request","kdeconnect.notification.request","kdeconnect.clipboard","kdeconnect.telephony","kdeconnect.mousepad.request","kdeconnect.mousepad.keyboardstate","kdeconnect.notification","kdeconnect.battery"],"tcpPort":1716,"tcpHost":"192.168.1.193"}
JS LOG: Daemon: Updating device
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c)
JS LOG: Received from 'Xiaomi'
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c) already active
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c) already active
JS LOG: Authenticating '1a209975927f6c1c'
JS LOG: Connected to 'Xiaomi'
JS LOG: [gsconnect@andyholmes.github.io]: LanChannel.receive(1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: Device received: null
JS LOG: Disconnected from 'Xiaomi'
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._removeDevice(/org/gnome/Shell/Extensions/GSConnect/Device/1a209975927f6c1c)
JS LOG: Daemon: Removing device

# refresh on phone

JS LOG: Daemon: Adding device
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c)
JS LOG: Connecting to '1a209975927f6c1c'
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c) already active
JS LOG: Authenticating '1a209975927f6c1c'
JS LOG: Connected to 'Xiaomi'
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(Xiaomi)
JS LOG: [gsconnect@andyholmes.github.io]: Local identity: {"deviceName":"DESKTOP","deviceType":"desktop","tcpPort":1716,"protocolVersion":7,"incomingCapabilities":["kdeconnect.clipboard","kdeconnect.sftp","kdeconnect.findmyphone.request","kdeconnect.telephony","kdeconnect.battery","kdeconnect.battery.request","kdeconnect.lock","kdeconnect.lock.request","kdeconnect.share.request","kdeconnect.runcommand","kdeconnect.runcommand.request","kdeconnect.ping","kdeconnect.mpris.request","kdeconnect.mousepad.request","kdeconnect.notification","kdeconnect.notification.request"],"outgoingCapabilities":["kdeconnect.clipboard","kdeconnect.sftp.request","kdeconnect.findmyphone.request","kdeconnect.telephony.request","kdeconnect.sms.request","kdeconnect.battery","kdeconnect.battery.request","kdeconnect.lock","kdeconnect.lock.request","kdeconnect.share.request","kdeconnect.runcommand","kdeconnect.runcommand.request","kdeconnect.ping","kdeconnect.mpris","kdeconnect.notification","kdeconnect.notification.reply","kdeconnect.notification.request"]}
JS LOG: [gsconnect@andyholmes.github.io]: Remote identity: {"deviceId":"1a209975927f6c1c","deviceName":"Xiaomi","protocolVersion":7,"deviceType":"phone","incomingCapabilities":["kdeconnect.notification.request","kdeconnect.clipboard","kdeconnect.telephony.request","kdeconnect.sftp.request","kdeconnect.notification.reply","kdeconnect.notification","kdeconnect.battery.request","kdeconnect.ping","kdeconnect.share.request","kdeconnect.mpris","kdeconnect.sms.request","kdeconnect.mousepad.request","kdeconnect.runcommand","kdeconnect.findmyphone.request"],"outgoingCapabilities":["kdeconnect.mousepad.echo","kdeconnect.ping","kdeconnect.sftp","kdeconnect.runcommand.request","kdeconnect.share.request","kdeconnect.mpris.request","kdeconnect.notification.request","kdeconnect.clipboard","kdeconnect.telephony","kdeconnect.mousepad.request","kdeconnect.mousepad.keyboardstate","kdeconnect.notification","kdeconnect.battery"],"tcpPort":1716,"tcpHost":"192.168.1.193"}
JS LOG: Daemon: Updating device
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c)
JS LOG: Received from 'Xiaomi'
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c) already active
JS LOG: [gsconnect@andyholmes.github.io]: LanChannel.receive(1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: Device received: null
JS LOG: Disconnected from 'Xiaomi'
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._removeDevice(/org/gnome/Shell/Extensions/GSConnect/Device/1a209975927f6c1c)
JS LOG: Daemon: Removing device

# refresh on desktop

JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.send()
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(DESKTOP)
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(Xiaomi)
JS LOG: [gsconnect@andyholmes.github.io]: Local identity: {"deviceName":"DESKTOP","deviceType":"desktop","tcpPort":1716,"protocolVersion":7,"incomingCapabilities":["kdeconnect.clipboard","kdeconnect.sftp","kdeconnect.findmyphone.request","kdeconnect.telephony","kdeconnect.battery","kdeconnect.battery.request","kdeconnect.lock","kdeconnect.lock.request","kdeconnect.share.request","kdeconnect.runcommand","kdeconnect.runcommand.request","kdeconnect.ping","kdeconnect.mpris.request","kdeconnect.mousepad.request","kdeconnect.notification","kdeconnect.notification.request"],"outgoingCapabilities":["kdeconnect.clipboard","kdeconnect.sftp.request","kdeconnect.findmyphone.request","kdeconnect.telephony.request","kdeconnect.sms.request","kdeconnect.battery","kdeconnect.battery.request","kdeconnect.lock","kdeconnect.lock.request","kdeconnect.share.request","kdeconnect.runcommand","kdeconnect.runcommand.request","kdeconnect.ping","kdeconnect.mpris","kdeconnect.notification","kdeconnect.notification.reply","kdeconnect.notification.request"]}
JS LOG: [gsconnect@andyholmes.github.io]: Remote identity: {"deviceId":"1a209975927f6c1c","deviceName":"Xiaomi","protocolVersion":7,"deviceType":"phone","incomingCapabilities":["kdeconnect.notification.request","kdeconnect.clipboard","kdeconnect.telephony.request","kdeconnect.sftp.request","kdeconnect.notification.reply","kdeconnect.notification","kdeconnect.battery.request","kdeconnect.ping","kdeconnect.share.request","kdeconnect.mpris","kdeconnect.sms.request","kdeconnect.mousepad.request","kdeconnect.runcommand","kdeconnect.findmyphone.request"],"outgoingCapabilities":["kdeconnect.mousepad.echo","kdeconnect.ping","kdeconnect.sftp","kdeconnect.runcommand.request","kdeconnect.share.request","kdeconnect.mpris.request","kdeconnect.notification.request","kdeconnect.clipboard","kdeconnect.telephony","kdeconnect.mousepad.request","kdeconnect.mousepad.keyboardstate","kdeconnect.notification","kdeconnect.battery"],"tcpHost":"192.168.1.193","tcpPort":1716}
JS LOG: Daemon: Adding device
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c)
JS LOG: Connected to 'Xiaomi'
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c) already active

# refresh on laptop

JS LOG: [gsconnect@andyholmes.github.io]: LanChannel.receive(1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: Device received: null
JS LOG: Disconnected from 'Xiaomi'
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._removeDevice(/org/gnome/Shell/Extensions/GSConnect/Device/1a209975927f6c1c)
JS LOG: Daemon: Removing device
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(LAPTOP)

# request on laptop, paired on desktop??

JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(Xiaomi)
JS LOG: [gsconnect@andyholmes.github.io]: Local identity: {"deviceName":"DESKTOP","deviceType":"desktop","tcpPort":1716,"protocolVersion":7,"incomingCapabilities":["kdeconnect.clipboard","kdeconnect.sftp","kdeconnect.findmyphone.request","kdeconnect.telephony","kdeconnect.battery","kdeconnect.battery.request","kdeconnect.lock","kdeconnect.lock.request","kdeconnect.share.request","kdeconnect.runcommand","kdeconnect.runcommand.request","kdeconnect.ping","kdeconnect.mpris.request","kdeconnect.mousepad.request","kdeconnect.notification","kdeconnect.notification.request"],"outgoingCapabilities":["kdeconnect.clipboard","kdeconnect.sftp.request","kdeconnect.findmyphone.request","kdeconnect.telephony.request","kdeconnect.sms.request","kdeconnect.battery","kdeconnect.battery.request","kdeconnect.lock","kdeconnect.lock.request","kdeconnect.share.request","kdeconnect.runcommand","kdeconnect.runcommand.request","kdeconnect.ping","kdeconnect.mpris","kdeconnect.notification","kdeconnect.notification.reply","kdeconnect.notification.request"]}
JS LOG: [gsconnect@andyholmes.github.io]: Remote identity: {"deviceId":"1a209975927f6c1c","deviceName":"Xiaomi","protocolVersion":7,"deviceType":"phone","incomingCapabilities":["kdeconnect.notification.request","kdeconnect.clipboard","kdeconnect.telephony.request","kdeconnect.sftp.request","kdeconnect.notification.reply","kdeconnect.notification","kdeconnect.battery.request","kdeconnect.ping","kdeconnect.share.request","kdeconnect.mpris","kdeconnect.sms.request","kdeconnect.mousepad.request","kdeconnect.runcommand","kdeconnect.findmyphone.request"],"outgoingCapabilities":["kdeconnect.mousepad.echo","kdeconnect.ping","kdeconnect.sftp","kdeconnect.runcommand.request","kdeconnect.share.request","kdeconnect.mpris.request","kdeconnect.notification.request","kdeconnect.clipboard","kdeconnect.telephony","kdeconnect.mousepad.request","kdeconnect.mousepad.keyboardstate","kdeconnect.notification","kdeconnect.battery"],"tcpPort":1716,"tcpHost":"192.168.1.193"}
JS LOG: Daemon: Adding device
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c)
JS LOG: Connecting to '1a209975927f6c1c'
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c) already active
JS LOG: Authenticating '1a209975927f6c1c'
JS LOG: Connected to 'Xiaomi'
JS LOG: [gsconnect@andyholmes.github.io]: LanChannel.receive(1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: Device received: {"id":1520968308684,"type":"kdeconnect.pair","body":{"pair":true,"publicKey":"-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAz3oQb4LG4fwTKbhUZzzdrQiYVGAibmof\n9SG03xYaDHQKIpLtB719iVXjwlfL7B71N9fvRBBh1JJrvEc0Vd8gkcoIQCRw83rFSV6nBBzalZKS\ngcR7IgLPaIPWNM6F5oh1uJCJvxJa0IuDexdbQNt/V3/Ma57W34XfYUf08sNqf+nXqL5h5yPjejtg\nZTTpyzdVWSShSL8p0AMFPAy93Vxp9adA0Pyl3a/KsE/sBkr8CsDgpUSA/ljp7O501MaYVRpYlp8j\nZxy4V3q7BaMtmlQuv6c/MkRLIeMjvQyURSAMvvA8H0s8oDU0r91jDRIurVXsOXbHyIiJpdi01Uon\nAtD1MwIDAQAB\n-----END PUBLIC KEY-----\n"}}
JS LOG: Received from 'Xiaomi'
JS LOG: Pair request from Xiaomi
JS LOG: [gsconnect@andyholmes.github.io]: LanChannel.receive(1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: Device received: {"id":1520968308693,"type":"kdeconnect.runcommand.request","body":{"requestCommandList":true}}
JS LOG: Received from 'Xiaomi'
JS LOG: Received unsupported packet type: {"id":1520968308693,"type":"kdeconnect.runcommand.request","body":{"requestCommandList":true}}
JS LOG: [gsconnect@andyholmes.github.io]: LanChannel.receive(1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: Device received: {"id":1520968308696,"type":"kdeconnect.battery","body":{"currentCharge":19,"isCharging":false,"thresholdEvent":0}}
JS LOG: Received from 'Xiaomi'
JS LOG: Received unsupported packet type: {"id":1520968308696,"type":"kdeconnect.battery","body":{"currentCharge":19,"isCharging":false,"thresholdEvent":0}}
JS LOG: [gsconnect@andyholmes.github.io]: LanChannel.receive(1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: Device received: {"id":1520968308740,"type":"kdeconnect.mpris.request","body":{"requestPlayerList":true}}
JS LOG: Received from 'Xiaomi'
JS LOG: Received unsupported packet type: {"id":1520968308740,"type":"kdeconnect.mpris.request","body":{"requestPlayerList":true}}
JS LOG: [gsconnect@andyholmes.github.io]: LanChannel.receive(1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: Device received: {"id":1520968308740,"type":"kdeconnect.mpris.request","body":{"requestPlayerList":true}}
JS LOG: Received from 'Xiaomi'
JS LOG: Received unsupported packet type: {"id":1520968308740,"type":"kdeconnect.mpris.request","body":{"requestPlayerList":true}}
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: LanChannel.send(1a209975927f6c1c, {"id":0,"type":"kdeconnect.pair","body":{"pair":true}})

LAPTOP

# start laptop

JS LOG: [gsconnect@andyholmes.github.io]: Daemon._removeDevice(/org/gnome/Shell/Extensions/GSConnect/Device/1a209975927f6c1c)
JS LOG: Daemon: Removing device
JS LOG: UdpListener: using port 1716
JS LOG: TcpListener: using port 1716
JS LOG: 0 devices loaded from cache
JS WARNING: [/home/stark/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js 423]: reference to undefined property "deviceId"
JS LOG: UdpListener: using port 1716
JS LOG: TcpListener: using port 1716
JS LOG: 0 devices loaded from cache
JS WARNING: [/home/stark/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js 423]: reference to undefined property "deviceId"

# change name to LAPTOP
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.send()
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(LAPTOP)

# start phone

JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(Xiaomi)
JS LOG: [gsconnect@andyholmes.github.io]: Local identity: {"deviceName":"LAPTOP","deviceType":"laptop","tcpPort":1716,"protocolVersion":7,"incomingCapabilities":["kdeconnect.clipboard","kdeconnect.sftp","kdeconnect.findmyphone.request","kdeconnect.telephony","kdeconnect.battery","kdeconnect.battery.request","kdeconnect.lock","kdeconnect.lock.request","kdeconnect.share.request","kdeconnect.runcommand","kdeconnect.runcommand.request","kdeconnect.ping","kdeconnect.mpris.request","kdeconnect.mousepad.request","kdeconnect.notification","kdeconnect.notification.request"],"outgoingCapabilities":["kdeconnect.clipboard","kdeconnect.sftp.request","kdeconnect.findmyphone.request","kdeconnect.telephony.request","kdeconnect.sms.request","kdeconnect.battery","kdeconnect.battery.request","kdeconnect.lock","kdeconnect.lock.request","kdeconnect.share.request","kdeconnect.runcommand","kdeconnect.runcommand.request","kdeconnect.ping","kdeconnect.mpris","kdeconnect.notification","kdeconnect.notification.reply","kdeconnect.notification.request"]}
JS LOG: [gsconnect@andyholmes.github.io]: Remote identity: {"deviceId":"1a209975927f6c1c","deviceName":"Xiaomi","protocolVersion":7,"deviceType":"phone","incomingCapabilities":["kdeconnect.notification.request","kdeconnect.clipboard","kdeconnect.telephony.request","kdeconnect.sftp.request","kdeconnect.notification.reply","kdeconnect.notification","kdeconnect.battery.request","kdeconnect.ping","kdeconnect.share.request","kdeconnect.mpris","kdeconnect.sms.request","kdeconnect.mousepad.request","kdeconnect.runcommand","kdeconnect.findmyphone.request"],"outgoingCapabilities":["kdeconnect.mousepad.echo","kdeconnect.ping","kdeconnect.sftp","kdeconnect.runcommand.request","kdeconnect.share.request","kdeconnect.mpris.request","kdeconnect.notification.request","kdeconnect.clipboard","kdeconnect.telephony","kdeconnect.mousepad.request","kdeconnect.mousepad.keyboardstate","kdeconnect.notification","kdeconnect.battery"],"tcpPort":1716,"tcpHost":"192.168.1.193"}
JS LOG: Daemon: Adding device
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c)
JS LOG: Connecting to '1a209975927f6c1c'
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(Xiaomi)
JS LOG: [gsconnect@andyholmes.github.io]: Local identity: {"deviceName":"LAPTOP","deviceType":"laptop","tcpPort":1716,"protocolVersion":7,"incomingCapabilities":["kdeconnect.clipboard","kdeconnect.sftp","kdeconnect.findmyphone.request","kdeconnect.telephony","kdeconnect.battery","kdeconnect.battery.request","kdeconnect.lock","kdeconnect.lock.request","kdeconnect.share.request","kdeconnect.runcommand","kdeconnect.runcommand.request","kdeconnect.ping","kdeconnect.mpris.request","kdeconnect.mousepad.request","kdeconnect.notification","kdeconnect.notification.request"],"outgoingCapabilities":["kdeconnect.clipboard","kdeconnect.sftp.request","kdeconnect.findmyphone.request","kdeconnect.telephony.request","kdeconnect.sms.request","kdeconnect.battery","kdeconnect.battery.request","kdeconnect.lock","kdeconnect.lock.request","kdeconnect.share.request","kdeconnect.runcommand","kdeconnect.runcommand.request","kdeconnect.ping","kdeconnect.mpris","kdeconnect.notification","kdeconnect.notification.reply","kdeconnect.notification.request"]}
JS LOG: [gsconnect@andyholmes.github.io]: Remote identity: {"deviceId":"1a209975927f6c1c","deviceName":"Xiaomi","protocolVersion":7,"deviceType":"phone","incomingCapabilities":["kdeconnect.notification.request","kdeconnect.clipboard","kdeconnect.telephony.request","kdeconnect.sftp.request","kdeconnect.notification.reply","kdeconnect.notification","kdeconnect.battery.request","kdeconnect.ping","kdeconnect.share.request","kdeconnect.mpris","kdeconnect.sms.request","kdeconnect.mousepad.request","kdeconnect.runcommand","kdeconnect.findmyphone.request"],"outgoingCapabilities":["kdeconnect.mousepad.echo","kdeconnect.ping","kdeconnect.sftp","kdeconnect.runcommand.request","kdeconnect.share.request","kdeconnect.mpris.request","kdeconnect.notification.request","kdeconnect.clipboard","kdeconnect.telephony","kdeconnect.mousepad.request","kdeconnect.mousepad.keyboardstate","kdeconnect.notification","kdeconnect.battery"],"tcpPort":1716,"tcpHost":"192.168.1.193"}
JS LOG: Daemon: Updating device
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c)
JS LOG: Received from 'Xiaomi'
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c) already active
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(Xiaomi)
JS LOG: [gsconnect@andyholmes.github.io]: Local identity: {"deviceName":"LAPTOP","deviceType":"laptop","tcpPort":1716,"protocolVersion":7,"incomingCapabilities":["kdeconnect.clipboard","kdeconnect.sftp","kdeconnect.findmyphone.request","kdeconnect.telephony","kdeconnect.battery","kdeconnect.battery.request","kdeconnect.lock","kdeconnect.lock.request","kdeconnect.share.request","kdeconnect.runcommand","kdeconnect.runcommand.request","kdeconnect.ping","kdeconnect.mpris.request","kdeconnect.mousepad.request","kdeconnect.notification","kdeconnect.notification.request"],"outgoingCapabilities":["kdeconnect.clipboard","kdeconnect.sftp.request","kdeconnect.findmyphone.request","kdeconnect.telephony.request","kdeconnect.sms.request","kdeconnect.battery","kdeconnect.battery.request","kdeconnect.lock","kdeconnect.lock.request","kdeconnect.share.request","kdeconnect.runcommand","kdeconnect.runcommand.request","kdeconnect.ping","kdeconnect.mpris","kdeconnect.notification","kdeconnect.notification.reply","kdeconnect.notification.request"]}
JS LOG: [gsconnect@andyholmes.github.io]: Remote identity: {"deviceId":"1a209975927f6c1c","deviceName":"Xiaomi","protocolVersion":7,"deviceType":"phone","incomingCapabilities":["kdeconnect.notification.request","kdeconnect.clipboard","kdeconnect.telephony.request","kdeconnect.sftp.request","kdeconnect.notification.reply","kdeconnect.notification","kdeconnect.battery.request","kdeconnect.ping","kdeconnect.share.request","kdeconnect.mpris","kdeconnect.sms.request","kdeconnect.mousepad.request","kdeconnect.runcommand","kdeconnect.findmyphone.request"],"outgoingCapabilities":["kdeconnect.mousepad.echo","kdeconnect.ping","kdeconnect.sftp","kdeconnect.runcommand.request","kdeconnect.share.request","kdeconnect.mpris.request","kdeconnect.notification.request","kdeconnect.clipboard","kdeconnect.telephony","kdeconnect.mousepad.request","kdeconnect.mousepad.keyboardstate","kdeconnect.notification","kdeconnect.battery"],"tcpPort":1716,"tcpHost":"192.168.1.193"}
JS LOG: Daemon: Updating device
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c)
JS LOG: Received from 'Xiaomi'
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c) already active
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c) already active
JS LOG: Authenticating '1a209975927f6c1c'
JS LOG: Connected to 'Xiaomi'
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c) already active
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c) already active

# refresh on phone

JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(Xiaomi)
JS LOG: [gsconnect@andyholmes.github.io]: Local identity: {"deviceName":"LAPTOP","deviceType":"laptop","tcpPort":1716,"protocolVersion":7,"incomingCapabilities":["kdeconnect.clipboard","kdeconnect.sftp","kdeconnect.findmyphone.request","kdeconnect.telephony","kdeconnect.battery","kdeconnect.battery.request","kdeconnect.lock","kdeconnect.lock.request","kdeconnect.share.request","kdeconnect.runcommand","kdeconnect.runcommand.request","kdeconnect.ping","kdeconnect.mpris.request","kdeconnect.mousepad.request","kdeconnect.notification","kdeconnect.notification.request"],"outgoingCapabilities":["kdeconnect.clipboard","kdeconnect.sftp.request","kdeconnect.findmyphone.request","kdeconnect.telephony.request","kdeconnect.sms.request","kdeconnect.battery","kdeconnect.battery.request","kdeconnect.lock","kdeconnect.lock.request","kdeconnect.share.request","kdeconnect.runcommand","kdeconnect.runcommand.request","kdeconnect.ping","kdeconnect.mpris","kdeconnect.notification","kdeconnect.notification.reply","kdeconnect.notification.request"]}
JS LOG: [gsconnect@andyholmes.github.io]: Remote identity: {"deviceId":"1a209975927f6c1c","deviceName":"Xiaomi","protocolVersion":7,"deviceType":"phone","incomingCapabilities":["kdeconnect.notification.request","kdeconnect.clipboard","kdeconnect.telephony.request","kdeconnect.sftp.request","kdeconnect.notification.reply","kdeconnect.notification","kdeconnect.battery.request","kdeconnect.ping","kdeconnect.share.request","kdeconnect.mpris","kdeconnect.sms.request","kdeconnect.mousepad.request","kdeconnect.runcommand","kdeconnect.findmyphone.request"],"outgoingCapabilities":["kdeconnect.mousepad.echo","kdeconnect.ping","kdeconnect.sftp","kdeconnect.runcommand.request","kdeconnect.share.request","kdeconnect.mpris.request","kdeconnect.notification.request","kdeconnect.clipboard","kdeconnect.telephony","kdeconnect.mousepad.request","kdeconnect.mousepad.keyboardstate","kdeconnect.notification","kdeconnect.battery"],"tcpPort":1716,"tcpHost":"192.168.1.193"}
JS LOG: Daemon: Updating device
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c)
JS LOG: Received from 'Xiaomi'
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c) already active
JS LOG: [gsconnect@andyholmes.github.io]: LanChannel.receive(1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: Device received: null
JS LOG: Disconnected from 'Xiaomi'
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._removeDevice(/org/gnome/Shell/Extensions/GSConnect/Device/1a209975927f6c1c)
JS LOG: Daemon: Removing device

# refresh on desktop

JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(DESKTOP)
JS LOG: [gsconnect@andyholmes.github.io]: LanChannel.receive(1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: Device received: null
JS LOG: Disconnected from 'Xiaomi'
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._removeDevice(/org/gnome/Shell/Extensions/GSConnect/Device/1a209975927f6c1c)
JS LOG: Daemon: Removing device

# refresh on laptop

JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.send()
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(LAPTOP)
JS LOG: [gsconnect@andyholmes.github.io]: LanChannel.receive(1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: Device received: null
JS LOG: Disconnected from 'Xiaomi'
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._removeDevice(/org/gnome/Shell/Extensions/GSConnect/Device/1a209975927f6c1c)
JS LOG: Daemon: Removing device
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(Xiaomi)
JS LOG: [gsconnect@andyholmes.github.io]: Local identity: {"deviceName":"LAPTOP","deviceType":"laptop","tcpPort":1716,"protocolVersion":7,"incomingCapabilities":["kdeconnect.clipboard","kdeconnect.sftp","kdeconnect.findmyphone.request","kdeconnect.telephony","kdeconnect.battery","kdeconnect.battery.request","kdeconnect.lock","kdeconnect.lock.request","kdeconnect.share.request","kdeconnect.runcommand","kdeconnect.runcommand.request","kdeconnect.ping","kdeconnect.mpris.request","kdeconnect.mousepad.request","kdeconnect.notification","kdeconnect.notification.request"],"outgoingCapabilities":["kdeconnect.clipboard","kdeconnect.sftp.request","kdeconnect.findmyphone.request","kdeconnect.telephony.request","kdeconnect.sms.request","kdeconnect.battery","kdeconnect.battery.request","kdeconnect.lock","kdeconnect.lock.request","kdeconnect.share.request","kdeconnect.runcommand","kdeconnect.runcommand.request","kdeconnect.ping","kdeconnect.mpris","kdeconnect.notification","kdeconnect.notification.reply","kdeconnect.notification.request"]}
JS LOG: [gsconnect@andyholmes.github.io]: Remote identity: {"deviceId":"1a209975927f6c1c","deviceName":"Xiaomi","protocolVersion":7,"deviceType":"phone","incomingCapabilities":["kdeconnect.notification.request","kdeconnect.clipboard","kdeconnect.telephony.request","kdeconnect.sftp.request","kdeconnect.notification.reply","kdeconnect.notification","kdeconnect.battery.request","kdeconnect.ping","kdeconnect.share.request","kdeconnect.mpris","kdeconnect.sms.request","kdeconnect.mousepad.request","kdeconnect.runcommand","kdeconnect.findmyphone.request"],"outgoingCapabilities":["kdeconnect.mousepad.echo","kdeconnect.ping","kdeconnect.sftp","kdeconnect.runcommand.request","kdeconnect.share.request","kdeconnect.mpris.request","kdeconnect.notification.request","kdeconnect.clipboard","kdeconnect.telephony","kdeconnect.mousepad.request","kdeconnect.mousepad.keyboardstate","kdeconnect.notification","kdeconnect.battery"],"tcpHost":"192.168.1.193","tcpPort":1716}
JS LOG: Daemon: Adding device
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c)
JS LOG: Connected to 'Xiaomi'

# request on laptop, paired on desktop

JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: LanChannel.send(1a209975927f6c1c, {"id":0,"type":"kdeconnect.pair","body":{"pair":true}})
JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(Xiaomi)
JS LOG: [gsconnect@andyholmes.github.io]: Local identity: {"deviceName":"LAPTOP","deviceType":"laptop","tcpPort":1716,"protocolVersion":7,"incomingCapabilities":["kdeconnect.clipboard","kdeconnect.sftp","kdeconnect.findmyphone.request","kdeconnect.telephony","kdeconnect.battery","kdeconnect.battery.request","kdeconnect.lock","kdeconnect.lock.request","kdeconnect.share.request","kdeconnect.runcommand","kdeconnect.runcommand.request","kdeconnect.ping","kdeconnect.mpris.request","kdeconnect.mousepad.request","kdeconnect.notification","kdeconnect.notification.request"],"outgoingCapabilities":["kdeconnect.clipboard","kdeconnect.sftp.request","kdeconnect.findmyphone.request","kdeconnect.telephony.request","kdeconnect.sms.request","kdeconnect.battery","kdeconnect.battery.request","kdeconnect.lock","kdeconnect.lock.request","kdeconnect.share.request","kdeconnect.runcommand","kdeconnect.runcommand.request","kdeconnect.ping","kdeconnect.mpris","kdeconnect.notification","kdeconnect.notification.reply","kdeconnect.notification.request"]}
JS LOG: [gsconnect@andyholmes.github.io]: Remote identity: {"deviceId":"1a209975927f6c1c","deviceName":"Xiaomi","protocolVersion":7,"deviceType":"phone","incomingCapabilities":["kdeconnect.notification.request","kdeconnect.clipboard","kdeconnect.telephony.request","kdeconnect.sftp.request","kdeconnect.notification.reply","kdeconnect.notification","kdeconnect.battery.request","kdeconnect.ping","kdeconnect.share.request","kdeconnect.mpris","kdeconnect.sms.request","kdeconnect.mousepad.request","kdeconnect.runcommand","kdeconnect.findmyphone.request"],"outgoingCapabilities":["kdeconnect.mousepad.echo","kdeconnect.ping","kdeconnect.sftp","kdeconnect.runcommand.request","kdeconnect.share.request","kdeconnect.mpris.request","kdeconnect.notification.request","kdeconnect.clipboard","kdeconnect.telephony","kdeconnect.mousepad.request","kdeconnect.mousepad.keyboardstate","kdeconnect.notification","kdeconnect.battery"],"tcpPort":1716,"tcpHost":"192.168.1.193"}
JS LOG: Daemon: Updating device
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c)
JS LOG: Received from 'Xiaomi'
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: Xiaomi (1a209975927f6c1c) already active
JS LOG: [gsconnect@andyholmes.github.io]: LanChannel.receive(1a209975927f6c1c)
JS LOG: [gsconnect@andyholmes.github.io]: Device received: null
JS LOG: Disconnected from 'Xiaomi'
JS LOG: [gsconnect@andyholmes.github.io]: Daemon._removeDevice(/org/gnome/Shell/Extensions/GSConnect/Device/1a209975927f6c1c)
JS LOG: Daemon: Removing device

The IP address 192.168.1.193 is the one assigned to Xiaomi. I also added some comments in logs, which refer to the same procedure.

Hope they will help, I'll stay tuned for updates ;)

Thanks,

Mauro

andyholmes commented 6 years ago

Okay, so it looks like there is a problem generating the local identity packet from what I can see. Dealing with TLS certificates in GJS is little bit tricky so the openssl CLI is used to fake some functions. Could you try running this command (without clearing any settings) and post the output?

$ cd ~/.config/gsconnect/certificate.pem | openssl x509 -noout -subject -inform pem

The output should be something like:

subject= /CN=854c42b6-2b39-4b26-a673-572fb7bf755b

GSConnect uses this to tie the device to the certificate used to encrypt traffic between devices, which is a little different than what KDE Connect does. Changing it would probably break most people's settings so hopefully it's some parsing error of that line that I can fix.

stark-dev commented 6 years ago

Here's the output from desktop subject=CN = 7dbbc718-4b84-445a-97e6-41d4fc53923c

and this is the one from laptop subject=CN = 1e09e165-5a95-42d2-a84b-5a55c31e977e

I'm afraid I cleared settings on desktop yesterday to do another test, if you need results related to previous logs I will test again the same procedure. Laptop instead was not cleared, should be related to last log ;)

Thanks,

Mauro

andyholmes commented 6 years ago

No problem, I see what my error is. I think this build should fix all problems related broken identity packets being built:

gsconnect@andyholmes.github.io.zip

stark-dev commented 6 years ago

Yes! I can confirm it solves the problem. Installed and now both laptop and desktop can see each other, plus I can pair phone with both at the same time.

Thank you very much for your effort! Do you need any further info/log?

Mauro

andyholmes commented 6 years ago

Nope, that should do it. Thanks again for working through this one with me. Your logs definitely helped me narrow it down to a problem I couldn't have caught on my side :)

rugk commented 6 years ago

Will you release a version, with this fix soon?

(BTW, how do GNOME extensions even update. I hope it's somehow done automatically…?)

andyholmes commented 6 years ago

Will you release a version, with this fix soon?

The Zip posted above includes this fix, but I probably won't push a new update to the extensions website until #65 and #68 are confirmed fixed so I can push to master. Otherwise, I will have to revert those fixes locally and they won't make it out until the next release. The review process is rather long sometimes so it's better to get more fixes in at once.

(BTW, how do GNOME extensions even update. I hope it's somehow done automatically…?)

If you have Gnome Shell integration for Chrome or Firefox then you should be notified when updates are available, otherwise you have to check the website manually.

rienheuver commented 6 years ago

When will release 11 (with this fixed) be available on extensions.gnome.org? I'm running into this as well now and would love to have it fixed

andyholmes commented 6 years ago

v11 was submitted to the extension website on April 5th. The extensions are reviewed by volunteers on a first-in, first-out basis so may take some time. There are instructions in the Wiki for [installing from Zip]() if you'd like it sooner.