kdeconnect-chrome-extension icon indicating copy to clipboard operation
kdeconnect-chrome-extension copied to clipboard

FreeBSD support

Open pdf opened this issue 3 years ago • 10 comments

I'm seeing this same issue with Firefox 78.0.2 with FreeBSD 12.1. My phone and computer can see each other, but the Firefox extension just has an Orange exclamation mark and if I click on it there are no devices listed. I did compile the kdeconnect-chrome-extension binary and ran kdeconnect-chrome-extension -install making sure to select "Firefox" from the list.

2020-07-22-191509_319x290_scrot

Originally posted by @vendion in https://github.com/pdf/kdeconnect-chrome-extension/issues/34#issuecomment-662744184

pdf avatar Jul 22 '20 23:07 pdf

I've done zero testing on FreeBSD, but if KDE and DBUS function as expected, it might work (I'm not certain if the DBUS library supports FreeBSD correctly).

Please run:

kdeconnect-chrome-extesion -devices

from a terminal.

pdf avatar Jul 22 '20 23:07 pdf

It seems to give an error when I run it with that flag

[/u/h/vendion]─> kdeconnect-chrome-extension -devices
No such method 'devices' in any interface at object path '/modules/kdeconnect' (signature 'bb')
[/u/h/vendion]─> kdeconnect-chrome-extension -version
kdeconnect-chrome-extension version 0.1.3, built with go1.14.6

Although the version is reported as "0.1.3" I built it from commit f155e96 KDE connect does work and my phone and computer is paired

vendion avatar Jul 22 '20 23:07 vendion

So it appears to be connecting to DBUS okay, but it can't find the kdeconnect DBUS interfaces where they're expected to be. Please provide your kdeconnect version, and the output from:

qdbus org.kde.kdeconnect

OT: The version mismatch is an artefact of the crude version checking in the extension, I've separated the CLI version and protocol version to make troubleshooting easier in future, thanks for reminding me.

pdf avatar Jul 23 '20 01:07 pdf

Sure here is the version of kdeconnect daemon I'm working with as well as the output from the qdbus command:

[/u/h/vendion]─> /usr/local/lib/libexec/kdeconnectd --version
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-vendion'
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-vendion'
kdeconnect.daemon 1.4.0
[/u/h/vendion]─> qdbus org.kde.kdeconnect                                                                                                                                                                                                   
/
/MainApplication
/modules
/modules/kdeconnect
/modules/kdeconnect/devices
/modules/kdeconnect/devices/93ae7c11a3901af9
/modules/kdeconnect/devices/93ae7c11a3901af9/contacts
/modules/kdeconnect/devices/93ae7c11a3901af9/findmyphone
/modules/kdeconnect/devices/93ae7c11a3901af9/findthisdevice
/modules/kdeconnect/devices/93ae7c11a3901af9/mprisremote
/modules/kdeconnect/devices/93ae7c11a3901af9/photo
/modules/kdeconnect/devices/93ae7c11a3901af9/ping
/modules/kdeconnect/devices/93ae7c11a3901af9/remotecontrol
/modules/kdeconnect/devices/93ae7c11a3901af9/remotekeyboard
/modules/kdeconnect/devices/93ae7c11a3901af9/sftp
/modules/kdeconnect/devices/93ae7c11a3901af9/share
/modules/kdeconnect/devices/93ae7c11a3901af9/sms
/modules/kdeconnect/devices/93ae7c11a3901af9/telephony
/org
/org/kde
/org/kde/kdeconnect
/org/kde/kdeconnect/daemon

vendion avatar Jul 23 '20 21:07 vendion

Sorry for the delay, can you also please provide qdbus org.kde.kdeconnect /modules/kdeconnect - for some reason your system appears to be missing the expected filterable version of the devices() method, I'm curious what methods are available.

pdf avatar Jul 30 '20 12:07 pdf

Here is the output I get

