# Bluetooth: cannot send file to my PC.



## ffrank (Nov 17, 2018)

Hi, this is my first post ever. I'm trying FreeBSD (12 beta 3) for the first time. I've configured everything except two devices: the first is the bluethooth, the second not yet.
I can send files to my smartphone, but I cannot receive them.
Some help, please?


----------



## Neville (Nov 22, 2018)

Hi. 
For me this works.
As root run this command.
obexapp -s -C 5 
Then open another terminal and run as user:
obexapp -c -a your:bluetooth:bd:addr -C OPUSH
then try and send from your phone.
Hope this helps.


----------



## ffrank (Nov 24, 2018)

Neville said:


> Hi.
> For me this works.
> As root run this command.
> obexapp -s -C 5
> ...


No, it doesn't.
I must always launch obexapp as root; I must also launch hcsecd as root; In obexapp when I use the command get /path-and-filename I get the following message: Failure, response: Not implemented! (0x51)
I followed the hadbook, but I'm not sure if the files rc.conf, hcsecd.conf and others are correct in the relevant parts. I also don't know if pairing is necessary.


----------



## Neville (Nov 24, 2018)

Perhaps you haven't quite finished setting up your Bluetooth.
This is what I have done to set up my bluetooth to receive files from my phone to my computer.
I got my phone Bluetooth address and name with these commands as normal user:

hccontrol -n ubt0hci inquiry
(for phone Bluetooth address)

hccontrol -n ubt0hci remote_name_request 11:31:55:90:xx:v8          (use your BD_ADDR)
(for phone number/name)


I edited the /etc/bluetooth/hcsecd file like this:

device {
       bdaddr   yourphone:bd:add:dr;
       name    "MyPhoneIDNumber";
       key        nokey;
       pin        "1234";
}


the pin can of course be any number you want.
I turned on bluetooth on my phone
Then as root ran this command

hcsecd -d

I then initiated pairing from my phone. I think pairing of devices is necessary.
Your Bluetooth device should show up in your phone as "yourcomputername(ubt0)"
After successfully pairing my phone and computer, in the terminal I entered Control C to turn off hcsecd.
Then as root again

service sdpd start

then create the folder to send the sent files to (as root again)

mkdir /var/spool/whatever-name-you-want

then as root again:

obexapp -s -C 5

and open up another terminal and as user:

obexapp -c -a your:bluetooth:bd:addr -C OPUSH

then from your phone initiate the sending of the file by tapping on it and select share by Bluetooth. I wouldn't try using the get command. Then your phone should see your computer because you have paired with it and tap on your computer and the file should be sen to your computer and put in the /var/spool/whatever-name-you-want folder.

I prefer starting hcsecd and sdpd at boot time so I have this in my /etc/rc.conf

sdpd_enable="YES"
hcsecd_enable="YES"

Then you don't have to start these services every time to send files.
Hope this helps.


----------



## ffrank (Nov 26, 2018)

The problem seems to be my phone and PC cannot pair (I get no messages, I get nothing).
I don't know why this happen, but it is not important, I can also connect my phone through wire. Thanks for your time.


----------



## Neville (Dec 5, 2018)

no problem


----------

