Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No connection when connecting through USB developer mode #17

Open
R1tschY opened this issue Oct 24, 2018 · 5 comments
Open

No connection when connecting through USB developer mode #17

R1tschY opened this issue Oct 24, 2018 · 5 comments
Assignees
Labels
bug Something isn't working known issue

Comments

@R1tschY
Copy link
Owner

R1tschY commented Oct 24, 2018

When phone is connected by USB to computer through developer mode then no connection is possible.

See https://openrepos.net/comment/26268#comment-26268

@dimpflmoser
Copy link

dimpflmoser commented Dec 4, 2019

Just messed around with kdeconnect / sailfishconnect over usb and got a bit further:
<edit>I think it's not a firewall issue, so please ignore that firewall stuff </edit>
First of all I realised that the Sailfish firewall blocks all incumming connections but ssh on the usb interface. I modified a line in /etc/connman/firewall.conf from:

IPv4.INPUT.RULES = -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT;  -i lo -j ACCEPT

to:

IPv4.INPUT.RULES = -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT; -i rndis0 -j ACCEPT; -i lo -j ACCEPT

This allows all incoming IPv4 traffic via USB interface. I don't think it's too much of a risk.
The connection still didn't work. I stopped sailfish connect and setup netcat / nc to listen to the kdeconnect ports (tcp and udp) and connected the phone via wifi.

Now I got a udp message such as:

{"body":{"deviceId":"_????????_?????_????_????_????????????_","deviceName":"???????","deviceType":"desktop","incomingCapabilities":["kdeconnect.notification.request","kdeconnect.sftp","kdeconnect.runcommand.request","kdeconnect.mpris.request","kdeconnect.telephony","kdeconnect.mousepad.keyboardstate","kdeconnect.mousepad.echo","kdeconnect.clipboard","kdeconnect.battery","kdeconnect.ping","kdeconnect.share.request","kdeconnect.mousepad.request","kdeconnect.notification"],"outgoingCapabilities":["kdeconnect.notification.reply","kdeconnect.notification.request","kdeconnect.sms.request","kdeconnect.telephony.request","kdeconnect.mpris","kdeconnect.battery.request","kdeconnect.clipboard","kdeconnect.sftp.request","kdeconnect.ping","kdeconnect.share.request","kdeconnect.runcommand","kdeconnect.notification","kdeconnect.mousepad.request","kdeconnect.findmyphone.request"],"protocolVersion":7,"tcpPort":1716},"id":"????????","payloadSize":0,"payloadTransferInfo":{},"type":"kdeconnect.identity"}

I copied that message, turned off wifi, connected the phone via USB and started sailfish connect.
Still no success.
Then I set up a UDP connection with netcat from the PC to the phone (with IP 192.168.21.15):

nc -uv 192.168.21.15 1716

After I got the connection I copied the message into that netcat session and the phone and PC tell me that they're connected.

So my Impression is that PC and phone send UDP broadcasts (this is stated in the kdeconnect manual) and those broadcasts don't get forwarded from the phone to the pc or vice versa.

Do you have an idea on how to allow broadcast messages on USB?

@R1tschY
Copy link
Owner Author

R1tschY commented Dec 27, 2019

Sorry, I'm not familiar with Ethernet USB. The KDE Connect Project is working on using Multicast DNS (MDNS) instead of UDP Broadcasts. Maybe is would help. However, there exists currently only a non-functioning prototype.

Also SailfishConnect is missing a option to manually select IPs to connect to. I think that would also solve your problem. Because a TCP connection is possible, right?

Currently I'm working on integrating SailfishConnect into the KDE Connect project. So there is less time for new features.

@R1tschY R1tschY added the bug Something isn't working label Dec 27, 2019
@R1tschY R1tschY self-assigned this Dec 27, 2019
@R1tschY R1tschY added this to the v0.6 milestone Dec 27, 2019
@dimpflmoser
Copy link

Haven't checked whether UDP Broadcasts or MDNS packets are forwarded. Will check that next time. Thanks!

@R1tschY
Copy link
Owner Author

R1tschY commented Feb 7, 2021

I tested it and it connects at least for me. As a workaround in version 0.6 the IP of the computer can be added in the settings. When searching for devices a UDP packet is send to this IP address.

@R1tschY R1tschY closed this as completed Feb 7, 2021
@R1tschY
Copy link
Owner Author

R1tschY commented Feb 9, 2021

It is not fixed. To get this to work one has to directly connect via TCP like GSConnect does.

@R1tschY R1tschY reopened this Feb 9, 2021
@R1tschY R1tschY removed this from the v0.6 milestone Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working known issue
Projects
None yet
Development

No branches or pull requests

2 participants