FreeBSD-5.3 obexapp-1.3 Can't send file to PC from phone

Maksim Yevmenkin maksim.yevmenkin at savvis.net
Mon Dec 13 10:08:03 PST 2004


Hello Edwin,

> I have a Nokia3660 and a newly installed FreeBSD-5.3.
> I installed obexapp/openobex and was able to use
> obexapp to push a file to my phone's inbox but I can't
> pull a file from my phone to my PC nor send a file
> directly from my phone to my PC. Here are some
> details. Hope you could help me coz if I can't send
> bidirectionally, I cant transfer file from my phone. I
> use my phone as portable storage device wherein I save
> my files to my phone and open it at home's PC. If you
> could help me make this thing work, many thanks to
> you!

[snip]

so far everything looks good to me.

> - my target device is Nokia3660 [00:60:57:b6:f7:b1]
> which has an OBEX file trasfer protocol
> 
> - i want to my phone from FreeBSD and vise versa using
> obexapp
> 
> - i run sdpd
> 
> - i run sdpcontrol -l browse
> 
> Record Handle: 00000000
> Service Class ID List:
>         Service Discovery Server (0x1000)
> Protocol Descriptor List:
>         L2CAP (0x0100)
>                 Protocol specific parameter #1:
> u/int/uuid16 1
>                 Protocol specific parameter #2:
> u/int/uuid16 1
> 
> Record Handle: 0x00000001
> Service Class ID List:
>         Browse Group Descriptor (0x1001

ok. thats default (empty) sdpd(8) database, i.e. *no* usable services 
registered on your pc. that means remote device will not be able to do 
anything.

> - i can connect to my phone using obexapp
> misoy# obexapp -a misoy -C OPUSH
> obex> 
> 
> - i can transfer a file from FreeBSD to phone using
> Put command in obexapp
> misoy# obexapp -a misoy -C OPUSH
> vi /home/misoy/test.txt
> obex> Put test.txt
> put: local file>
> Cancelled
> obex> P
> put: local file> test.txt
> put: remote file> test.txt
> Success, response: OK, Success (0x20)
> obex>        

that's fine too. because in this case your pc is acting as a *client*, 
i.e. your pc (obexapp(1)) will query *remote* device (phone) to find out 
which services it offers.

> - can't get file from my phone using Get of obexapp
> maybe because i don't have a shared file
> 
> - how about if i try to send file(picture) from my
> phone to PC (initiated file transfer from phone)  
> * obexapp connection is of course turned off
> * sdpd is running in background
> * i select a pic form my phone
> * send it to my freebsd machine
> * then, i got an "Unable to connect!" message in my
> phone.

well, that's just it. you have to run bluetooth service *server* on your 
pc in order to accept pictures/files etc. in addition to that *local* 
sdpd(8) must be running (which you have) *and* bluetooth service *must* 
be registered with local sdpd(8). otherwise the phone will not be able 
to find the service on your pc.

> - i tried running obexapp server in FreeBSD
> %obexapp -s -C 10 -r /home/misoy/bluetooth/
> * still "Unable to connect!" is the error when i send
> file from my phone

in order to *offer* services to the remote clients, you need two things:

1) run sdpd(8). you need to start it as root. once you run it make sure 
it continues to run. 'sdpcontrol -l browse' (again, you need to run it 
as root) is way to see if sdpd(8) is running and what services are offered.

2) run bluetooth service server (in your case obexapp(1)). all bluetooth 
service servers *will* register service with local sdpd(8) 
automatically, but you *need* to start them as root. again, once you run 
it make sure it continues to run.

so, in your case, you want to do the following:

make sure /home/misoy/bluetooth directory exists and writable for user 
'misoy'.

# sdpd
# obexapp -s -S -C 10 -u misoy -r /home/misoy/bluetooth/

note that i added two more options to the obexapp(1) command:

'-S' will make to obexapp(1) to chroot(2) into /home/misoy/bluetooth

'-u misoy' will make obexapp(1) to drop root privileges and run as 
'misoy' user.

after you run these command run

# sdpcontrol -l browse

and *should* see 'OBEX Push' service. if you do not see it, then you 
need to check if obexapp(1) is running, and if its not - then check 
/var/log/messages for errors.

keep in mind that you *can* have obexapp(1) running as *server* in the 
background and use obexapp(1) as *client* at the same time.

thanks,
max


More information about the freebsd-bluetooth mailing list