[/u/h/vendion]─> qdbus org.kde.kdeconnect /modules/kdeconnect
property read bool org.kde.kdeconnect.daemon.isDiscoveringDevices
property read QStringList org.kde.kdeconnect.daemon.pairingRequests
signal void org.kde.kdeconnect.daemon.announcedNameChanged(QString announcedName)
signal void org.kde.kdeconnect.daemon.deviceAdded(QString id)
signal void org.kde.kdeconnect.daemon.deviceListChanged()
signal void org.kde.kdeconnect.daemon.deviceRemoved(QString id)
signal void org.kde.kdeconnect.daemon.deviceVisibilityChanged(QString id, bool isVisible)
signal void org.kde.kdeconnect.daemon.pairingRequestsChanged()
method void org.kde.kdeconnect.daemon.acquireDiscoveryMode(QString id)
method QString org.kde.kdeconnect.daemon.announcedName()
method QString org.kde.kdeconnect.daemon.deviceIdByName(QString name)
method QMap<QString,QString> org.kde.kdeconnect.daemon.deviceNames()
method QMap<QString,QString> org.kde.kdeconnect.daemon.deviceNames(bool onlyReachable)
method QMap<QString,QString> org.kde.kdeconnect.daemon.deviceNames(bool onlyReachable, bool onlyPaired)
method QStringList org.kde.kdeconnect.daemon.devices()
method QStringList org.kde.kdeconnect.daemon.devices(bool onlyReachable)
method QStringList org.kde.kdeconnect.daemon.devices(bool onlyReachable, bool onlyPaired)
method void org.kde.kdeconnect.daemon.forceOnNetworkChange()
method void org.kde.kdeconnect.daemon.releaseDiscoveryMode(QString id)
method QString org.kde.kdeconnect.daemon.selfId()
method void org.kde.kdeconnect.daemon.sendSimpleNotification(QString eventId, QString title, QString text, QString iconName)
method void org.kde.kdeconnect.daemon.setAnnouncedName(QString name)
property read bool org.kde.kdeconnect.daemon.isDiscoveringDevices
property read QStringList org.kde.kdeconnect.daemon.pairingRequests
signal void org.kde.kdeconnect.daemon.announcedNameChanged(QString announcedName)
signal void org.kde.kdeconnect.daemon.deviceAdded(QString id)
signal void org.kde.kdeconnect.daemon.deviceListChanged()
signal void org.kde.kdeconnect.daemon.deviceRemoved(QString id)
signal void org.kde.kdeconnect.daemon.deviceVisibilityChanged(QString id, bool isVisible)
signal void org.kde.kdeconnect.daemon.pairingRequestsChanged()
method void org.kde.kdeconnect.daemon.acquireDiscoveryMode(QString id)
method QString org.kde.kdeconnect.daemon.announcedName()
method QString org.kde.kdeconnect.daemon.deviceIdByName(QString name)
method QMap<QString,QString> org.kde.kdeconnect.daemon.deviceNames()
method QMap<QString,QString> org.kde.kdeconnect.daemon.deviceNames(bool onlyReachable)
method QMap<QString,QString> org.kde.kdeconnect.daemon.deviceNames(bool onlyReachable, bool onlyPaired)
method QStringList org.kde.kdeconnect.daemon.devices()
method QStringList org.kde.kdeconnect.daemon.devices(bool onlyReachable)
method QStringList org.kde.kdeconnect.daemon.devices(bool onlyReachable, bool onlyPaired)
method void org.kde.kdeconnect.daemon.forceOnNetworkChange()
method void org.kde.kdeconnect.daemon.releaseDiscoveryMode(QString id)
method QString org.kde.kdeconnect.daemon.selfId()
method void org.kde.kdeconnect.daemon.sendSimpleNotification(QString eventId, QString title, QString text, QString iconName)
method void org.kde.kdeconnect.daemon.setAnnouncedName(QString name)
signal void org.freedesktop.DBus.Properties.PropertiesChanged(QString interface_name, QVariantMap changed_properties, QStringList invalidated_properties)
method QDBusVariant org.freedesktop.DBus.Properties.Get(QString interface_name, QString property_name)
method QVariantMap org.freedesktop.DBus.Properties.GetAll(QString interface_name)
method void org.freedesktop.DBus.Properties.Set(QString interface_name, QString property_name, QDBusVariant value)
method QString org.freedesktop.DBus.Introspectable.Introspect()
method QString org.freedesktop.DBus.Peer.GetMachineId()
method void org.freedesktop.DBus.Peer.Ping()

vendion avatar Jul 30 '20 13:07 vendion

Well, now I'm very confused - the expected method appears to be available, but does not appear to be callable from our code. Just to confirm, please try: qdbus org.kde.kdeconnect /modules/kdeconnect devices false true

If that works though, I'm not really sure what to try next short of setting up a full FreeBSD + KDE env here to test on, and I'm not likely to have the time for that in the near future.

pdf avatar Jul 30 '20 13:07 pdf

On Thursday, July 30, 2020 9:49:39 AM EDT Peter Fern wrote:

qdbus org.kde.kdeconnect /modules/kdeconnect devices false true

When I run that command I get the following:

[/u/h/vendion]─> qdbus org.kde.kdeconnect /modules/kdeconnect devices false true 93ae7c11a3901af9

Question does kdeconnect-chrome-extension interact with the kdeconnect daemon strictly through dbus calls or does in interact with the daemon directly for certain things?

vendion avatar Jul 31 '20 11:07 vendion

Question does kdeconnect-chrome-extension interact with the kdeconnect daemon strictly through dbus calls or does in interact with the daemon directly for certain things?

Strictly through DBUS.

The error you posted earlier:

No such method 'devices' in any interface at object path '/modules/kdeconnect' (signature 'bb')

says that we couldn't find the devices method, that accepts 2 bools, but your result in your last post says that it does indeed exist, and functions as expected.

The only thing I can think is that there's a problem with the DBUS lib on FreeBSD, though I can't imagine how exactly - we appear to be connecting to the session bus okay, or it would error earlier. I can't think of a way to test beyond writing some Go DBUS code and running it on FreeBSD to probe where we're falling down, but that's going to be a little painful without a local system to test on.

pdf avatar Jul 31 '20 11:07 pdf

I've been working on getting kdeconnect up and running on FreeBSD 13.2; and managed to figure it out!

For one ... there are some errors in dependencies (or at least they're outdated), that required manual patching to create a build based on the most recent code for kdeconnect-chrome-extension.

Beyond that ... the error mentioned in this issue seems (at least for me) to be related to the setting of the DBUS_SESSION_BUS_ADDRESS and DBUS_SESSION_BUS_PID environment variables.

There does appear to be some code that attempts to set it in godbus/dbus ... but the parsing breaks (some error about authentication is printed alongside a dbus-launch like output that it tries to parse), and it can't set those variables correctly.

So ... if you have a FreeBSD build of the kdeconnect-chrome-extension binary, try setting those 2 env vars (based on dbus-launch output; I had to adapt mine to tcsh), and see if it works! On my end ... I'm able to discover, pair, and send links between devices just fine, with these set!

Hope it helps!

crynux avatar Aug 09 '23 05:08 crynux