-
Notifications
You must be signed in to change notification settings - Fork 259
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
[DEVEL] Bluetooth Support #17
Comments
As far as I know bluetooth is still considered an unstable feature, since it isn't even enabled in the beta Android app. There was some discussion a few months ago on reddit with the author, but it didn't sound especially useful. As far as I can tell there hasn't been any progress in about 7 months. Implementing it might be possible, I haven't investigated what introspected libraries are available for implementing this. The Lan handler code would need to be separated from the Device channel code so that a Bluetooth handler can be implemented without duplicating a bunch of code. Any help with this would be appreciated. |
I have implemented a basic but working bluetooth link in Vala: |
That would be great, I'll admit I know very little about bluetooth so I hadn't looked much into it yet. My understanding is the only part really different is the socket is obtained from DBus, then the normal TLS protocol? DBus clients in GJS can be simple using If you think you can get a DBus proxy working you could make a "BluetoothListener" along the lines of Unfortunately I decided on doing a big rewrite and broke a bunch of things in branch "v10" which is where I'm doing all my work right now. Any help would be appreciate though, so feel free to pester me with javascript questions.. |
Sorry I've been so busy lately. I've been putting some work into As soon as what I have for v10 is remotely stable I'll push it and I'd be happy to hear your thoughts since you seem have a good grasp of GLib. |
I think this issue is not important at all. As long as you cannot use it with the precompiled KDEConnect app and have to re-compile it (with some options) by yourself, few people will use that feature, actually. |
Since there's been some work on bluetooth upstream to get payloads and such working, I've started actually working on this based on your implementation and SDP record. I've had some limited success, although I'm worried GJS isn't equipped to handle file descriptors over DBus and from your implementation it seems Vala can automatically cast those to GSockets. The branch in general is a bit unstable, but I'll try and clear things up a bit so it's at least runnable. Let me know if you're still interested in helping out with that. I'm attaching a link to a bluetooth build of v1.8.2 of the Android app I was given by one of the developers: https://drive.google.com/open?id=1MynMgweRB68vJjfaeEP9WgEFboLVL8HW UPDATE Nevermind that about file-descriptors; got that working. Just working on getting the rest going now :) |
A short status update.
Some things to keep in mind:
|
Sorry, I am really busy and I haven't find the time to help on this, but I will try to test this! One question, how do you test changes of the extension? Restarting the extension does not always work, I guess because of caching, and restarting gnome-shell (via f2-r) neither. So I usually logout-login, which is quite annoying. |
No problem, your original work is the only reason I could figure it out since Qt is so much different.
Yeah, even in the rewrite there's no button to restart the daemon (I'll put one in tonight). The daemon watches its own file for moves/deletes, so if you're using the Note I mean it when I say it's unstable ;) It shouldn't break anything, but its rough around the edges in a number of places and some things just don't work. |
Thank you for what you've embarked upon. I would find this feature very useful, especially for people who only have a non-shareable wired connection (which is the case at my job).... and who want to keep the phone in silent mode ;-) Good luck to you. Sorry I can't help in this particular area. |
I finally managed to test the bluetooth function! I could see my phone from Gnome and also see Gnome from my phone, that's great! Also in
|
Yeah, pairing is a little weird right now. I talked briefly with Matthijs who I think is continuing the bluetooth for KDE Connect about it, but not sure he understood what I meant. Currently devices are identified by hostname and verified by TLS certificate, but since bluetooth has no TLS certificate to verify I think it would be really easy to spoof a paired device by changing your hostname. Maybe it's not a problem since bluetooth devices have to be paired, but I think a lot of people want to use bluetooth at work/school on shared computers where it might be an issue. The part I got stuck on was file transfers. Incoming transfers get a service UUID instead of a port, but I couldn't get a device to respond to one; same for outgoing transfers where you send a service UUID. Oh also, if you use TCP and bluetooth with the same device you have to manually change it back and forth in dconf-editor right now, since I don't have any UI setup for it yet. |
For bluetooth, the pairing is actually managed idependently from gsconnect, by bluez, and encrypting also. So pairing in kdeconnect should be always accepted automatically. For file transfer, I would say to use bluez, there is a file transfer protocol (https://en.wikipedia.org/wiki/List_of_Bluetooth_protocols#Object_exchange_(OBEX)). Probably you need to add this capability in the spd. Are file transfer already working in kdeconnect? |
No extra encryption is added over Bluetooth in gsconnect, it just means the only identification is hostname. But as long as paired Bluetooth devices are assumed trusted for kdeconnect also that's okay. In kdeconnect transfers are the same as TCP. Regular device channel with identity exchange, then a packet with size, service UUID (instead of TCP port) and optional checksum is sent. They don't use obex at all for transfers. |
I see, sorry I had not understood what you meant by identification by hostname only. I guess it's fine, as all the identification/trusting/encrytion chain is managed by the bluetooth protocol. In Vala, I never managed to add a UUID capability to the bluetooth connection without reconnecting. If it's the same for gjs, then the current approach for file transfer is not doable. Did you ask them why they are not using Obex? It's the same goal and it's already implemented! |
That's okay it's not obvious until you play with the pairing code and you see there's sort of a hole where spoofing could occur. I have a bunch of TODOs I didn't commit reminding me to revisit it when KDE Connect makes a decision how to handle it. I'm still fuzzy on how service UUIDs work, since I only use the DBus API for bluez. KDE Connect uses the Qt bindings which are really convenient and I wish GLib had a proper GIR for them. I have a prototype of a Bluez socket wrapper I wrote somewhere, I'll post tomorrow to see if you have any thoughts. I've pushed a few fixes wrt pairing. I guess I broke device notifications and pairing awhile ago and never noticed, but it should be working now. |
With the fixes I can pair my phone, thanks! For the bt pairing, I would trust the bt protocol to be secure enough, so that we don't have to worry about spoofing. KDEConnect is actually mimicking features from the bt protocol (pairing, secure communication, file sharing, maybe audio bridge for telephony) to TCP, so we don't need to duplicate them on the bt channel. The UUIDs seem really hard to work with in bluez5, that's why it seemed to me it would be easier to use native bt features like OBEX. It's supported out of the box in qt: https://doc.qt.io/qt-5/qtbluetooth-overview.html and most probably in Android also. But yeah, that would be a decision for the KDEConnect people. |
Yeah, I moved almost all the "actions" from dedicated interfaces to Gio.Actions. I found the GActions DBus interface is a lot faster, they can be individually disabled and used with the GMenu API to pass whole menus over DBus easily. It's harder to test in D-Feet, but I've been working on a special debug interface for that I'll get back to later. I fixed the mousepad plugin, it was just an oversight. I reorganized the code path to a Yeah, the most awkward part of bluetooth in KDE Connect is it conflicts with all the features they duplicate. Pairing, transfers, contacts...I'm not too worried since it's still not a standard feature and tethering can be used if necessary. In the Qt bindings you basically just open a "socket" with the UUID, which I assume is the same as connecting a profile and waiting for |
I submitted a PR #134 that fixes some problems with pairing. I asked on KDEconnect issue tracker (https://phabricator.kde.org/T7447), I was wrong, OBEX is not fully working in Qt, so they are not planning on using it. I tested the mousepad plugin with TCP on another computer and it's working fast. On this same computer on bt it was fast also, so maybe a pb with the first computer. The clipboard plugin is not working at all, the clipboard content is not sent to the phone. I have enable both Copy and Paste in the UI. What is |
That's awesome! But...after seeing your PR I took a much longer look at all the (current) code, then I looked more closely at KDE Connect's handling. You definitely caught some things I missed, but I also missed some other things. The problem with using
It could also be the debug messages. I removed a lot of them in
Yeah, I sort of broke that and have some unstaged changes to get back to. A couple people have requested "sync on demand" and the only way to do that is to buffer them and offer a GAction that can be bound to a keybinding, I'll try and get back to that asap. I'm pushing now, but there's some unstaged stuff that might still be broken, bear with me :) |
I haven't done much work on this recently, but I built an Apk from git with bluetooth support, so I thought I'd share. This is 1.8.4+ whatever's in git: kdeconnect-bt-1.8.4.apk. Reminder for those subscribed here: bluetooth is experimental at best, not supported and only in wip-rewrite, not master. |
something cool . i am using master in pc and f-droid version on android (i mean not bluetooth version). when they are connected by bluetooth gsconnect not working but when i enable bluetooth tethering on my phone gsconnect starts working with bluetooth . i tried some of features and they worked perfect . did you know this ? |
Yep, tethering bluetooth will work with both KDE Connect and GSConnect since it's TCP over a bluetooth connection. |
@getzze I'm pretty close to releasing v13, and since bluetooth support wouldn't be here at all without your help I thought of adding you to the About Dialog credits. Since your name/email would be there I thought I should ask if you'd like that or not. Let me know! |
@andyholmes Of course, no problem! Thanks |
Is Bluetooth now working in GSConnect with KDE Connect from Playstore? Or do I need to do something else? |
Bluetooth is still experimental in GSConnect, KDE Connect Android and KDE Connect desktop. The original author of Bluetooth support in KDE Connect hasn't been around in a very long time, and no one else has picked up the project To test it with GSConnect you'll have to build the Android app from git, and uncomment all the lines containing "bluetooth" that have been commented out. |
Personal reminder for later: https://phabricator.kde.org/D17789 |
FYI, scheduled reminders are one of the handier installable features of Probot. |
Hi, what is currently the status on this? |
Current status is that a multiplex connection protocol for Bluetooth was merged into To test this, you'll have to uncomment the bluetooth link provider in In reality, no one has really done any testing except the KDE Connect developer who designed the multiplexer and me, so development is basically stalled. |
Hi, what's the progress on this? Also if it's still in the experimental stage, what are steps one needs to do to test it? |
There is no progress; development is still stalled without contributors or testers. You should expect this to require some effort to get it working at all. To start contributing to GSConnect you'll have to pull the To start working on |
Hi guys, I hope that with the new developers it will be possible to implement bluetooth |
Is there a way to implement bluetooth calls like Windows Your Phone app does? |
I think it's beyond the capabilities of the developer. |
I'm going to go ahead and lock this now; no comment made since December 2018 is relevant to resolving the issue. Please feel free to contact a maintainer to re-open the issue if you are interested in working on this feature. |
The KDEconnect app has supported bluetooth for quite some time now, although the apk needs to be compiled with certain options enabled to use it. Is there any possibility for gsconnect to support bluetooth?
The text was updated successfully, but these errors were encountered: