# Four bluetooth modules - file sending

## chojny

Hi

I have connected four bluetooth modules to my PC:

```
hciconfig

hci0:   Type: USB

        BD Address: 00:11:67:BB:9C:D6 ACL MTU: 1021:4 SCO MTU: 48:10

        UP RUNNING PSCAN ISCAN

        RX bytes:726 acl:0 sco:0 events:33 errors:0

        TX bytes:379 acl:0 sco:0 commands:26 errors:0

hci1:   Type: USB

        BD Address: 00:11:67:BE:D9:4C ACL MTU: 1021:4 SCO MTU: 48:10

        UP RUNNING PSCAN ISCAN

        RX bytes:689 acl:0 sco:0 events:22 errors:0

        TX bytes:331 acl:0 sco:0 commands:20 errors:0

hci2:   Type: USB

        BD Address: 00:11:67:BE:D9:02 ACL MTU: 1021:4 SCO MTU: 48:10

        UP RUNNING PSCAN ISCAN

        RX bytes:689 acl:0 sco:0 events:22 errors:0

        TX bytes:331 acl:0 sco:0 commands:20 errors:0

hci3:   Type: USB

        BD Address: 00:11:67:BE:E3:71 ACL MTU: 1021:4 SCO MTU: 48:10

        UP RUNNING PSCAN ISCAN

        RX bytes:663 acl:0 sco:0 events:19 errors:0

        TX bytes:323 acl:0 sco:0 commands:19 errors:0 
```

I'm looking for a shell command or a script which allows to choose which bluetooth device is used for sending a file.

When I'm using obexftp command file is always pushed by hci0.

I know that I can pick BT device for scanning:

```
hcitool -i hci0 scan
```

 but is it possible to pick on for sending?

Best regards 

Chojny

----------

## chojny

 *Quote:*   

> I have found:
> 
> ```
> ussp-push [--dev DEVID] [--timeo TIMEO] {DEVICE, BTADDR@[BTCHAN]} LFILE RFILE
> 
> ...

 

----------

## chub

I tried the latest obexftp-0.23-r1 but I simply could not get it to send a file to my bluetooth enabled device cellphone.

I recently upgrade to bluez-4.39-r2 and I suspect it has something to do with my problem.

I compiled obexftp with the debug flag and got this:

```
$ obexftp -b 00:00:00:00:00:01 -p test.txt 

Browsing 00:00:00:00:00:01 ...

btkit_browse: Failed to connect to SDP serverobexftp_open()

obexftp_connect_src()

Connecting...btkit_browse: Failed to connect to SDP serverobexftp_connect_src() BT -1

failed: connect

Tried to connect for 515ms

error on connect(): Invalid argument

Still trying to connect

obexftp_connect_src()

Connecting...btkit_browse: Failed to connect to SDP serverobexftp_connect_src() BT -1

failed: connect

Tried to connect for 515ms

error on connect(): Invalid argument

Still trying to connect

obexftp_connect_src()

Connecting...obexftp_connect_src() BT 1

cli_sync_request()

\obexftp_sync()

client_done()

client_done() Found connection number: -1022384746

client_done() Sender identified

obexftp_sync() OBEX_HandleInput = 31

obexftp_sync() Done success=1

done

Tried to connect for 442ms

Sending "test.txt"... obexftp_put_file() Sending test.txt -> test.txt

build_object_from_file() Lastmod = 2009-10-04T16:30:18Z

cli_sync_request()

cli_fillstream_from_file()

cli_fillstream_from_file() Read 5 bytes

cli_fillstream_from_file()

cli_fillstream_from_file() Read 0 bytes

|obexftp_sync()

cli_obex_event() OBEX_EV_REQDONE: obex_rsp=44

client_done()

obexftp_sync() OBEX_HandleInput = 3

obexftp_sync() Done success=0

failed: test.txt

The operation failed with return code 68

obexftp_disconnect()

Disconnecting...cli_sync_request()

/obexftp_sync()

client_done()

obexftp_sync() OBEX_HandleInput = 3

obexftp_sync() Done success=1

done

obexftp_close()

```

I don't know what code 68 means... 

In the end I looked inside the /usr/share/doc/obexftp-0.23-r1/examples

There I found an example of c_example_obex_push.c

Inside that file I found the compile command and used it to compile the program. That example file could push the small text file.

ussp-push simply did not work for me  :Sad: 

----------

