Page 1 of 1

Bluetooth Quick Start Guide on GhostBSD

Posted: Wed Jun 24, 2020 10:18 am
by NevilleGoddard
First load kernel modules:

# kldload ng_ubt
# kldload ubtbcmfw

To persist across reboots:

Put in /etc/rc.conf in the kld_list line:

sysrc kld_list+="ng_ubt"
sysrc kld_list+="ubtbcmfw"

Start services
rc-update add hcsecd
rc-update add bluetooth
rc-update add sdpd

To start these immediately:
service bluetooth start
service sdpd start

Now search for your device:
Start your phone's bluetooth

hccontrol -n ubt0hci inquiry

You should get something like:
Inquiry result, num_responses=1
Inquiry result #0
BD_ADDR: 38:78:88:d3:XX:b2
Page Scan Rep. Mode: 0x1
Page Scan Period Mode: 0x2
Page Scan Mode: 00
Class: 5a:02:0c
Clock offset: 0xa55
Inquiry complete. Status: No error [00]

Find out device name:

hccontrol -n ubt0hci remote_name_request 38:78:88:d3:XX:b2

You should get something like this:

BD_ADDR: 38:78:88:d3:XX:b2
Name: Xperia XZ3

Pair your device:

Edit /etc/bluetooth/hcsecd.conf

ee /etc/bluetooth/hcsecd.conf

Then edit it to look like this obviously changing bluetooth address, pin and device name to yours:

device {
bdaddr 38:78:88:d3:XX:b2;
name "Xperia XZ3";
key nokey;
pin "1234";

Now turn on your device to pairing
then run

#hcsecd -d

Then on your device you should see a request to pair with your computer. Enter pin that you put in at hcsecd.conf and it should pair.

If you pair successfully shut down terminal with Control C

Make a directory for the files to go to:

#mkdir /var/spool/obex

Install software to start obex server for transferring data:

#pkg ins obexapp

To transfer files from GhostBSD to phone or device:

Start obex server as root:

#obexapp -s -C OPUSH

Open another terminal as user and enter:
obexapp -c -a 38:78:88:d3:XX:b2 -C OPUSH

Then you should see in your terminal


Now choose file to transfer and use put to transfer it

obex>put /home/user$/Downloadsorwherever/file.jpg

Then on you phone you should see a request to receive file. Tap yes and the file will be transferred.

Now from phone to GhostBSD:

Choose the file then share by bluetooth, then choose GhostBSD and the file will be copied to /var/spool/obex

That's it!