First, you need to create a ubt0.conf file in /etc/bluetooth. Login as root open a terminal and run these commands:
cd /etc/bluetooth
touch ubt0.conf
ee ubt0.conf
Then enter the following:
authentication_enable="YES"
connectable="YES"
discoverable="YES"
role_switch="YES"
Next, edit /etc/rc.conf and enter the following
sdpd_enable="YES"
hcsecd_enable="YES"
If you have a recent intel bluetooth device, such as an AX200 or similar, you need to install the needed firmware:
pkg install iwmbt-firmware
Also obexapp and openobex to send files
pkg install obexapp openobex
Then create a folder to receive your bluetooth files:
mkdir /var/spool/obex
Then reboot
shutdown -r now
When boot up is finished, pair GhostBSD with your Android phone. There's a utility to do this in GhostBSD called bluetooth-config. Turn your phone on and go to Settings then Connected Devices. Login as root in GhostBSD then run in a terminal:
bluetooth-config scan
In the terminal you'll see output like:
Scanning for new Bluetooth devices (Attempt 1 of 5) ... failed.
Scanning for new Bluetooth devices (Attempt 2 of 5) ... failed.
Scanning for new Bluetooth devices (Attempt 3 of 5) ... done.
Found 2 new bluetooth devices (now scanning for names):
[ 1] 48:88:4a:g8:f6:97 "xxxxx-xxx (ubt0)" ()
[ 2] 14:50:88:e8:44:86 "AQUOS sense7"
Select device to pair with [1-2, or 0 to rescan]:
My phone is the aquos. If your device is found enter the number. In my case I would enter 2. If your device isn't found , rescan by entering 0.
Then your phone will be added to bluetooth hosts, and you can give your phone a name. If you give your phone a name, it makes things easier because you don't need to keep entering your phone's bluetooth address.
Then put your phone in pairing mode and enter a pin nimber in the terminal. 4 digits should be ok.
Then press enter and on your phone will be a request to pair with your computer. Enter the pin number you made previously and then you're paired.
Now to test if bluetooth is working start the obex server. As root:
obexapp -s -C OPUSH
-s means start the server
-C is the channel you'll be using
Then make sure your phone is on and open another terminal and as normal user enter
obexapp -c -a yourphonename -C OPUSH
Now obexapp will scan for all phones with the name you gave it while using bluetooth-config
Sometomes the first time is not successful. Just try the same command again. If successful, you should see in the terminal
you@you-ghostbsd ~> obexapp -c -a yourphonename -C OPUSH
obex>
This means you are paired. Now send something like a picture from your phone. The sent file will go to /var/spool/obex
If you want to send a file to your phone put in the terminal after obex>
put /where/the/file/is/pic.jpg
eg put/home/yourname/Pictures/pic.jpeg
And you'll get a notification on your phone that a file is ready to be received.
After the file is sent, enter
di
In the terminal to disconnect your phone
That's it