site  contact  subhomenews

Success sending a file from PC to phone

October 22, 2020 — BarryK

There has been discussion on the forum about this not working in Easy Dunfell:

I found out why it was failing: the 'obexd' daemon, in the bluez package, must be running. Which can be done:

# /usr/libexec/bluetooth/obexd

There should have been a script in /etc/init.d to start it. I wondered why the bluez5 package did not install such a script, and found a patch for OE to do that:

...odd, it isn't in the latest bluez5 recipe in OE Dunfell release.

11pm, want to relax in front of the TV for awhile, will look at this again tomorrow. Well no, visiting relatives tomorrow, but will get onto it in the afternoon. Good that there is progress.

EDIT 2020-10-23:
Got it figured out! The above link has a patch to create /etc/init.d/bluez-obexd, to explicitly start 'obexd' at bootup. However, from online reading I got to understand that it is supposed to start automatically, via dbus.

This was not happening. When ran 'bluetooth-sendto' to send a file to my phone, got this error message:

# bluetooth-sendto
Acquiring proxy failed: Error calling StartServiceByName for org.bluez.obex: Failed to execute program org.bluez.obex: No such file or directory

I got a hint how to fix it here:

So much online information is about systemd, it is becoming increasingly difficult to find out to configure without systemd. Anyway, the solution is two files:



<!-- This configuration file specifies the required security policies
for Obex core daemon to work. -->

<!DOCTYPE busconfig PUBLIC "-//freedesktop/DTD D-BUS Configuration 1.0//EN"
<policy user="root">
<allow own="org.bluez.obex"/>
<allow send_destination="org.bluez.obex"/>
<allow send_interface="org.bluez.obex"/>


[D-BUS Service]

Note, 'obexd' is actually at /usr/libexec/bluetooth/obexd, and /usr/sbin/obexd is a symlink to it. The actual location of 'obexd' differ on other distros.

Now, 'bluetooth-sendto' automatically starts 'obexd' -- actually, I think that it is 'bluetoothd' that starts 'obexd' -- whatever, it now starts and file transfer successful. Expect fix in 0.94 coming soon.   

Tags: easy