6

How do you configure Ubuntu Server to automatically receive files over Bluetooth and save them with no user interaction?

This question is almost identical to this question from 2 years ago, but relates to Ubuntu Server, where no GUI is available.

Edit: To clarify, this question is not about pairing Bluetooth devices, but about making an Ubuntu Server machine automatically accept Bluetooth file transfers. This question is not a duplicate.

0

2 Answers 2

1

A quick look in dconf-editor and...

gsettings set org.gnome.desktop.file-sharing bluetooth-obexpush-enabled VALUE

Is the equivalent to 'Receive files in Downloads folder over Bluetooth', VALUE can be true or false

gsettings set org.gnome.desktop.file-sharing bluetooth-obexpush-enabled VALUE

Is the same as 'Notify about received files', VALUE of true or false again.

gsettings set org.gnome.desktop.file-sharing bluetooth-accept-files

is the same as the 'Accept files:' selection box, VALUE can be always, bonded (Only work for set-up devices) and ask.

Here is the picture from the other question in case you need it.

You can find what the current values are using get in place of set, To reset, use reset instead.

To list the available options:

$ gsettings list-keys org.gnome.desktop.file-sharing
bluetooth-accept-files
bluetooth-allow-write
bluetooth-enabled
bluetooth-notify
bluetooth-obexpush-enabled
bluetooth-require-pairing
enabled
require-password

Here also is a list with possible values in bold

org.gnome.desktop.file-sharing bluetooth-accept-files always bonded ask
org.gnome.desktop.file-sharing bluetooth-allow-write true false
org.gnome.desktop.file-sharing bluetooth-enabled true false
org.gnome.desktop.file-sharing bluetooth-notify true false
org.gnome.desktop.file-sharing bluetooth-obexpush-enabled true false
org.gnome.desktop.file-sharing bluetooth-require-pairing true false
org.gnome.desktop.file-sharing enabled true false
org.gnome.desktop.file-sharing require-password never on_write always

More can be found using man gsettings

Hope this helps ;D - Not as though I am doing this just because I use a netbook with a broken display for file sharing, for which this could be rather helpful...


As the above answer will probably only work if you have a graphical Gnome-based desktop installed, a simpler thing may be to use bluez as in the answer here.

12
  • 1
    org.gnome.desktop? I don't have Gnome installed since this is a server; will the Bluetooth system read the configuration from there regardless? I can't test it at the moment.
    – James
    Jan 20, 2014 at 23:04
  • I have tested this and it seems to work - I do have Gnome installed, though this in Unity... Unity is a derivative of Gnome, so they seem to share the same settings.
    – Wilf
    Jan 20, 2014 at 23:12
  • While your answer is probably helpful to some, I just checked, and my server doesn't even have dconf installed, so I don't think this will work.
    – James
    Jan 20, 2014 at 23:22
  • No you don't need it installed, it is just the graphical interface for gsettings, I linked it as then you can use it on an Ubuntu which has a graphical interface if you want. It works without Gnome, on the netbook I referred to in my answer, but you do need to be logged in. By the way, you may be interested in this answer in another question.
    – Wilf
    Jan 21, 2014 at 19:22
  • 1
    Thanks wilf, I found obexpushd a few hours ago and it seems to be working fine; just finished writing an upstart job for it. I came back here to write up a quick answer for it, but if you want credit for it, go ahead and submit something, and I'll mark it as accepted.
    – James
    Jan 24, 2014 at 23:35
1

A good solution that @wilf and I found was to install obexpushd, a daemon that will accept incoming OBEX (and therefore Bluetooth) file transfers and save the files to its working directory.

Just apt-get install obexpushd, and run it in the directory you want the files to be saved in. Or, if you'd like it to start with your machine, here's a simple Upstart job file that should do the trick:

chdir /home/USERNAME
exec obexpushd -n
start on startup

Save the above as /etc/init/obexpushd.conf (making sure to change the first line to point to the directory you'd like the files to be saved), run initctl reload-configuration, and start obexpushd.

Once you've paired your Bluetooth device with your machine, you should be able to send files to it without having to manually accept the transfer.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .